summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-07-01Update version for v2.1.0-rc0 releasev2.1.0-rc0Peter Maydell1-1/+1
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-07-01net: add mmsghdr struct check for L2TPV3Gonglei3-3/+19
The mmsghdr struct is only introduced in Linux 2.6.32; add a configure check for it and disable L2TPV3 on hosts which are too old to provide it, rather than simply failing to compile. Reported-by: chenliang <chenliang88@huawei.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1404219488-11196-1-git-send-email-arei.gonglei@huawei.com [PMM: cleaned up commit message and corrected kernel version number] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-07-01Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20140701-1' into ↵Peter Maydell4-31/+30
staging usb bugfixes. # gpg: Signature made Tue 01 Jul 2014 14:51:19 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-usb-20140701-1: ccid-card-emulated: use EventNotifier usb: initialize libusb_device to avoid crash usb: Fix usb-bt-dongle initialization. input: fix jumpy mouse cursor with USB mouse emulation Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-07-01Merge remote-tracking branch 'remotes/kraxel/tags/pull-vnc-20140701-1' into ↵Peter Maydell2-89/+87
staging vnc: two bugfixes (by Peter Lieven). # gpg: Signature made Tue 01 Jul 2014 12:32:19 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-vnc-20140701-1: ui/vnc: fix potential memory corruption issues ui/vnc: limit client_cut_text msg payload size Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-07-01ccid-card-emulated: use EventNotifierPaolo Bonzini1-19/+10
Shut up Coverity's complaint about unchecked fcntl return values, and especially make the code simpler and more efficient. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-07-01Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' ↵Peter Maydell2-0/+4
into staging Tracing pull request # gpg: Signature made Tue 01 Jul 2014 09:56:27 BST using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/tracing-pull-request: trace: add qemu_system_powerdown_request and qemu_system_shutdown_request trace events Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-07-01Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell35-242/+569
staging Block pull request # gpg: Signature made Tue 01 Jul 2014 09:47:15 BST using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" * remotes/stefanha/tags/block-pull-request: (23 commits) block: add backing-file option to block-stream block: extend block-commit to accept a string for the backing file block: add helper function to determine if a BDS is in a chain block: add QAPI command to allow live backing file change qapi: Change back sector-count to sectors-count in quorum QAPI events. block/cow: Avoid use of uninitialized cow_bs in error path block: simplify bdrv_find_base() and bdrv_find_overlay() block: make 'top' argument to block-commit optional iotests: Add more tests to quick group iotests: Add qemu tests to quick group iotests: Simplify qemu-iotests-quick.sh qemu-img create: add 'nocow' option virtio-blk: remove need for explicit x-data-plane=on option qdev: drop iothread property type virtio-blk: replace x-iothread with iothread link property virtio-blk: move qdev properties into virtio-blk.c virtio: fix virtio-blk child refcount in transports virtio-blk: drop virtio_blk_set_conf() virtio-blk: use aliases instead of duplicate qdev properties qdev: add qdev_alias_all_properties() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-07-01ui/vnc: fix potential memory corruption issuesPeter Lieven2-86/+77
this patch makes the VNC server work correctly if the server surface and the guest surface have different sizes. Basically the server surface is adjusted to not exceed VNC_MAX_WIDTH x VNC_MAX_HEIGHT and additionally the width is rounded up to multiple of VNC_DIRTY_PIXELS_PER_BIT. If we have a resolution whose width is not dividable by VNC_DIRTY_PIXELS_PER_BIT we now get a small black bar on the right of the screen. If the surface is too big to fit the limits only the upper left area is shown. On top of that this fixes 2 memory corruption issues: The first was actually discovered during playing around with a Windows 7 vServer. During resolution change in Windows 7 it happens sometimes that Windows changes to an intermediate resolution where server_stride % cmp_bytes != 0 (in vnc_refresh_server_surface). This happens only if width % VNC_DIRTY_PIXELS_PER_BIT != 0. The second is a theoretical issue, but is maybe exploitable by the guest. If for some reason the guest surface size is bigger than VNC_MAX_WIDTH x VNC_MAX_HEIGHT we end up in severe corruption since this limit is nowhere enforced. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-07-01ui/vnc: limit client_cut_text msg payload sizePeter Lieven1-3/+10
currently a malicious client could define a payload size of 2^32 - 1 bytes and send up to that size of data to the vnc server. The server would allocated that amount of memory which could easily create an out of memory condition. This patch limits the payload size to 1MB max. Please note that client_cut_text messages are currently silently ignored. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-07-01usb: initialize libusb_device to avoid crashJincheng Miao1-2/+2
If libusb_get_device_list() fails, the uninitialized local variable libusb_device would be passed to libusb_free_device_list(), that will cause a crash, like: (gdb) bt #0 0x00007fbbb4bafc10 in pthread_mutex_lock () from /lib64/libpthread.so.0 #1 0x00007fbbb233e653 in libusb_unref_device (dev=0x6275682d627375) at core.c:902 #2 0x00007fbbb233e739 in libusb_free_device_list (list=0x7fbbb6e8436e, unref_devices=<optimized out>) at core.c:653 #3 0x00007fbbb6cd80a4 in usb_host_auto_check (unused=unused@entry=0x0) at hw/usb/host-libusb.c:1446 #4 0x00007fbbb6cd8525 in usb_host_initfn (udev=0x7fbbbd3c5670) at hw/usb/host-libusb.c:912 #5 0x00007fbbb6cc123b in usb_device_init (dev=0x7fbbbd3c5670) at hw/usb/bus.c:106 ... So initialize libusb_device at the begin time. Signed-off-by: Jincheng Miao <jmiao@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-07-01usb: Fix usb-bt-dongle initialization.Hani Benhabiles1-8/+16
Due to an incomplete initialization, adding a usb-bt-dongle device through HMP or QMP will cause a segmentation fault. Signed-off-by: Hani Benhabiles <hani@linux.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-07-01input: fix jumpy mouse cursor with USB mouse emulationChristian Burger1-2/+2
Guest mouse pointer was jumpy, when moving host mouse in the vertical direction (see bug #1327800). Signed-off-by: Christian Burger <christian@krikkel.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-07-01Merge remote-tracking branch 'remotes/bonzini/memory' into stagingPeter Maydell13-89/+441
* remotes/bonzini/memory: qdev: correctly send DEVICE_DELETED for recursively-deleted devices memory: do not give a name to the internal exec.c regions memory: MemoryRegion: Add size property memory: MemoryRegion: Add may-overlap and priority props memory: MemoryRegion: Add container and addr props memory: MemoryRegion: replace owner field with QOM parent memory: MemoryRegion: QOMify memory: MemoryRegion: use /machine as default owner libqtest: escape strings in QMP commands, fix leak qom: object: Ignore refs/unrefs of NULL qom: object: remove parent pointer when unparenting mc146818rtc: add "rtc-time" link to "/machine/rtc" qom: allow creating an alias of a child<> property qom: add a generic mechanism to resolve paths qom: add object_property_add_alias() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-07-01Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-2.1' ↵Peter Maydell19-50/+64
into staging QOM and device refactorings * QOM unparenting cleanup * IRQ conversion to QOM # gpg: Signature made Tue 01 Jul 2014 04:03:23 BST using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-2.1: irq: Slim conversion of qemu_irq to QOM irq: Allocate IRQs individually hw: Fix qemu_allocate_irqs() leaks sdhci: Fix misuse of qemu_free_irqs() qom: Remove parent pointer when unparenting Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-07-01Merge remote-tracking branch 'remotes/bonzini/scsi-next' into stagingPeter Maydell3-14/+4
* remotes/bonzini/scsi-next: configure: Fix -lm test, so that tools can be compiled on hosts that require -lm virtio-scsi: scsi events must be converted to target endianness virtio-scsi: virtio_scsi_push_event() lacks VirtIOSCSIReq parsing Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-07-01trace: add qemu_system_powerdown_request and qemu_system_shutdown_request ↵Yang Zhiyong2-0/+4
trace events We have the experience that the guest doesn't stop successfully though it was instructed to shut down. The root cause may be not in QEMU mostly. However, QEMU is often suspected at the beginning just because the issue occurred in virtualization environment. Therefore, we need to affirm that QEMU received the shutdown request and raised ACPI irq from "virsh shutdown" command, virt-manger or stopping QEMU process to the VM . So that we can affirm the problems was belonged to the Guset OS rather than the QEMU itself. When we stop guests by "virsh shutdown" command or virt-manger, or stopping QEMU process, qemu_system_powerdown_request() or qemu_system_shutdown_request() is called. Then the below functions in main_loop_should_exit() of Vl.c are called roughly in the following order. if (qemu_powerdown_requested()) qemu_system_powerdown() monitor_protocol_event(QEVENT_POWERDOWN, NULL) OR if(qemu_shutdown_requested()} monitor_protocol_event(QEVENT_SHUTDOWN, NULL); The tracepoint of monitor_protocol_event() already exists, but no tracepoints are defined for qemu_system_powerdown_request() and qemu_system_shutdown_request(). So this patch adds two tracepoints for the two functions. We believe that it will become much easier to isolate the problem mentioned above by these tracepoints. Signed-off-by: Yang Zhiyong <yangzy.fnst@cn.fujitsu.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01block: add backing-file option to block-streamJeff Cody5-14/+43
On some image chains, QEMU may not always be able to resolve the filenames properly, when updating the backing file of an image after a block job. For instance, certain relative pathnames may fail, or drives may have been specified originally by file descriptor (e.g. /dev/fd/???), or a relative protocol pathname may have been used. In these instances, QEMU may lack the information to be able to make the correct choice, but the user or management layer most likely does have that knowledge. With this extension to the block-stream api, the user is able to change the backing file of the active layer as part of the block-stream operation. This allows the change to be 'safe', in the sense that if the attempt to write the active image metadata fails, then the block-stream operation returns failure, without disrupting the guest. If a backing file string is not specified in the command, the backing file string to use is determined in the same manner as it was previously. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01block: extend block-commit to accept a string for the backing fileJeff Cody7-11/+59
On some image chains, QEMU may not always be able to resolve the filenames properly, when updating the backing file of an image after a block commit. For instance, certain relative pathnames may fail, or drives may have been specified originally by file descriptor (e.g. /dev/fd/???), or a relative protocol pathname may have been used. In these instances, QEMU may lack the information to be able to make the correct choice, but the user or management layer most likely does have that knowledge. With this extension to the block-commit api, the user is able to change the backing file of the overlay image as part of the block-commit operation. This allows the change to be 'safe', in the sense that if the attempt to write the overlay image metadata fails, then the block-commit operation returns failure, without disrupting the guest. If the commit top is the active layer, then specifying the backing file string will be treated as an error (there is no overlay image to modify in that case). If a backing file string is not specified in the command, the backing file string to use is determined in the same manner as it was previously. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01block: add helper function to determine if a BDS is in a chainJeff Cody2-0/+12
This is a small helper function, to determine if 'base' is in the chain of BlockDriverState 'top'. It returns true if it is in the chain, and false otherwise. If either argument is NULL, it will also return false. Reviewed-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01block: add QAPI command to allow live backing file changeJeff Cody3-0/+144
This allows a user to make a live change to the backing file recorded in an open image. The image file to modify can be specified 2 ways: 1) image filename 2) image node-name Note: this does not cause the backing file itself to be reopened; it merely changes the backing filename in the image file structure, and in internal BDS structures. It is the responsibility of the user to pass a filename string that can be resolved when the image chain is reopened, and the filename string is not validated. A good analogy for this command is that it is a live version of 'qemu-img rebase -u', with respect to changing the backing file string. [Jeff is offline so I respun this patch in his absence. Dropped image filename since using node-name is preferred and this is a new command. No need to introduce the limitations of finding images by filename. --Stefan] Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01configure: Fix -lm test, so that tools can be compiled on hosts that require -lmAlexey Kardashevskiy2-5/+1
The existing test whether "-lm" needs to be included or not is insufficient as it reports false negative on Fedora20/ppc64. This happens because sin(0.0) is a constant value which compiler can safely throw away and therefore there is no need to add "-lm". As the result, qemu-nbd/qemu-io/qemu-img tools cannot compile. This adds a global variable and uses it in the test to prevent from optimization. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> [Use Peter's improvement on the test to fool LTO, and remove the now useless -lm addition in Makefile.target. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01qdev: correctly send DEVICE_DELETED for recursively-deleted devicesPaolo Bonzini2-2/+4
When a device is unparented (i.e. made completely hidden from management) we want to send a DEVICE_DELETED event only if the device actually was realized. This avoids raising DEVICE_DELETED events when device_add fails. However, this does not work right for recursively-deleted devices: the whole tree is _first_ unrealized, _then_ unparented. Then device_unparent sees realized==false and fails to trigger the event. The solution is simply to move have_realized into the DeviceState struct. If device_add fails, we never set the new field to true and DEVICE_DELETED is not sent. Fixes qemu-iotests testcase 067 (broken by commit 5942a19, though that commit in turn fixed a possible segfault in the same test). Reported-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01memory: do not give a name to the internal exec.c regionsPaolo Bonzini1-4/+4
There is no need to have them visible under /machine. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01memory: MemoryRegion: Add size propertyPeter Crosthwaite1-0/+13
To allow devices to dynamically resize the device. The motivation is to allow devices with variable size to init their memory_region without size early and then correctly populate size at realize() time. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01memory: MemoryRegion: Add may-overlap and priority propsPeter Crosthwaite2-1/+25
QOM propertyify the .may-overlap and .priority fields. The setters will re-add the memory as a subregion if needed (i.e. the values change when the memory region is already contained). Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [Remove setters. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01memory: MemoryRegion: Add container and addr propsPeter Crosthwaite1-0/+46
Expose the already existing .parent and .addr fields as QOM properties. .parent (i.e. the field describing the memory region that contains this one in Memory hierachy) is renamed "container". This is to avoid confusion with the QOM parent. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [Remove setters. Do not unref parent on releasing the property. Clean up error propagation. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01memory: MemoryRegion: replace owner field with QOM parentPaolo Bonzini2-11/+25
The two are now the same. Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01memory: MemoryRegion: QOMifyPeter Crosthwaite3-22/+109
QOMify memory regions as an Object. The former init() and destroy() routines become instance_init() and instance_finalize() resp. memory_region_init() is re-implemented to be: object_initialize() + set fields memory_region_destroy() is re-implemented to call unparent(). Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [Add newly-created MR as child, unparent on destruction. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01memory: MemoryRegion: use /machine as default ownerPaolo Bonzini2-3/+2
This will be added (after QOMification) as the QOM parent. Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01libqtest: escape strings in QMP commands, fix leakPaolo Bonzini4-16/+43
libqtest is using g_strdup_printf to format QMP commands, but this does not work if the argument strings need to be escaped. Instead, use the fancy %-formatting functionality of QObject. The only change required in tests is that strings have to be formatted as %s, not '%s' or \"%s\". Luckily this usage of parameterized QMP commands is not that frequent. The leak is in socket_sendf. Since we are extracting the send loop to a new function, fix it now. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01qom: object: Ignore refs/unrefs of NULLPeter Crosthwaite1-6/+8
Just do nothing if passed NULL for a ref or unref. This avoids call sites that manage a combination of NULL or non-NULL pointers having to add iffery around every ref and unref. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01qom: object: remove parent pointer when unparentingPeter Crosthwaite1-0/+1
Certain parts of the QOM framework test this pointer to determine if an object is parented. Nuke it when the object is unparented to allow for reuse of an object after unparenting. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01mc146818rtc: add "rtc-time" link to "/machine/rtc"Marcelo Tosatti1-0/+9
Add a link to rtc under /machine providing a stable location for management apps to query the value of the time. The link should be added by any object that sends RTC_TIME_CHANGE events. {"execute":"qom-get","arguments":{"path":"/machine","property":"rtc-time"} } Suggested by Paolo Bonzini and Andreas Faerber. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01qom: allow creating an alias of a child<> propertyPaolo Bonzini1-1/+11
Child properties must be unique. Fix this problem by turning their aliases into links. The resolve function that forwards to the target property does not have any knowledge of the target property's type, so it works fine. Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01qom: add a generic mechanism to resolve pathsPaolo Bonzini2-34/+82
It may be desirable to have custom link<> properties that do more than just store an object. Even the addition of a "check" function is not enough if setting the link has side effects or if a non-standard reference counting is preferrable. Avoid the assumption that the opaque field of a link<> is a LinkProperty struct, by adding a generic "resolve" callback to ObjectProperty. This fixes aliases of link properties. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01qapi: Change back sector-count to sectors-count in quorum QAPI events.Benoît Canet2-17/+17
fe069d9d had aligned code and documentation while dropping the s from the actual JSON output. Fix that. This also fix test/qemu-iotest/081 since the missing s was causing a permutation. Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01block/cow: Avoid use of uninitialized cow_bs in error pathPeter Maydell1-3/+4
Commit 25814e8987 introduced an error-exit code path which does a "goto exit" before the cow_bs variable is initialized, meaning we would call bdrv_unref() on an uninitialized variable and likely segfault. Fix this by moving the NULL-initialization to the top of the function and making the exit code path handle the case where it is NULL. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01block: simplify bdrv_find_base() and bdrv_find_overlay()Jeff Cody1-35/+10
This simplifies the function bdrv_find_overlay(). With this change, bdrv_find_base() is just a subset of usage of bdrv_find_overlay(), so this also takes advantage of that. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01block: make 'top' argument to block-commit optionalJeff Cody4-17/+39
Now that active layer block-commit is supported, the 'top' argument no longer needs to be mandatory. Change it to optional, with the default being the active layer in the device chain. [kwolf: Rebased and resolved conflict in tests/qemu-iotests/040] Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01iotests: Add more tests to quick groupMax Reitz1-19/+19
While at it, add some more tests to the quick group (those that run with -nocache in under three seconds on my HDD). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01iotests: Add qemu tests to quick groupMax Reitz1-9/+9
Now that qemu-iotests-quick.sh supports tests using the qemu binary, we are free to add such tests to the quick group. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01iotests: Simplify qemu-iotests-quick.shMax Reitz1-11/+1
As of the "iotests: Allow out-of-tree run" series, the qemu-iotests may (and should) be run directly in the build tree and will then guess the binary paths themselves. Therefore, qemu-iotests-quick.sh does not need to (and should not) enter the source path anymore; also, it does not need to specify the binaries because "check" will guess them automatically. As a side-effect, tests using qemu may now be added to the quick group. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01qemu-img create: add 'nocow' optionChunyan Liu9-6/+146
Add 'nocow' option so that users could have a chance to set NOCOW flag to newly created files. It's useful on btrfs file system to enhance performance. Btrfs has low performance when hosting VM images, even more when the guest in those VM are also using btrfs as file system. One way to mitigate this bad performance is to turn off COW attributes on VM files. Generally, there are two ways to turn off NOCOW on btrfs: a) by mounting fs with nodatacow, then all newly created files will be NOCOW. b) per file. Add the NOCOW file attribute. It could only be done to empty or new files. This patch tries the second way, according to the option, it could add NOCOW per file. For most block drivers, since the create file step is in raw-posix.c, so we can do setting NOCOW flag ioctl in raw-posix.c only. But there are some exceptions, like block/vpc.c and block/vdi.c, they are creating file by calling qemu_open directly. For them, do the same setting NOCOW flag ioctl work in them separately. [Fixed up 082.out due to the new 'nocow' creation option --Stefan] Signed-off-by: Chunyan Liu <cyliu@suse.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01virtio-scsi: scsi events must be converted to target endiannessCédric Le Goater1-2/+2
Virtio SCSI Events need to be byteswapped before being pushed when host and guest have a different endianness. Not doing so breaks hotplug of virtio scsi disks, with the following error message being printed in the guest console: virtio_scsi: Unsupport virtio scsi event 1000000 This issue got uncovered while testing disk hotplug with a PowerKVM ppc64le guest. I have checked that this issue also affects a x86_64 guest run on a ppc64 host. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> [ Ported from PowerKVM, Greg Kurz <gkurz@linux.vnet.ibm.com> ] Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01virtio-scsi: virtio_scsi_push_event() lacks VirtIOSCSIReq parsingGreg Kurz1-7/+1
Hotplug of a virtio scsi disk is currently broken: no disk appears in the guest (verified with a fedora 20 host running a fedora 20 guest with KVM). Bisect leeds to Paolo's patches to support any_layout, especially this commit: commit 36b15c79aa1bef5fe7543f9f2629b6413720bbfb Author: Paolo Bonzini <pbonzini@redhat.com> Date: Tue Jun 10 16:21:18 2014 +0200 virtio-scsi: start preparing for any_layout It modifies virtio_scsi_pop_req() so that it is up to the callers to parse the virtio scsi request. It seems that virtio_scsi_push_event() was not modified accordingly... This patch adds a call to virtio_scsi_parse_req(). It also drops some sanity checks that are already performed by virtio_scsi_parse_req(). Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-01qom: add object_property_add_alias()Stefan Hajnoczi2-0/+71
Sometimes an object needs to present a property which is actually on another object, or it needs to provide an alias name for an existing property. Examples: a.foo -> b.foo a.old_name -> a.new_name The new object_property_add_alias() API allows objects to alias a property on the same object or another object. The source and target names can be different. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
2014-07-01virtio-blk: remove need for explicit x-data-plane=on optionStefan Hajnoczi1-1/+1
The x-data-plane=on|off option is no longer useful because the iothread=<iothread> option conveys the same information plus which IOThread to use. Do not delete x-data-plane=on|off yet as a convenience to people using this legacy experimental option. We will drop it in QEMU 2.2. Instead, turn on data-plane when either x-data-plane=on or iothread=<iothread> are used. The following command-line uses data-plane: qemu -device virtio-blk-pci,iothread=foo,drive=drive0 Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01qdev: drop iothread property typeStefan Hajnoczi2-53/+0
The iothread property type is no longer used and can be removed. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01virtio-blk: replace x-iothread with iothread link propertyStefan Hajnoczi4-1/+17
Up until now -device virtio-blk-pci,x-iothread=<id> was used to assign an IOThread. This was a temporary solution while we cleaned up QOM link properties. This patch switches over to a QOM link property since it is now possible to restrict the setter to unrealized instances and automatically unref the IOThread when the virtio-blk-pci device is freed. Since the "iothread" property is a QOM property and not a qdev property, we must alias it explicitly for virtio-blk-pci, as well as CCW and s390-virtio. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-07-01virtio-blk: move qdev properties into virtio-blk.cStefan Hajnoczi2-24/+11
There is no need to make DEFINE_VIRTIO_BLK_PROPERTIES() public. Inline it into virtio-blk.c so it cannot be used by mistake from other source files. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>