aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-02-24Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori12-62/+104
* qmp/queue/qmp: qmp: add DEVICE_TRAY_MOVED event ide: drop ide_tray_state_post_load() block: Don't call bdrv_eject() if the tray state didn't change block: bdrv_eject(): Make eject_flag a real bool block: Rename bdrv_mon_event() & BlockMonEventAction
2012-02-24Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori69-0/+153385
* kwolf/for-anthony: (46 commits) qemu-iotests: common.config: Allow use of arbitrary qemu* paths qemu-iotests: check: print relevant path information qemu-iotests: test loading internal snapshots qemu-iotests: Update filter for default cluster size qemu-iotests: add qed support to 025 image resize test qemu-iotests: Update rbd support qemu-iotests: common.config: Fix no $TEST_DIR directory qemu-iotests: only run 016 for file and sheepdog protocols qemu-iotests: Use zero-based offsets for IO patterns qemu-iotests: add support for rbd and sheepdog protocols qemu-iotests: filter IMGFMT correctly in 019 qemu-iotests: README: Fix spelling qemu-iotests: add support for qed format qemu-iotests: filter TEST_DIR correctly in 019 qemu-iotests: fix 019 golden output qemu-iotests: update expected results after qemu-img changes qemu-iotests: add read/write from smaller backing image test qemu-iotests: add sub-cluster allocating write test for sparse image formats qemu-iotests: improve test for qemu-img convert with backing file qemu-iotests: consider more cases in parsing qemu-io output ...
2012-02-24Merge remote-tracking branch 'bonzini/virtio-scsi' into stagingAnthony Liguori22-113/+1132
* bonzini/virtio-scsi: scsi-block: always use scsi_generic_ops for cache != none scsi: fix searching for an empty id scsi: fix wrong return for target INQUIRY virtio-scsi: add migration support virtio-scsi: process control queue requests virtio-scsi: add basic SCSI bus operation virtio-scsi: Add basic request processing infrastructure virtio-scsi: Add virtio-scsi stub device scsi-disk: add migration support scsi-generic: add migration support scsi: add SCSIDevice vmstate definitions scsi-disk: enable scatter/gather functionality scsi: add scatter/gather functionality scsi: pass residual amount to command_complete ahci: use new DMA helpers dma-helpers: add accounting wrappers dma-helpers: add dma_buf_read and dma_buf_write dma-helpers: make QEMUSGList target independent
2012-02-24target-i386: Introduce x86_cpuid_set_model_id()Andreas Färber1-14/+19
Move the logic to transform the 48-char model ID into the 12-word model value into a helper. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24target-i386: Introduce x86_cpuid_version_set_stepping()Andreas Färber1-1/+7
Move the logic for setting the stepping field into a helper function. To make the function self-contained and to prepare for future unordered/multiple uses, mask out any previous stepping values first. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24target-i386: Introduce x86_cpuid_version_set_model()Andreas Färber1-1/+7
Move the logic for setting the model and extended model fields into a helper function. To make the function self-contained and to prepare for future unordered/multiple uses, mask out any previous model values first. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24target-i386: Introduce x86_cpuid_version_set_family()Andreas Färber1-4/+11
Move the logic for setting the family and extended family into a helper function. To make the helper self-contained and in preparation of future unordered/multiple uses, mask out any previous family values first. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24console: Eliminate text_consoles[]Markus Armbruster1-14/+4
Simply use consoles[] instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24sockets: Clean up inet_listen_opts()'s convoluted bind() loopMarkus Armbruster1-8/+6
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24sockets: Drop sockets_debug debug codeMarkus Armbruster1-41/+2
I'm trying to improve this code's error reporting, and the debug code is getting in my way: it clutters the code, it clobbers errno in inconvenient places, and it uses the same fprintf() both for error reporting and debug output in a few places. Get rid of it. Once decent error reporting is in place, adding back whatever debug code we need shouldn't be hard. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24gdbstub: Error locations for -gdbMarkus Armbruster1-6/+4
Stash away the option argument with add_device_config(), so we still have its location when we get around to parsing it. This doesn't improve any messages I can see just yet, but that'll change shortly. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24vl.c: Error locations for options using add_device_config()Markus Armbruster1-0/+4
These are -bt, -serial, -virtcon, -parallel, -debugcon, -usbdevice. Improves messages emitted via proper error reporting interfaces. For instance: $ qemu-system-x86_64 -nodefaults -S -usb -usbdevice net:vlan=xxx qemu-system-x86_64: Parameter 'vlan' expects a number becomes: qemu-system-x86_64: -usbdevice net:vlan=xxx: Parameter 'vlan' expects a number Many more remain unimproved, because they're fprintf()ed. The next few commits will take care of that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24qemu-char: qemu_chr_open_fd() can't fail, don't checkMarkus Armbruster1-4/+0
Cleaned up silently in commit aad04cd0, but that just got reverted. Re-apply this part. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24qemu-char: Re-apply style fixes from just reverted aad04cd0Markus Armbruster1-7/+14
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24qemu-char: Use qemu_open() to avoid leaking fds to childrenMarkus Armbruster1-4/+4
Fixed silently in commit aad04cd0, but that just got reverted. Re-apply the fixes, plus one missed instance: parport on Linux. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24Revert "qemu-char: Print strerror message on failure" and depsMarkus Armbruster9-122/+84
The commit's purpose is laudable: The only way for chardev drivers to communicate an error was to return a NULL pointer, which resulted in an error message that said _that_ something went wrong, but not _why_. It attempts to achieve it by changing the interface to return 0/-errno and update qemu_chr_open_opts() to use strerror() to display a more helpful error message. Unfortunately, it has serious flaws: 1. Backends "socket" and "udp" return bogus error codes, because qemu_chr_open_socket() and qemu_chr_open_udp() assume that unix_listen_opts(), unix_connect_opts(), inet_listen_opts(), inet_connect_opts() and inet_dgram_opts() fail with errno set appropriately. That assumption is wrong, and the commit turns unspecific error messages into misleading error messages. For instance: $ qemu-system-x86_64 -nodefaults -vnc :0 -chardev socket,id=bar,host=xxx inet_connect: host and/or port not specified chardev: opening backend "socket" failed: No such file or directory ENOENT is what happens to be in my errno when the backend returns -errno. Let's put ERANGE there just for giggles: $ qemu-system-x86_64 -nodefaults -vnc :0 -chardev socket,id=bar,host=xxx -drive if=none,iops=99999999999999999999 inet_connect: host and/or port not specified chardev: opening backend "socket" failed: Numerical result out of range Worse: when errno happens to be zero, return -errno erroneously signals success, and qemu_chr_new_from_opts() dies dereferencing uninitialized chr. I observe this with "-serial unix:". 2. All qemu_chr_open_opts() knows about the error is an errno error code. That's simply not enough for a decent message. For instance, when inet_dgram() can't resolve the parameter host, which errno code should it use? What if it can't resolve parameter localaddr? Clue: many backends already report errors in their open methods. Let's revert the flawed commit along with its dependencies, and fix up the silent error paths instead. This reverts commit 6e1db57b2ac9025c2443c665a0d9e78748637b26. Conflicts: console.c hw/baum.c qemu-char.c This reverts commit aad04cd024f0c59f0b96f032cde2e24eb3abba6d. The parts of commit db418a0a "Add stdio char device on windows" that depend on the reverted change fixed up. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24scsi-block: always use scsi_generic_ops for cache != nonePaolo Bonzini1-4/+14
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-24scsi: fix searching for an empty idPaolo Bonzini1-5/+10
The conditions for detecting no free target or LUN were wrong. The LUN loop was followed by an "if" condition that is never true, because the loop is exited as soon as lun becomes equal to bus->info->max_lun, and never becomes greater than it. The target loop had a wrong condition (<= instead of <). Once this is fixed, the loop would fail in the same way as the LUN loop. The fix is to see whether scsi_device_find returned the device with the last (channel, target, LUN) pair, and fail if so. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-24scsi: fix wrong return for target INQUIRYPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-24virtio-scsi: add migration supportPaolo Bonzini1-1/+49
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-24virtio-scsi: process control queue requestsPaolo Bonzini1-8/+126
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-24slirp/misc: fix gcc __warn_memset_zero_len warningsAlon Levy1-14/+7
By removing memset altogether (Patch from Stefan Hajnoczi, tested compile only by me). Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-02-24hw/9pfs: Endian fixes for virtfsBenjamin Herrenschmidt1-3/+5
This patch fixes several endian bugs in virtfs. Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-02-24./configure: add option for disabling VirtFSMeador Inge2-6/+21
Signed-off-by: Meador Inge <meadori@codesourcery.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-02-23qemu-ga: add win32 guest-shutdown commandMichael Roth1-1/+40
Implement guest-shutdown RPC for Windows. Functionally this should be equivalent to the posix implementation. Original patch by Gal Hammer <ghammer@redhat.com>
2012-02-23qemu-ga: add Windows service integrationMichael Roth4-10/+249
This allows qemu-ga to function as a Windows service: - to install the service (will auto-start on boot): qemu-ga --service install - to start the service: net start qemu-ga - to stop the service: net stop qemu-ga - to uninstall service: qemu-ga --service uninstall Original patch by Gal Hammer <ghammer@redhat.com>
2012-02-23qemu-ga: add initial win32 supportMichael Roth3-1/+345
This adds a win32 channel implementation that makes qemu-ga functional on Windows using virtio-serial (unix-listen/isa-serial not currently implemented). Unlike with the posix implementation, we do not use GIOChannel for the following reasons: - glib calls stat() on an fd to check whether S_IFCHR is set, which is the case for virtio-serial on win32. Because of that, a one-time check to determine whether the channel is readable is done by making a call to PeekConsoleInput(), which reports the underlying handle is not a valid console handle, and thus we can never read from the channel. - if one goes as far as to "trick" glib into thinking it is a normal file descripter, the buffering is done in such a way that data written to the output stream will subsequently result in that same data being read back as if it were input, causing an error loop. furthermore, a forced flush of the channel only moves the data into a secondary buffer managed by glib, so there's no way to prevent output from getting read back as input. The implementation here ties into the glib main loop by implementing a custom GSource that continually submits asynchronous/overlapped I/O to fill an GAChannel-managed read buffer, and tells glib to poll the corresponding event handle for a completion whenever there is no data/RPC in the read buffer to notify the main application about.
2012-02-23qemu-ga: fixes for win32 build of qemu-gaMichael Roth5-6/+114
Various stubs and #ifdefs to compile for Windows using mingw cross-build. Still has 1 linker error due to a dependency on the forthcoming win32 versions of the GAChannel/transport class.
2012-02-23qemu-ga: rename guest-agent-commands.c -> commands-posix.cMichael Roth2-1/+1
2012-02-23qemu-ga: separate out common commands from posix-specific onesMichael Roth4-59/+76
Many of the current RPC implementations are very much POSIX-specific and require complete re-writes for Windows. There are however a small set of core guest agent commands that are common to both, and other commands such as guest-file-* which *may* be portable. So we introduce commands.c for the latter, and will rename guest-agent-commands.c to commands-posix.c in a future commit. Windows implementations will go in commands-win32.c, eventually.
2012-02-23qemu-ga: move channel/transport functionality into wrapper classMichael Roth5-233/+355
This is mostly in preparation for the win32 port, which won't use GIO channels for reasons that will be made clearer later. Here the GAChannel class is just a loose wrapper around GIOChannel calls/callbacks, but we also roll in the logic/configuration for various channel types and managing unix socket connections, which makes the abstraction much more complete and further aids in the win32 port since isa-serial/unix-listen will not be supported initially. There's also a bit of refactoring in the main logic to consolidate the exit paths so we can do common cleanup for things like pid files, which weren't always cleaned up previously.
2012-02-23qemu-ga: Add schema documentation for typesMichael Roth1-21/+97
Document guest agent schema types in similar fashion to qmp schema types.
2012-02-23Merge qemu-iotests into for-anthonyKevin Wolf69-0/+153385
2012-02-23qemu-iotests: common.config: Allow use of arbitrary qemu* pathsLucas Meneghel Rodrigues1-3/+9
Since we might want to test arbitrary qemu, qemu-img and qemu-io paths, allow users to specify environment variable values for QEMU_PROG, QEMU_IMG_PROG and QEMU_IO_PROG so the testsuite will use those values rather than find them on PATH. Obviously, if such env variables are not set prior to script execution, normal detection mechanism takes place. Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: check: print relevant path informationLucas Meneghel Rodrigues1-0/+3
Print the paths of the programs under test (qemu, qemu-img and qemu-io). Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: test loading internal snapshotsKevin Wolf3-0/+76
Test loading internal snapshots where the L1 table of the snapshot is smaller than the current L1 table. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: Update filter for default cluster sizeKevin Wolf2-2/+5
Until recently, qemu-img create displayed cluster_size=0 for the default cluster size. It is changed to display the real cluster size now, which results in the cluster size not being filtered out any more. If the cluster size is specified explicitly in CLUSTER_SIZE, keep the output, and if using the default, filter it out. This mostly restores the old behaviour of the test cases; test 015 must be fixed to use CLUSTER_SIZE instead of using extra_img_options for it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: add qed support to 025 image resize testStefan Hajnoczi1-1/+1
QED now supports the truncate (aka resize) operation for growing images. Update test 025 so it runs for QED. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: Update rbd supportJosh Durgin1-1/+1
rbd implements bdrv_truncate, so test 025 will work. Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: common.config: Fix no $TEST_DIR directoryMitnick Lyu1-1/+5
mkdir $TEST_DIR on common.config first run Signed-off-by: Mitnick Lyu <mitnick.lyu@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: only run 016 for file and sheepdog protocolsChristoph Hellwig1-2/+1
016 writes past EOF which isn't support by most protocols, so limit it to file and sheepdog, which explicitly support it. Pointed out by Josh Durgin <josh.durgin@dreamhost.com>. Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: Use zero-based offsets for IO patternsStefan Hajnoczi12-1863/+1873
The io_pattern style functions have the following loop: for i in `seq 1 $count`; do echo ... $(( start + i * step )) ... done Offsets are 1-based so start=1024, step=512, count=4 yields: 1536, 2048, 2560, 3072 Normally we expect: 1024, 1536, 2048, 2560 Most tests ignore this detail, which means that they perform I/O to a slightly different range than expected by the test author. Later on things got less innocent and tests started trying to compensate for the 1-based indexing. This included negative start values in test 024 and my own attempt with count-1 in test 028! The end result is that tests that use io_pattern are hard to reason about and don't work the way you'd expect. It's time to clean this mess up. This patch switches io_pattern to 0-based offsets. This requires adjusting the golden outputs since I/O ranges are now shifted and output differs. Verifying these output diffs is easy, however. Each diff hunk moves one I/O from beyond the end of the pattern range to the beginning. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: add support for rbd and sheepdog protocolsMORITA Kazutaka31-4/+89
This patch introduces tests for protocols other than file, and initially supports rbd and sheepdog. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: filter IMGFMT correctly in 019Stefan Hajnoczi3-4/+10
Test 019 can be run with qcow2 and qed image formats. Replace the specific image format value with "IMGFMT" so the golden output does not hardcode qcow2 or qed. This patch also includes a typo fix for "occurrences". Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: README: Fix spellingStefan Weil1-1/+1
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: add support for qed formatStefan Hajnoczi9-9/+16
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-02-23qemu-iotests: filter TEST_DIR correctly in 019Christoph Hellwig2-3/+3
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-23vl.c: Increase width of machine name column in "-M ?" outputPeter Maydell1-2/+2
Increase the width of the column used for the machine name in the "-M ?" output from 10 to 20 spaces. This fixes the formatting so it looks nice for architectures where a few of the machines have overly long names. (Our current longest machine name is "petalogix-s3adsp1800" with "realview-eb-mpcore" not far behind.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-02-23tcg: Remove unneeded include statementsStefan Weil1-12/+0
The standard include files are already included in qemu-common.h. malloc.h and alloca.h were needed for alloca() which was removed from TCG code some years ago when switching from dyngen to TCG (see commit 49516bc0d622112caac9df628caf19010fda8b67). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-02-22qom: In function object_set_link_property(), first call object_ref(), then ↵Alexander Barabash1-4/+7
object_unref(). In the old implementation, if the new value of the property links to the same object, as the old value, that object is first unref-ed, and then ref-ed. This leads to unintended deinitialization of that object. In the new implementation, this is fixed. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Barabash <alexander_barabash@mentor.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>