summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2011-09-2030-111/+292
|\
| * HMP: info status: Print the VM stateLuiz Capitulino2011-09-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today our printf format for the "info status" command is: VM status: %s Where the string can be "running", "running (single step mode)" or "paused". This commit extends it to: VM status: %s (%s) The second string corresponds to the "status" field as returned by the query-status QMP command and it's only printed if "status" is not "running" or "paused". Example: VM status: paused (shutdown) PS: libvirt uses "info status" when using HMP, but the new format should not break it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * QMP: query-status: Introduce 'status' keyLuiz Capitulino2011-09-154-3/+43
| | | | | | | | | | | | | | This new key reports the current VM status to clients. Please, check the documentation being added in this commit for more details. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * Monitor/QMP: Don't allow cont on bad VM stateLuiz Capitulino2011-09-154-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have two states where issuing cont before system_reset can cause problems: RSTATE_SHUTDOWN (when -no-shutdown is used) and RSTATE_PANICKED (which only happens with kvm). This commit fixes that by doing the following when state is RSTATE_SHUTDOWN or RSTATE_PANICKED: 1. returning an error to the user/client if cont is issued 2. automatically transition to RSTATE_PAUSED during system_reset Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * Drop the vm_running global variableLuiz Capitulino2011-09-1514-27/+29
| | | | | | | | | | | | Use runstate_is_running() instead, which is introduced by this commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * Drop the incoming_expected global variableLuiz Capitulino2011-09-153-5/+1
| | | | | | | | | | | | | | | | | | | | | | Test against RSTATE_IN_MIGRATE instead. Please, note that the RSTATE_IN_MIGRATE state is only set when all the initial VM setup is done, while 'incoming_expected' was set right in the beginning when parsing command-line options. Shouldn't be a problem as far as I could check. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * runstate_set(): Check for valid transitionsLuiz Capitulino2011-09-152-1/+74
| | | | | | | | | | | | | | | | | | | | | | | | This commit could have been folded with the previous one, however doing it separately will allow for easy bisect and revert if needed. Checking and testing all valid transitions wasn't trivial, chances are this will need broader testing to become more stable. This is a transition table as suggested by Lluís Vilanova. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * RunState: Add additional statesLuiz Capitulino2011-09-154-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | Currently, only vm_start() and vm_stop() change the VM state. That's, the state is only changed when starting or stopping the VM. This commit adds the runstate_set() function, which makes it possible to also do state transitions when the VM is stopped or running. Additional states are also added and the current state is stored. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * Replace the VMSTOP macros with a proper state typeLuiz Capitulino2011-09-1524-76/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today, when notifying a VM state change with vm_state_notify(), we pass a VMSTOP macro as the 'reason' argument. This is not ideal because the VMSTOP macros tell why qemu stopped and not exactly what the current VM state is. One example to demonstrate this problem is that vm_start() calls vm_state_notify() with reason=0, which turns out to be VMSTOP_USER. This commit fixes that by replacing the VMSTOP macros with a proper state type called RunState. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * Move vm_state_notify() prototype from cpus.h to sysemu.hLuiz Capitulino2011-09-152-1/+1
| | | | | | | | | | | | It's where all the state handling functions prototypes are located. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | wavaudio: Use stdio instead of QEMUFileJuan Quintela2011-09-201-10/+36
| | | | | | | | | | | | | | | | | | | | QEMUFile * is only intended for migration nowadays. Using it for anything else just adds pain and a layer of buffers for no good reason. Signed-off-by: Juan Quintela <quintela@redhat.com> CC: malc <av1474@comtv.ru> Signed-off-by: malc <av1474@comtv.ru>
* | wavcapture: Use stdio instead of QEMUFileJuan Quintela2011-09-201-23/+56
| | | | | | | | | | | | | | | | | | | | QEMUFile * is only intended for migration nowadays. Using it for anything else just adds pain and a layer of buffers for no good reason. Signed-off-by: Juan Quintela <quintela@redhat.com> CC: malc <av1474@comtv.ru> Signed-off-by: malc <av1474@comtv.ru>
* | sun4u: don't set up isa_mem_baseBlue Swirl2011-09-181-1/+0
| | | | | | | | | | | | | | | | | | | | Since we use memory API in sun4u.c, after 71579cae30b53c910cd6c47ab4e683f647d36519, setting up isa_mem_base puts vga.chain4 outside of the physical address space. Fix by removing obsolete isa_mem_base set up. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | tcg/ppc64: Only one call output register needed for 64 bit hostsStefan Weil2011-09-171-1/+1
| | | | | | | | | | | | | | | | | | The second register is only needed for 32 bit hosts. Cc: Vassili Karpov <av1474@comtv.ru> Fine-with-me'd-by: Vassili Karpov <av1474@comtv.ru> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | tcg/sparc: Only one call output register needed for 64 bit hostsStefan Weil2011-09-171-2/+4
| | | | | | | | | | | | | | | | The second register is only needed for 32 bit hosts. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | tcg/s390: Only one call output register needed for 64 bit hostsStefan Weil2011-09-171-1/+3
| | | | | | | | | | | | | | | | | | The second register is only needed for 32 bit hosts. Cc: Alexander Graf <agraf@suse.de> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | tcg/ia64: Only one call output register needed for 64 bit hostsStefan Weil2011-09-171-3/+2
| | | | | | | | | | | | | | | | The second register is never used for ia64 hosts. Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | tcg/i386: Only one call output register needed for 64 bit hostsStefan Weil2011-09-171-1/+3
| | | | | | | | | | | | | | The second register is only needed for 32 bit hosts. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | target-i386: Fix several SSE3 instructions.Max Reitz2011-09-171-18/+18
| | | | | | | | | | | | | | | | | | | | haddp[sd], hsubp[sd] and addsubp[sd] operate on floats, thus it is necessary to use the appropriate floating point calculation functions. If this is not done, those functions operate merely on integers, which is not correct. Signed-off-by: Max Reitz <max@tyndur.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | trace: add virtio_set_status() trace eventStefan Hajnoczi2011-09-173-8/+12
| | | | | | | | | | | | | | | | | | | | The virtio device lifecycle can be observed by looking at the sequence of set status operations. This is especially important for catching the reset operation (status value 0), which resets the device and all virtqueues. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | trace: remove trailing double quotes after PRI*64Stefan Hajnoczi2011-09-171-17/+17
| | | | | | | | | | | | | | | | Now that format strings can end in a PRI*64 macro, remove the workarounds from the trace-events file. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | trace: allow PRI*64 at beginning and ending of format stringStefan Hajnoczi2011-09-172-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tracetool parser only picks up PRI*64 and other format string macros when enclosed between double quoted strings. Lift this restriction by extracting everything after the closing ')' as the format string: cpu_set_apic_base(uint64_t val) "%016"PRIx64 ^^ ^^ One trick here: it turns out that backslashes in the format string like "\n" were being interpreted by echo(1). Fix this by using the POSIX printf(1) command instead. Although it normally does not make sense to include backslashes in trace event format strings, an injected newline causes tracetool to emit a broken header file and I want to eliminate cases where broken output is emitted, even if the input was bad. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | trace: remove newline from grlib_irqmp_check_irqs format stringStefan Hajnoczi2011-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | There is no need to put a newline in trace event format strings. The backend may use the format string within some context and takes care of how to display the event. The stderr backend automatically appends "\n" whereas the ust backend does not want a newline at all. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Makefile: Fix broken buildStefan Weil2011-09-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make -C mybuilddir no longer works (regression caused by commit) 388d475815c23901010a25c845eb078d47ee0740. PWD is the directory of the caller (not mybuilddir), so BUILD_DIR is set to the wrong value. GNU make sets CURDIR to the correct value. Use this macro instead of PWD. Cc: Lluís Vilanova <vilanova@ac.upc.edu> Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | qdev: print bus properties tooGerd Hoffmann2011-09-161-0/+6
| | | | | | | | | | | | | | | | | | Make qdev_device_help print both device and bus properties. Helps libvirt to figure whenever bus properties such as PCI.multifunction are supported present or not. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | vga: Respect isa_mem_base when registering chain4 aliasJan Kiszka2011-09-161-0/+1
| | | | | | | | | | | | | | | | This does not yet unbreak PPC (which has its own problems) but potentially other non-x86 systems where isa_mem_base is != 0. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | hw/integratorcp: Fix bugs in writes to CM_CTRL system registerPeter Maydell2011-09-161-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a number of bugs in the implementation of writes to the CM_CTRL system register: * write to cm_ctrl, not cm_init ! * an '&' vs '^' typo meant we would write the inverse of the bits * handling the LED via printf() meant we spew lots of output to stdout when Linux uses the LED as a heartbeat indicator * we would hw_error() if a reset was requested rather than actually resetting Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | bswap.h: build fixChristoph Egger2011-09-161-2/+1
| | | | | | | | | | | | | | | | | | qemu build fails when CONFIG_MACHINE_BSWAP_H is defined because float32, float64, etc. are not defined. This makes qemu build. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | console: Properly switch consoles for screen dumpsJan Kiszka2011-09-161-3/+10
| | | | | | | | | | | | | | | | Do not mess with active_console, use console_select instead. This fixes corrupt virtual monitor consoles after issuing the screendump command. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | vga: Fix text mode screendumpsJan Kiszka2011-09-161-4/+3
| | | | | | | | | | | | | | | | | | In text mode, even a full refresh of the screen takes multiple updates. As we reset the dump file pointer after the first call, we only wrote the first line. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Fix termination by signal with -no-shutdownKevin Wolf2011-09-161-0/+1
| | | | | | | | | | | | | | | | On signals such as SIGTERM qemu should exit instead of just stopping the VM even with -no-shutdown. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Remove blanks before \n in output stringsStefan Weil2011-09-1616-41/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Those blanks violate the coding conventions, see scripts/checkpatch.pl. Blanks missing after colons in the changed lines were added. This patch does not try to fix tabs, long lines and other problems in the changed lines, therefore checkpatch.pl reports many violations. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | build: Move tracing objects into libuser on usermode emulation targetsLluís Vilanova2011-09-164-5/+9
| | | | | | | | | | | | | | | | This will apply libuser-specific compilation flags (like the ones added by --enable-user-pie), but keep softmmu emulation targets "as-is". Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | build: Always have 'BUILD_DIR' variable pointing to the root of the build treeLluís Vilanova2011-09-161-1/+4
|/ | | | | | Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'qemu-kvm-tmp/memory/core' into stagingAnthony Liguori2011-09-151-2/+2
|\
| * Fix subtle integer overflow bug in memory APIDavid Gibson2011-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is quite common to have a MemoryRegion with size of INT64_MAX. When processing alias regions in render_memory_region() it's quite easy to find a case where it will construct a temporary AddrRange with a non-zero start, and size still of INT64_MAX. When means attempting to compute the end of such a range as start + size will result in signed integer overflow. This integer overflow means that addrrange_intersects() can incorrectly report regions as not intersecting when they do. For example consider the case of address ranges {0x10000000000, 0x7fffffffffffffff} and {0x10010000000, 0x10000000} where the second is in fact included completely in the first. This patch rearranges addrrange_intersects() to avoid the integer overflow, correcting this behaviour. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Avi Kivity <avi@redhat.com>
* | Merge remote-tracking branch 'aneesh/for-upstream-4' into stagingAnthony Liguori2011-09-152-0/+130
|\ \
| * | hw/9pfs: add 9P2000.L unlinkat operationAneesh Kumar K.V2011-09-092-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unlinkat - Remove a directory entry size[4] Tunlinkat tag[2] dirfid[4] name[s] flag[4] size[4] Runlinkat tag[2] older Tremove have the below request format size[4] Tremove tag[2] fid[4] The remove message is used to remove a directory entry either file or directory The remove opreation is actually a directory opertation and should ideally have dirfid, if not we cannot represent the fid on server with anything other than name. We will have to derive the directory name from fid in the Tremove request. NOTE: The operation doesn't clunk the unlink fid. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
| * | hw/9pfs: add 9P2000.L renameat operationAneesh Kumar K.V2011-09-092-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rename - change name of file or directory size[4] Trenameat tag[2] olddirfid[4] oldname[s] newdirfid[4] newname[s] size[4] Rrenameat tag[2] older Trename have the below request format size[4] Trename tag[2] fid[4] newdirfid[4] name[s] The rename message is used to change the name of a file, possibly moving it to a new directory. The rename opreation is actually a directory opertation and should ideally have olddirfid, if not we cannot represent the fid on server with anything other than name. We will have to derive the old directory name from fid in the Trename request. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
| * | hw/9pfs: Fix memleaks in some 9p operationAneesh Kumar K.V2011-09-091-0/+2
| | | | | | | | | | | | Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
| * | hw/9pfs: Initialize rest of qid field to zero.Aneesh Kumar K.V2011-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Since qid is allocated out of stack we need to intialize the field to zero. Otherwise we will send wrong qid value to client. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
| * | hw/9pfs: Update the fidp path before opendirAneesh Kumar K.V2011-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | We need to update the fidp path before opendir. Since we don't use the fid returned by mkdir, earlier code should not have much issue. We do a double v9fs_string_copy here. The later patch cleanup the entire function. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
* | | qcow2: fix range checkFrediano Ziglio2011-09-121-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCowL2Meta::offset is not cluster aligned but only sector aligned however nb_clusters count cluster from cluster start. This fix range check. Note that old code have no corruption issues related to this check cause it only cause intersection to occur when shouldn't. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | | qcow2: align cluster_data to block to improve performance using O_DIRECTFrediano Ziglio2011-09-121-7/+7
| | | | | | | | | | | | | | | Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | | ahci: Remove unused struct memberStefan Weil2011-09-122-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Member variable is_read is written, but never read (contrary to its name). Remove it. Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | | qcow2: initialize metadata before inserting in cluster_allocsFrediano Ziglio2011-09-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCow2Meta structure was inserted into list before many fields are initialized. Currently is not a problem cause all occur in a lock but if qcow2_alloc_clusters would in a future unlock this lock some issues could arise. Initializing fields before inserting fix the problem. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | | ide/atapi scsi-disk: Make monitor eject -f, then change workMarkus Armbruster2011-09-123-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | change fails while the tray is locked by the guest. eject -f forces it open and removes any media. Unfortunately, the tray closes again instantly. Since the lock remains as it is, there is no way to insert another medium unless the guest voluntarily unlocks. Fix by leaving the tray open after monitor eject. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | | block: New change_media_cb() parameter loadMarkus Armbruster2011-09-126-11/+12
| | | | | | | | | | | | | | | | | | | | | To let device models distinguish between eject and load. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | | nbd: Clean up use of block_int.hMarkus Armbruster2011-09-123-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | | block: Reset buffer alignment on detachMarkus Armbruster2011-09-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BlockDriverState member buffer_alignment is initially 512. The device model may set them, with bdrv_set_buffer_alignment(). If the device model gets detached (hot unplug), the device's alignment is left behind. Only okay because device hot unplug automatically destroys the BlockDriverState. But that's a questionable feature, best not to rely on it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud