sort by:
Revision Author Date Message Commit Date
69d4900 Update version for v2.7.0-rc1 release Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 29 July 2016, 14:55:59 UTC
71fcd8e avx2 configure: Disable if static build This avoids a segfault like the following for at least some 4.8 versions of gcc when configured with --static if avx2 instructions are also enabled: Program received signal SIGSEGV, Segmentation fault. buffer_find_nonzero_offset_ifunc () at ./util/cutils.c:333 333 { (gdb) bt #0 buffer_find_nonzero_offset_ifunc () at ./util/cutils.c:333 #1 0x0000000000939c58 in __libc_start_main () #2 0x0000000000419337 in _start () Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 29 July 2016, 14:21:43 UTC
cf4b61d Unbreak FreeBSD build after optionrom update. Update the build flags appropriately for FreeBSD and add the correct LD_EMULATION type for the FreeBSD build case. Fixes FreeBSD build error: ld: unrecognised emulation mode: elf_i386 Supported emulations: elf_x86_64_fbsd elf_i386_fbsd gmake[1]: *** [Makefile:51: linuxboot_dma.img] Error 1 gmake: *** [Makefile:229: romsubdir-optionrom] Error 2 Signed-off-by: Sean Bruno <sbruno@freebsd.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 29 July 2016, 13:25:35 UTC
036999e optionrom: fix detection of -Wa,-32 The cc-option macro runs $(CC) in -S mode (generate assembly) to avoid a pointless run of the assembler. However, this does not work when you want to detect support for cc->as option passthrough. clang ignores -Wa unless -c is provided, and exits successfully even if the -Wa,-32 option is not supported. Reported-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1469043409-14033-1-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 29 July 2016, 12:56:52 UTC
c7e9aaf Merge remote-tracking branch 'remotes/lalrae/tags/mips-20160729' into staging MIPS patches 2016-07-29 Changes: * bug fixes # gpg: Signature made Fri 29 Jul 2016 09:44:13 BST # gpg: using RSA key 0x52118E3C0B29DA6B # gpg: Good signature from "Leon Alrae <leon.alrae@imgtec.com>" # Primary key fingerprint: 8DD3 2F98 5495 9D66 35D4 4FC0 5211 8E3C 0B29 DA6B * remotes/lalrae/tags/mips-20160729: target-mips: fix EntryHi.EHINV being cleared on TLB exception hw/mips_malta: Fix YAMON API print routine Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 29 July 2016, 12:05:55 UTC
df2c359 Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160729' into staging ppc patch queue 2016-07-29 Here are the current pending ppc and spapr related patches for qemu-2.7. Given the freeze status, these are all bugfixes, with two exceptions: * There's some final rework of the vcpu hotplug model. Specifically we add spapr specific code on the generic basis Igor established to make cpu_index stable for pseries-2.7 and later machine types. - This allows us to remove the limitation that cpu cores had to be inserted in linear order, and removed in LIFO order. - This is worth merging this late in 2.7 because it will avoid considerable future grief with management layers needing to discover whether out-of-order hotplug is possible, amongst other things. - For now we do add a constraint that the initial cpu cannot be unplugged. * We add two extra testcases to make check, for postcopy and drive_del on ppc64. - Not strictly bugfixes, but safe, because they don't affect the actual code, and increase test coverage. # gpg: Signature made Fri 29 Jul 2016 05:50:02 BST # gpg: using RSA key 0x6C38CACA20D9B392 # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" # gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>" # gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392 * remotes/dgibson/tags/ppc-for-2.7-20160729: tests: add drive_del-test to ppc/ppc64 spapr: Prevent boot CPU core removal ppc: Fix fault PC reporting for lve*/stve* VMX instructions test: port postcopy test to ppc64 Revert "spapr: Ensure CPU cores are added contiguously and removed in LIFO order" spapr: init CPUState->cpu_index with index relative to core-id Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 29 July 2016, 11:37:08 UTC
cbe81c6 Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging pc, pci, virtio: cleanups, fixes a bunch of bugfixes and a couple of cleanups making these easier and/or making debugging easier Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Fri 29 Jul 2016 04:11:01 BST # gpg: using RSA key 0x281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: (41 commits) mptsas: Fix a migration compatible issue vhost: do not update last avail idx on get_vring_base() failure vhost: add vhost_net_set_backend() vhost-user: add error report in vhost_user_write() tests: fix vhost-user-test leak tests: plug some leaks in virtio-net-test vhost-user: wait until backend init is completed char: add and use tcp_chr_wait_connected char: add chr_wait_connected callback vhost: add assert() to check runtime behaviour vhost-net: vhost_migration_done is vhost-user specific Revert "vhost-net: do not crash if backend is not present" vhost-user: add get_vhost_net() assertions vhost-user: keep vhost_net after a disconnection vhost-user: check vhost_user_{read,write}() return value vhost-user: check qemu_chr_fe_set_msgfds() return value vhost-user: call set_msgfds unconditionally qemu-char: fix qemu_chr_fe_set_msgfds() crash when disconnected vhost: use error_report() instead of fprintf(stderr,...) vhost: add missing VHOST_OPS_DEBUG ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 29 July 2016, 10:57:01 UTC
aa2aac5 Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging # gpg: Signature made Thu 28 Jul 2016 23:50:37 BST # gpg: using RSA key 0x7DEF8106AAFC390E # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" # Primary key fingerprint: FAEB 9711 A12C F475 812F 18F2 88A9 064D 1835 61EB # Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76 CBD0 7DEF 8106 AAFC 390E * remotes/jnsnow/tags/ide-pull-request: ide: fix halted IO segfault at reset Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 29 July 2016, 10:01:38 UTC
059ce0f tests: add drive_del-test to ppc/ppc64 Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 29 July 2016, 04:14:15 UTC
f077f88 mptsas: Fix a migration compatible issue My previous commit 2e2aa316 removed internal flag msi_in_use, which exists in vmstate, use VMSTATE_UNUSED for migration compatibility. Reported-by: Amit Shah <amit.shah@redhat.com> Suggested-by: Amit Shah <amit.shah@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Amit Shah <amit.shah@redhat.com> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> 29 July 2016, 03:09:55 UTC
499c557 vhost: do not update last avail idx on get_vring_base() failure The state.num value will probably be 0 in this case, but that doesn't make sense to update. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 29 July 2016, 02:47:17 UTC
62be8b0 spapr: Prevent boot CPU core removal Boot CPU is assumed to be always present in QEMU code. So until that assumptions are gone, deny removal request. In another words, QEMU won't support boot CPU core hot-unplug. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> [dwg: Tweaked error message for clarity] Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 29 July 2016, 02:02:31 UTC
bcd510b ppc: Fix fault PC reporting for lve*/stve* VMX instructions We forgot to do gen_update_nip() for these like we do with other helpers. Fix this, but in a more efficient way by passing the RA to the accessors instead so the overhead is only taken on faults. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 29 July 2016, 02:02:31 UTC
aaf89c8 test: port postcopy test to ppc64 As userfaultfd syscall is available on powerpc, migration postcopy can be used. This patch adds the support needed to test this on powerpc, instead of using a bootsector to run code to modify memory, we use a FORTH script in "boot-command" property. As spapr machine doesn't support "-prom-env" argument (the nvram is initialized by SLOF and not by QEMU), "boot-command" is provided to SLOF via a file mapped nvram (with "-drive file=...,if=pflash") Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 29 July 2016, 02:02:31 UTC
7cdd761 Revert "spapr: Ensure CPU cores are added contiguously and removed in LIFO order" This reverts commit 5cbc64de25973e9129c5a7897734a06ac64b9aff. Now that we have stable cpu_index values for pseries-2.7 (and future) machine types, we can now safely allow hotplug and unplug in any order. Conflicts: hw/ppc/spapr_cpu_core.c Some conflicts on revert due to some small changes in the inserted code since the original commit. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 29 July 2016, 02:02:31 UTC
b63578b spapr: init CPUState->cpu_index with index relative to core-id It will enshure that cpu_index for a given cpu stays the same regardless of the order cpus has been created/deleted and so it would be possible to migrate QEMU instance with out of order created CPU. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 29 July 2016, 02:02:31 UTC
87ac25f ide: fix halted IO segfault at reset If one attempts to perform a system_reset after a failed IO request that causes the VM to enter a paused state, QEMU will segfault trying to free up the pending IO requests. These requests have already been completed and freed, though, so all we need to do is NULL them before we enter the paused state. Existing AHCI tests verify that halted requests are still resumed successfully after a STOP event. Analyzed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1469635201-11918-2-git-send-email-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com> 28 July 2016, 21:34:19 UTC
950d94b vhost: add vhost_net_set_backend() Not all vhost-user backends support ops->vhost_net_set_backend(). It is a nicer to provide an assert/error than to crash trying to call. Furthermore, it improves a bit the code by hiding vhost_ops details. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:49 UTC
f6b8571 vhost-user: add error report in vhost_user_write() Similar to vhost_user_read() error report, it is useful to have early error report. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:49 UTC
69179fe tests: fix vhost-user-test leak Spotted by valgrind. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:49 UTC
1ec3b71 tests: plug some leaks in virtio-net-test Found thanks to valgrind. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:49 UTC
c89804d vhost-user: wait until backend init is completed The chardev waits for an initial connection before starting qemu, and vhost-user should wait for the backend negotiation to be completed before starting qemu too. vhost-user is started in the net_vhost_user_event callback, which is synchronously called after the socket is connected. Use a VhostUserState.started flag to indicate vhost-user init completed successfully and qemu can be started. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:49 UTC
d7a04fd char: add and use tcp_chr_wait_connected Add a chr_wait_connected for the tcp backend, and use it in the open_socket() function. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:48 UTC
6b6723c char: add chr_wait_connected callback A function to wait on the backend to be connected, to be used in the following patches. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:48 UTC
8695de0 vhost: add assert() to check runtime behaviour All these functions must be called only after the backend is connected. They are called from virtio-net.c, after either virtio or link status change. The check for nc->peer->link_down should ensure vhost_net_{start,stop}() are always called between vhost_user_{start,stop}(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:48 UTC
51f7aca vhost-net: vhost_migration_done is vhost-user specific Either the callback is mandatory to implement, in which case an assert() is more appropriate, or it's not and we can't tell much whether the function should fail or not (given it's name, I guess it should silently success by default). Instead, make the implementation mandatory and vhost-user specific to be more clear about its usage. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:48 UTC
bb12e76 Revert "vhost-net: do not crash if backend is not present" Now that get_vhost_net() returns non-null after a successful vhost_net_init(), we no longer need to check this case. This reverts commit ecd34898596c60f79886061618dd7e01001113ad. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:48 UTC
1a5b68c vhost-user: add get_vhost_net() assertions Add a few assertions to be more explicit about the runtime behaviour after the previous patch: get_vhost_net() is non-null after net_vhost_user_init(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:48 UTC
e6bcb1b vhost-user: keep vhost_net after a disconnection Many code paths assume get_vhost_net() returns non-null. Keep VhostUserState.vhost_net after a successful vhost_net_init(), instead of freeing it in vhost_net_cleanup(). VhostUserState.vhost_net is thus freed before after being recreated or on final vhost_user_cleanup() and there is no need to save the acked features. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:48 UTC
c4843a4 vhost-user: check vhost_user_{read,write}() return value The vhost-user code is quite inconsistent with error handling. Instead of ignoring some return values of read/write and silently going on with invalid state (invalid read for example), break the code flow when the error happened. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:48 UTC
6fab2f3 vhost-user: check qemu_chr_fe_set_msgfds() return value Check qemu_chr_fe_set_msgfds() for errors, to make sure the message to be sent is correct. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:48 UTC
df3485a vhost-user: call set_msgfds unconditionally It is fine to call set_msgfds() with 0 fd, and ensures any previous fd array is cleared. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:47 UTC
5c7eaab qemu-char: fix qemu_chr_fe_set_msgfds() crash when disconnected Calling qemu_chr_fe_set_msgfds() on unconnected socket leads to crash since s->ioc is NULL in this case. Return an error earlier instead. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:47 UTC
4afba63 vhost: use error_report() instead of fprintf(stderr,...) Let's use qemu proper error reporting API, this ensures the error is reported at the right place (stderr or monitor), with a conventional format. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:47 UTC
c640969 vhost: add missing VHOST_OPS_DEBUG Add missing VHOST_OPS_DEBUG() logs, for completeness. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:47 UTC
162bba7 vhost: do not assert() on vhost_ops failure Calling a vhost operation may fail, for example with disconnected vhost-user backend, but qemu shouldn't abort in this case. Log an error instead, except on error and cleanup code paths where it can be mostly ignored. Let's use a VHOST_OPS_DEBUG macro to easily disable those messages once disconnected backend stabilizes. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:47 UTC
a06db3e vhost: fix calling vhost_dev_cleanup() after vhost_dev_init() vhost_net_init() calls vhost_dev_init() and in case of failure, calls vhost_dev_cleanup() directly. However, the structure is already partially cleaned on error. Calling vhost_dev_cleanup() again will call vhost_virtqueue_cleanup() on already clean queues, and causing potential double-close. Instead, adjust dev->nvqs and simplify vhost_dev_init() code to not call vhost_virtqueue_cleanup() but vhost_dev_cleanup() instead. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:47 UTC
f1a0365 vhost-net: always call vhost_dev_cleanup() on failure vhost_dev_init(), calling vhost backend initialization, should be cleaned up after failure too. Call vhost_dev_cleanup() in all failure cases. First, it needs to zero-alloc the struct to avoid the initial garbage. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:47 UTC
e0547b5 vhost: make vhost_dev_cleanup() idempotent It is called on multiple code path, so make it safe to call several times (note: I don't remember a reproducer here, but a function called 'cleanup' should probably be idempotent in my book) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:47 UTC
5be5f9b vhost: fix cleanup on not fully initialized device If vhost_dev_init() failed, caller may still call vhost_dev_cleanup() later. However, vhost_dev_cleanup() tries to remove the device from the list even if it wasn't yet added, which may lead to crashes. Similarly for the memory listener. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:46 UTC
7b52724 vhost: assert the log was cleaned up Make sure the log was released on cleanup, or it will leak (the alternative is to call vhost_log_put() unconditionally, but it may hide some dev state issues). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:46 UTC
9e0bc24 vhost: make vhost_log_put() idempotent Although not strictly required, it is nice to have vhost_log_put() safely callable multiple times. Clear dev->log* when calling vhost_log_put() to make the function idempotent. This also simplifies a bit the caller work. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:46 UTC
7cb8a9b vhost: don't assume opaque is a fd, use backend cleanup vhost-dev opaque isn't necessarily an fd, it can be a chardev when using vhost-user. Goto fail, so vhost_backend_cleanup() is called to handle backend cleanup appropriately. vhost_set_backend_type() should never fail, use an assert(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:46 UTC
9c7d18b vhost-user: disconnect on HUP In some cases, qemu_chr_fe_read_all() on HUP event doesn't raise CHR_EVENT_CLOSED because the read/recv function returns -1 on disconnected peers (for example with tch_chr_recv, an ECONNRESET errno overwritten as EIO). It is simpler to explicitely disconnect on HUP, rising CHR_EVENT_CLOSED if it wasn't disconnected already. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:46 UTC
d9d2611 vhost-user: minor simplification Shorten the code and make it more clear by using the specialized function g_str_has_prefix(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:46 UTC
01edc23 misc: indentation Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:33:46 UTC
1e7aed7 virtio: check vring descriptor buffer length virtio back end uses set of buffers to facilitate I/O operations. An infinite loop unfolds in virtqueue_pop() if a buffer was of zero size. Add check to avoid it. Reported-by: Li Qiang <liqiang6-s@360.cn> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> 28 July 2016, 21:07:10 UTC
9a4c0e2 hw/virtio-pci: fix virtio behaviour Enable transitional virtio devices by default. Enable virtio-1.0 for devices plugged into PCIe ports (Root ports or Downstream ports). Using the virtio-1 mode will remove the limitation of the number of devices that can be attached to a machine by removing the need for the IO BAR. Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> 28 July 2016, 21:07:10 UTC
be0d976 apb: convert init to realize Convert a device model where initialization obviously can't fail, make it implement realize() rather than init(). Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> 28 July 2016, 21:07:09 UTC
86395eb hw/pci-bridge: Convert pxb initialization functions to Error Firstly, convert pxb_dev_init_common() to Error and rename it to pxb_dev_realize_common(). Actually, pxb_register_bus() is converted as well. And then, convert pxb_dev_initfn() and pxb_pcie_dev_initfn() to Error, rename them to pxb_dev_realize() and pxb_pcie_dev_realize() respectively. Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:07:09 UTC
16de88a hw/apci: handle 64-bit MMIO regions correctly In build_crs(), the calculation and merging of the ranges already happens in 64-bit, but the entry boundaries are silently truncated to 32-bit in the call to aml_dword_memory(). Fix it by handling the 64-bit MMIO ranges separately. This fixes 64-bit BARs behind PXBs. Reported-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:07:09 UTC
2df5a7b acpi: refactor pxb crs computation Instead of always passing both IO and MEM ranges when computing CRS ranges, define a new CrsRangeSet structure that include them both. This is done before introducing a third type of range, 64-bit MEM, so it will be easier to pass them all around. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:07:09 UTC
c99cb18 hw/acpi: fix a DSDT table issue when a pxb is present. PXBs do not support hotplug so they don't have a PCNT function. Since the PXB's PCI root-bus is a child bus of bus 0, the build_dsdt code will add a call to the corresponding PCNT function. Fix this by skipping the PCNT call for the above case. While at it skip also PCIe child buses. Reported-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:07:09 UTC
7b346c7 hw/pxb: declare pxb devices as not hot-pluggable Prevent future issues when hotplug will work for devices attached to pxbs. Suggested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:07:09 UTC
2c533c5 hw/pcie-root-port: Fix PCIe root port initialization Specify the root port interrupt pin as part of the init process for cases when msi/msix are not enabled. Fixes "hw/pci/pci.c:196:23: runtime error: shift exponent -1 is negative" warning from clang's sanitizer. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:07:09 UTC
6b44954 pcie: fix link active status bit migration We changed link status register in pci express endpoint capability over time. Specifically, commit b2101eae63ea57b571cee4a9075a4287d24ba4a4 ("pcie: Set the "link active" in the link status register") set data link layer link active bit in this register without adding compatibility to old machine types. When migrating from qemu 2.3 and older this affects xhci devices which under machine type 2.0 and older have a pci express endpoint capability even if they are on a pci bus. Add compatibility flags to make this bit value match what it was under 2.3. Additionally, to avoid breaking migration from qemu 2.3 and up, suppress checking link status during migration: this seems sane since hardware can change link status at any time. https://bugzilla.redhat.com/show_bug.cgi?id=1352860 Reported-by: Gerd Hoffmann <kraxel@redhat.com> Fixes: b2101eae63ea57b571cee4a9075a4287d24ba4a4 ("pcie: Set the "link active" in the link status register") Cc: qemu-stable@nongnu.org Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> 28 July 2016, 21:07:08 UTC
701074a target-mips: fix EntryHi.EHINV being cleared on TLB exception While implementing TLB invalidation feature we forgot to modify part of code responsible for updating EntryHi during TLB exception. Consequently EntryHi.EHINV is unexpectedly cleared on the exception. Signed-off-by: Leon Alrae <leon.alrae@imgtec.com> 28 July 2016, 10:24:02 UTC
7f81dbb hw/mips_malta: Fix YAMON API print routine The print routine provided as part of the in-built bootloader had a bug in that it attempted to use a jump instruction as part of a loop, but the target has its upper bits zeroed leading to control flow transferring to 0xb0000814 rather than the intended 0xbfc00814. Fix this by using a branch instruction instead, which seems more fit for purpose. A simple way to test this is to build a Linux kernel with EVA enabled & attempt to boot it in QEMU. It will attempt to print a message indicating the configuration mismatch but QEMU would previously incorrectly jump & wind up printing a continuous stream of the letter E. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Leon Alrae <leon.alrae@imgtec.com> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Leon Alrae <leon.alrae@imgtec.com> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com> 28 July 2016, 10:24:00 UTC
21a21b8 Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging x86 and machine queue, 2016-07-27 Highlights: * Fixes to allow CPU hotplug/unplug in any order; * Exit QEMU on invalid global properties. # gpg: Signature made Wed 27 Jul 2016 15:28:53 BST # gpg: using RSA key 0x2807936F984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/x86-pull-request: vl: exit if a bad property value is passed to -global qdev: ignore GlobalProperty.errp for hotplugged devices machine: Add comment to abort path in machine_set_kernel_irqchip Revert "pc: Enforce adding CPUs contiguously and removing them in opposite order" pc: Init CPUState->cpu_index with index in possible_cpus[] qdev: Fix object reference leak in case device.realize() fails exec: Set cpu_index only if it's not been explictly set exec: Don't use cpu_index to detect if cpu_exec_init()'s been called exec: Reduce CONFIG_USER_ONLY ifdeffenery Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 27 July 2016, 17:18:21 UTC
51313fe Merge remote-tracking branch 'remotes/stefanha/tags/CVE-2016-5403-virtio-unbounded-allocation-pull-request' into staging # gpg: Signature made Wed 27 Jul 2016 16:13:02 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/CVE-2016-5403-virtio-unbounded-allocation-pull-request: virtio: error out if guest exceeds virtqueue size Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 27 July 2016, 16:26:07 UTC
df5c50a Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging # gpg: Signature made Tue 26 Jul 2016 21:51:38 BST # gpg: using RSA key 0xBDBE7B27C0DE3057 # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>" # gpg: aka "Jeffrey Cody <jeff@codyprime.org>" # gpg: aka "Jeffrey Cody <codyprime@gmail.com>" # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98 D624 BDBE 7B27 C0DE 3057 * remotes/cody/tags/block-pull-request: mirror: double performance of the bulk stage if the disc is full block/gluster: fix doc in the qapi schema and member name Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 27 July 2016, 15:31:01 UTC
03f28ef vl: exit if a bad property value is passed to -global When passing '-global driver=host-powerpc64-cpu,property=compat,value=foo' on the command line, without this patch, we get the following warning per device (which means many lines if the guests has many cpus): qemu-system-ppc64: Warning: can't apply global host-powerpc64-cpu.compat=foo: Invalid compatibility mode "foo" ... and QEMU continues execution, ignoring the property. With this patch, we get a single line: qemu-system-ppc64: can't apply global host-powerpc64-cpu.compat=foo: Invalid compatibility mode "foo" ... and QEMU exits. The previous behavior is kept for hotplugged devices since we don't want QEMU to exit when doing device_add. Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> 27 July 2016, 14:25:06 UTC
b3443f4 qdev: ignore GlobalProperty.errp for hotplugged devices This patch ensures QEMU won't terminate while hotplugging a device if the global property cannot be set and errp points to error_fatal or error_abort. While here, it also fixes indentation of the typename argument. Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> 27 July 2016, 14:25:06 UTC
78a3930 machine: Add comment to abort path in machine_set_kernel_irqchip We're not supposed to abort when the user passes a bogus value. Since the checking is done in visit_type_OnOffSplit(), the call to abort() is legitimate. Let's add a comment to make it explicit. Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> 27 July 2016, 14:25:06 UTC
afd9096 virtio: error out if guest exceeds virtqueue size A broken or malicious guest can submit more requests than the virtqueue size permits, causing unbounded memory allocation in QEMU. The guest can submit requests without bothering to wait for completion and is therefore not bound by virtqueue size. This requires reusing vring descriptors in more than one request, which is not allowed by the VIRTIO 1.0 specification. In "3.2.1 Supplying Buffers to The Device", the VIRTIO 1.0 specification says: 1. The driver places the buffer into free descriptor(s) in the descriptor table, chaining as necessary and Note that the above code does not take precautions against the available ring buffer wrapping around: this is not possible since the ring buffer is the same size as the descriptor table, so step (1) will prevent such a condition. This implies that placing more buffers into the virtqueue than the descriptor table size is not allowed. QEMU is missing the check to prevent this case. Processing a request allocates a VirtQueueElement leading to unbounded memory allocation controlled by the guest. Exit with an error if the guest provides more requests than the virtqueue size permits. This bounds memory allocation and makes the buggy guest visible to the user. This patch fixes CVE-2016-5403 and was reported by Zhenhao Hong from 360 Marvel Team, China. Reported-by: Zhenhao Hong <hongzhenhao@360.cn> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> 27 July 2016, 13:04:40 UTC
0965a41 mirror: double performance of the bulk stage if the disc is full Mirror can do up to 16 in-flight requests, but actually on full copy (the whole source disk is non-zero) in-flight is always 1. This happens as the request is not limited in size: the data occupies maximum available capacity of s->buf. The patch limits the size of the request to some artificial constant (1 Mb here), which is not that big or small. This effectively enables back parallelism in mirror code as it was designed. The result is important: the time to migrate 10 Gb disk is reduced from ~350 sec to 170 sec. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-id: 1468516741-82174-1-git-send-email-vsementsov@virtuozzo.com CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Fam Zheng <famz@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> CC: Max Reitz <mreitz@redhat.com> CC: Jeff Cody <jcody@redhat.com> CC: Eric Blake <eblake@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> 26 July 2016, 20:23:36 UTC
0a189ff block/gluster: fix doc in the qapi schema and member name 1. qapi @BlockdevOptionsGluster schema member name s/debug_level/debug-level/ 2. rearrange the versioning 3. s/server description/servers description/ Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-Id: <1469198048-8535-1-git-send-email-prasanna.kalever@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> 26 July 2016, 20:23:36 UTC
9527e7b Revert "pc: Enforce adding CPUs contiguously and removing them in opposite order" This reverts commit 4da7faaeb0c7dd3f7f233165d336c878f78fd1eb. Since commit: pc: init CPUState->cpu_index with index in possible_cpus[] cpu_index is stable regardless of the order cpus were created and QEMU instance stays migratable always so limitation added by 4da7faaeb could be safely removed. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> 26 July 2016, 18:32:13 UTC
a15d272 pc: Init CPUState->cpu_index with index in possible_cpus[] It will enshure that cpu_index for a given cpu stays the same regardless of the order cpus has been created/deleted. No compat code is needed as for initial cpus index in possible_cpus[] matches cpu_index that's been auto-allocated in cpu_exec_init(). Tha same applies for hotplug with cpu-add command if cpus are added sequentially in increasing order as 'id' matches cpu_index. If cpu-add had been used for creating out-of-order cpus, that created unmigratable instance since it were not possible to start target with the same cpu_index using old way of migrating instance with hotplugged cpus: * source QEMU with CLI (-smp 1,maxcpus=3 and cpu-add id=2) following set of cpu_index is allocated [0, 1] with apics set [0, 2] respectivelly * target QEMU is started with CLI -smp 2,maxcpus=3 resulting in set of cpu_index [0, 1] but with set of apics [0, 1] wich doesn't match source. So we don't need compat code in this case as it's never worked and newelly added device_add support would use stable cpu_index set by machine to begin with, so it won't have above limitation and source QEMU could be migrated to destination regardless of the order cpus were created. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> 26 July 2016, 18:32:08 UTC
69382d8 qdev: Fix object reference leak in case device.realize() fails If device doesn't have parent assined before its realize is called, device_set_realized() will implicitly set parent to '/machine/unattached'. However device_set_realized() may fail after that point at several other points leaving not realized object dangling in '/machine/unattached' and as result caller of obj = object_new() obj->ref == 1 object_property_set_bool(obj,..., true, "realized",...) obj->ref == 2 if (fail) object_unref(obj); obj->ref == 1 will get object leak instead of expected object destruction. Fix it by making device_set_realized() to cleanup after itself in case of failure. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> 26 July 2016, 18:32:04 UTC
a07f953 exec: Set cpu_index only if it's not been explictly set It keeps the legacy behavior for all users that doesn't care about stable cpu_index value, but would allow boards that would support device_add/device_del to set stable cpu_index that won't depend on order in which cpus are created/destroyed. While at that simplify cpu_get_free_index() as cpu_index generated by USER_ONLY and softmmu variants is the same since none of the users support cpu-remove so far, except of not yet released spapr/x86 device_add/delr, which will be altered by follow up patches to set stable cpu_index manually. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> 26 July 2016, 18:32:01 UTC
8b1b835 exec: Don't use cpu_index to detect if cpu_exec_init()'s been called Instead use QTAIL's tqe_prev field to detect if cpu's been placed in list by cpu_exec_init() which is always set if QTAIL element is in list. Fixes SIGSEGV on failure path in case cpu_index is assigned by board and cpu.relalize() fails before cpu_exec_init() is called. In follow up patches, cpu_index will be assigned by boards that support cpu hot(un)plug and need stable cpu_index that doesn't depend on order cpus are created/removed. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reported-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> 26 July 2016, 18:32:00 UTC
1bc7e52 exec: Reduce CONFIG_USER_ONLY ifdeffenery Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> 26 July 2016, 18:31:58 UTC
c1fdfe9 Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2016-07-26' into staging Block patches for 2.7.0-rc1 # gpg: Signature made Tue 26 Jul 2016 18:11:36 BST # gpg: using RSA key 0x3BB14202E838ACAD # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 # Subkey fingerprint: 58B3 81CE 2DC8 9CF9 9730 EE64 3BB1 4202 E838 ACAD * remotes/maxreitz/tags/pull-block-2016-07-26: iotest: fix python based IO tests block: export LUKS specific data to qemu-img info crypto: add support for querying parameters for block encryption AioContext: correct comments qcow2: do not allocate extra memory Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 26 July 2016, 17:22:49 UTC
4c44b4a iotest: fix python based IO tests The previous commit refactoring iotests.py: commit 66613974468fb6e1609fb3eabf55981b1ee436cf Author: Daniel P. Berrange <berrange@redhat.com> Date: Wed Jul 20 14:23:10 2016 +0100 scripts: refactor the VM class in iotests for reuse was not properly tested and included a number of broken bits. - The 'event_match' method was not moved into qemu.py - The 'self._args' list parameter in QEMUMachine needs to be copied otherwise modifications will affect the global 'qemu_opts' variable in iotests.py - The QEMUQtestMachine class methods had inverted parameter order for the super() calls - The QEMUQtestMachine class forgot to add '-machine accel=qtest' - The QEMUQtestMachine class constructor needs to set a default 'name' value before using it as it may be None - The QEMUQtestMachine class constructor needs to use named parameters when calling the super constructor as it is leaving out some positional parameters. - The 'qemu_prog' variable should be a string not a list in iotests.py - The VM classs constructor needs to use named parameters when calling the super constructor as it is leaving out some positional parameters. - The path to the socket-scm-helper needs to be passed into the QEMUMachine class Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1469549767-27249-1-git-send-email-berrange@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com> 26 July 2016, 16:28:40 UTC
c7c4cf4 block: export LUKS specific data to qemu-img info The qemu-img info command has the ability to expose format specific metadata about volumes. Wire up this facility for the LUKS driver to report on cipher configuration and key slot usage. $ qemu-img info ~/VirtualMachines/demo.luks image: /home/berrange/VirtualMachines/demo.luks file format: luks virtual size: 98M (102760448 bytes) disk size: 100M encrypted: yes Format specific information: ivgen alg: plain64 hash alg: sha1 cipher alg: aes-128 uuid: 6ddee74b-3a22-408c-8909-6789d4fa2594 cipher mode: xts slots: [0]: active: true iters: 572706 key offset: 4096 stripes: 4000 [1]: active: false key offset: 135168 [2]: active: false key offset: 266240 [3]: active: false key offset: 397312 [4]: active: false key offset: 528384 [5]: active: false key offset: 659456 [6]: active: false key offset: 790528 [7]: active: false key offset: 921600 payload offset: 2097152 master key iters: 142375 One somewhat undesirable artifact is that the data fields are printed out in (apparently) random order. This will be addressed later by changing the way the block layer pretty-prints the image specific data. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1469192015-16487-3-git-send-email-berrange@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> 26 July 2016, 15:46:37 UTC
40c8502 crypto: add support for querying parameters for block encryption When creating new block encryption volumes, we accept a list of parameters to control the formatting process. It is useful to be able to query what those parameters were for existing block devices. Add a qcrypto_block_get_info() method which returns a QCryptoBlockInfo instance to report this data. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1469192015-16487-2-git-send-email-berrange@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> 26 July 2016, 15:46:37 UTC
54a16a6 AioContext: correct comments Correct comments of field notify_me Cc: Kevin Wolf <kwolf@redhat.com> Cc: Max Reitz <mreitz@redhat.com> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Message-id: 1468575858-22975-1-git-send-email-caoj.fnst@cn.fujitsu.com Signed-off-by: Max Reitz <mreitz@redhat.com> 26 July 2016, 15:46:37 UTC
ebf7bba qcow2: do not allocate extra memory There are no needs to allocate more than one cluster, as we set avail_out for deflate to one cluster. Zlib docs (http://www.zlib.net/manual.html) says: "deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full." So, deflate will not write more than avail_out to output buffer. If there is not enough space in output buffer for compressed data (it may be larger than input data) deflate just returns Z_OK. (if all data is compressed and written to output buffer deflate returns Z_STREAM_END). Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 1468515565-81313-1-git-send-email-vsementsov@virtuozzo.com Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> 26 July 2016, 15:46:37 UTC
f49ee63 Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160726' into staging ppc patch queue 2016-07-26 Here's the current batch of ppc and spapr related patches intended for qemu-2.7. Given the late stage in 2.7 development, these are all bugfixes with one exception: The "spapr: disintricate core-id from DT semantics" changes the way ids are assigned in the new core-based hotplug infrastructure. This isn't strictly a bugfix, but we've determined that the current way of assigning core-ids will cause considerable grief with future plans for cpu hotplug. Therefore it's better to fix this now, late in 2.7, before we have a released version with the problematic numbering. # gpg: Signature made Tue 26 Jul 2016 04:04:57 BST # gpg: using RSA key 0x6C38CACA20D9B392 # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" # gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>" # gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392 * remotes/dgibson/tags/ppc-for-2.7-20160726: spapr: disintricate core-id from DT semantics target-ppc: add PPC_MFTB flag to e500mc and e5500 spapr: fix spapr-nvram migration hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled ppc: Huge page detection mechanism fixes - Episode III Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 26 July 2016, 10:53:47 UTC
a467bb9 Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2016-07-25-tag' into staging qemu-ga patch queue for 2.7 * fix w32 build failures due to -Werror when building with VSS/fsfreeze enabled * fix leaking for qemu-ga config files in `make check` # gpg: Signature made Mon 25 Jul 2016 20:01:09 BST # gpg: using RSA key 0x3353C9CEF108B584 # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" # gpg: aka "Michael Roth <mdroth@utexas.edu>" # gpg: aka "Michael Roth <mdroth@linux.vnet.ibm.com>" # Primary key fingerprint: CEAC C9E1 5534 EBAB B82D 3FA0 3353 C9CE F108 B584 * remotes/mdroth/tags/qga-pull-2016-07-25-tag: configure: mark qemu-ga VSS includes as system headers tests: use static qga config file build-sys: link tests/data Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 26 July 2016, 09:53:23 UTC
690604f configure: mark qemu-ga VSS includes as system headers As of e4650c81, we do w32 builds with -Werror enabled. Unfortunately for cases where we enable VSS support in qemu-ga, we still have warnings generated by VSS includes that ship as part of the Microsoft VSS SDK. We can selectively address a number of these warnings using #pragma GCC diagnostic ignored ... but at least one of these: warning: ‘typedef’ was ignored in this declaration resulting from declarations of the form: typedef struct Blah { ... }; does not provide a specific command-line/pragma option to disable warnings of the sort. To allow VSS builds to succeed, the next-best option is disabling these warnings on a per-file basis. pragmas like #pragma GCC system_header can be used to declare subsequent includes/declarations as being exempt from normal warnings, but this must be done within a header file. Since we don't control the VSS SDK, we'd need to rely on a intermediate header include to accomplish this, and since different objects in the VSS link target rely on different headers from the VSS SDK, this would become somewhat of a rat's nest (though not totally unmanageable). The next step up in granularity is just marking the entire VSS SDK include path as system headers via -isystem. This is a bit more heavy-handed, but since this SDK hasn't changed since 2005, there's likely little to be gained from selectively disabling warnings anyway, so we implement that approach here. This fixes the -Werror failures in both the configure test and the qga build due to shared reliance on $vss_win32_include. For the same reason, this also enforces a new dependency on -isystem support in the C/C++ compiler when building QGA with VSS enabled. Cc: Thomas Huth <thuth@redhat.com> Cc: Stefan Weil <sw@weilnetz.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> 25 July 2016, 18:23:18 UTC
1741b94 tests: use static qga config file Do not create a leaking temporary file, but use a static file instead. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> 25 July 2016, 18:23:18 UTC
fe31017 build-sys: link tests/data Link a common tests data directory to the build directory. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> 25 July 2016, 18:23:17 UTC
12bf2d3 spapr: disintricate core-id from DT semantics The goal of this patch is to have a stable core-id which does not depend on any DT related semantics, which involve non-obvious computations on modern PowerPC server cpus. With this patch, the DT core id is computed on-demand as: (core-id / smp_threads) * smt where smt is the number of threads per core in the host. This formula should be consolidated in a helper since it is needed in several places. Other uses for core-id includes: compute a stable cpu_index (which allows random order hotplug/unplug without breaking migration) and NUMA. Signed-off-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 25 July 2016, 05:43:41 UTC
2fff4ba target-ppc: add PPC_MFTB flag to e500mc and e5500 According to the e500mc and e5500 core reference manual they have support for the mftb instruction. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 25 July 2016, 01:18:49 UTC
cf472f4 spapr: fix spapr-nvram migration When spapr-nvram is backed by a file using pflash interface, migration fails on the destination guest with assert: bdrv_co_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed. This avoids the problem by delaying the pflash update until after the device loads complete. This fix is similar to the one for the pflash_cfi01 migration: 90c647d Fix pflash migration Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 25 July 2016, 00:19:30 UTC
c573fc0 hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled When canceling a migration process, we currently do not close the HTAB migration file descriptor since htab_save_complete() is never called in that case. So we leave the migration process with a dangling htab_fd value around, and this causes any further migration attempts to fail. To fix this issue, simply make sure that the htab_fd is closed during the migration cleanup stage. And since the cleanup() function is also called when migration succeeds, we can also remove the call to close_htab_fd() from the htab_save_complete() function. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1354341 Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 25 July 2016, 00:19:30 UTC
3d4f253 ppc: Huge page detection mechanism fixes - Episode III After already fixing two issues with the huge page detection mechanism (see commit 159d2e39a860 and 86b50f2e1bef), Greg Kurz noticed another case that caused the guest to crash where QEMU announces huge pages though they should not be available for the guest: qemu-system-ppc64 -enable-kvm ... -mem-path /dev/hugepages \ -m 1G,slots=4,maxmem=32G -object memory-backend-ram,policy=default,size=1G,id=mem-mem1 \ -device pc-dimm,id=dimm-mem1,memdev=mem-mem1 -smp 2 \ -numa node,nodeid=0 -numa node,nodeid=1 That means if there is a global mem-path option, we still have to look at the memory-backend objects that have been specified additionally and return their minimum page size if that value is smaller than the page size of the main memory. Reported-by: Greg Kurz <groug@kaod.org> Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Tested-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 25 July 2016, 00:19:30 UTC
2d2e632 Update version for v2.7.0-rc0 release Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 22 July 2016, 14:32:42 UTC
01a7201 target-sh4: Use glib allocator in movcal helper Coverity spots that helper_movcal() calls malloc() but doesn't check for failure. Fix this by switching to the glib allocation functions, which abort on allocation failure. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1468327859-21385-1-git-send-email-peter.maydell@linaro.org Acked-by: Aurelien Jarno <aurelien@aurel32.net> 22 July 2016, 10:33:24 UTC
e3643d3 Merge remote-tracking branch 'remotes/amit-migration/tags/migration-for-2.7-6' into staging Migration: - Fix a postcopy bug - Add a testsuite for measuring migration performance # gpg: Signature made Fri 22 Jul 2016 08:56:44 BST # gpg: using RSA key 0xEB0B4DFC657EF670 # gpg: Good signature from "Amit Shah <amit@amitshah.net>" # gpg: aka "Amit Shah <amit@kernel.org>" # gpg: aka "Amit Shah <amitshah@gmx.net>" # Primary key fingerprint: 48CA 3722 5FE7 F4A8 B337 2735 1E9A 3B5F 8540 83B6 # Subkey fingerprint: CC63 D332 AB8F 4617 4529 6534 EB0B 4DFC 657E F670 * remotes/amit-migration/tags/migration-for-2.7-6: tests: introduce a framework for testing migration performance scripts: ensure monitor socket has SO_REUSEADDR set scripts: set timeout when waiting for qemu monitor connection scripts: refactor the VM class in iotests for reuse scripts: add a 'debug' parameter to QEMUMonitorProtocol scripts: add __init__.py file to scripts/qmp/ migration: set state to post-migrate on failure Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 22 July 2016, 09:51:32 UTC
409437e tests: introduce a framework for testing migration performance This introduces a moderately general purpose framework for testing performance of migration. The initial guest workload is provided by the included 'stress' program, which is configured to spawn one thread per guest CPU and run a maximally memory intensive workload. It will loop over GB of memory, xor'ing each byte with data from a 4k array of random bytes. This ensures heavy read and write load across all of guest memory to stress the migration performance. While running the 'stress' program will record how long it takes to xor each GB of memory and print this data for later reporting. The test engine will spawn a pair of QEMU processes, either on the same host, or with the target on a remote host via ssh, using the host kernel and a custom initrd built with 'stress' as the /init binary. Kernel command line args are set to ensure a fast kernel boot time (< 1 second) between launching QEMU and the stress program starting execution. None the less, the test engine will initially wait N seconds for the guest workload to stablize, before starting the migration operation. When migration is running, the engine will use pause, post-copy, autoconverge, xbzrle compression and multithread compression features, as well as downtime & bandwidth tuning to encourage completion. If migration completes, the test engine will wait N seconds again for the guest workooad to stablize on the target host. If migration does not complete after a preset number of iterations, it will be aborted. While the QEMU process is running on the source host, the test engine will sample the host CPU usage of QEMU as a whole, and each vCPU thread. While migration is running, it will record all the stats reported by 'query-migration'. Finally, it will capture the output of the stress program running in the guest. All the data produced from a single test execution is recorded in a structured JSON file. A separate program is then able to create interactive charts using the "plotly" python + javascript libraries, showing the characteristics of the migration. The data output provides visualization of the effect on guest vCPU workloads from the migration process, the corresponding vCPU utilization on the host, and the overall CPU hit from QEMU on the host. This is correlated from statistics from the migration process, such as downtime, vCPU throttling and iteration number. While the tests can be run individually with arbitrary parameters, there is also a facility for producing batch reports for a number of pre-defined scenarios / comparisons, in order to be able to get standardized results across different hardware configurations (eg TCP vs RDMA, or comparing different VCPU counts / memory sizes, etc). To use this, first you must build the initrd image $ make tests/migration/initrd-stress.img To run a a one-shot test with all default parameters $ ./tests/migration/guestperf.py > result.json This has many command line args for varying its behaviour. For example, to increase the RAM size and CPU count and bind it to specific host NUMA nodes $ ./tests/migration/guestperf.py \ --mem 4 --cpus 2 \ --src-mem-bind 0 --src-cpu-bind 0,1 \ --dst-mem-bind 1 --dst-cpu-bind 2,3 \ > result.json Using mem + cpu binding is strongly recommended on NUMA machines, otherwise the guest performance results will vary wildly between runs of the test due to lucky/unlucky NUMA placement, making sensible data analysis impossible. To make it run across separate hosts: $ ./tests/migration/guestperf.py \ --dst-host somehostname > result.json To request that post-copy is enabled, with switchover after 5 iterations $ ./tests/migration/guestperf.py \ --post-copy --post-copy-iters 5 > result.json Once a result.json file is created, a graph of the data can be generated, showing guest workload performance per thread and the migration iteration points: $ ./tests/migration/guestperf-plot.py --output result.html \ --migration-iters --split-guest-cpu result.json To further include host vCPU utilization and overall QEMU utilization $ ./tests/migration/guestperf-plot.py --output result.html \ --migration-iters --split-guest-cpu \ --qemu-cpu --vcpu-cpu result.json NB, the 'guestperf-plot.py' command requires that you have the plotly python library installed. eg you must do $ pip install --user plotly Viewing the result.html file requires that you have the plotly.min.js file in the same directory as the HTML output. This js file is installed as part of the plotly python library, so can be found in $HOME/.local/lib/python2.7/site-packages/plotly/offline/plotly.min.js The guestperf-plot.py program can accept multiple json files to plot, enabling results from different configurations to be compared. Finally, to run the entire standardized set of comparisons $ ./tests/migration/guestperf-batch.py \ --dst-host somehost \ --mem 4 --cpus 2 \ --src-mem-bind 0 --src-cpu-bind 0,1 \ --dst-mem-bind 1 --dst-cpu-bind 2,3 --output tcp-somehost-4gb-2cpu will store JSON files from all scenarios in the directory named tcp-somehost-4gb-2cpu Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1469020993-29426-7-git-send-email-berrange@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> 22 July 2016, 07:53:39 UTC
168ae6c scripts: ensure monitor socket has SO_REUSEADDR set If tests use a TCP based monitor socket, the connection will go into a TIMED_WAIT state when the test exits. This will randomly prevent the test from being re-run without a certain time period. Set the SO_REUSEADDR flag on the socket to ensure we can immediately re-run the tests Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1469020993-29426-6-git-send-email-berrange@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> 22 July 2016, 07:53:35 UTC
2380646 scripts: set timeout when waiting for qemu monitor connection If QEMU fails to launch for some reason, the QEMUMonitorProtocol class accept() method will wait forever in a socket accept call. Set a timeout of 15 seconds so that we fail more gracefully instead of hanging the test script forever Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1469020993-29426-5-git-send-email-berrange@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> 22 July 2016, 07:53:28 UTC
6661397 scripts: refactor the VM class in iotests for reuse The iotests module has a python class for controlling QEMU processes. Pull the generic functionality out of this file and create a scripts/qemu.py module containing a QEMUMachine class. Put the QTest integration support into a subclass QEMUQtestMachine. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1469020993-29426-4-git-send-email-berrange@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> 22 July 2016, 07:53:24 UTC
991e7c4 scripts: add a 'debug' parameter to QEMUMonitorProtocol Add a 'debug' parameter to the QEMUMonitorProtocol class which will cause it to print out all JSON strings on sys.stderr Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1469020993-29426-3-git-send-email-berrange@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> 22 July 2016, 07:53:17 UTC
6f7a4a8 scripts: add __init__.py file to scripts/qmp/ When searching for modules to load, python will ignore any sub-directory which does not contain __init__.py. This means that both scripts and scripts/qmp/ have to be explicitly added to the python path. By adding a __init__.py file to scripts/qmp, we only need add scripts/ to the python path and can then simply do 'from qmp import qmp' to load scripts/qmp/qmp.py. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1469020993-29426-2-git-send-email-berrange@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> 22 July 2016, 07:53:13 UTC
42da555 migration: set state to post-migrate on failure If a migration fails/is cancelled during the postcopy stage we currently end up with the runstate as finish-migrate, where it should be post-migrate. There's a small window in precopy where I think the same thing can happen, but I've never seen it. It rarely matters; the only postcopy case is if you restart a migration, which again is a case that rarely matters in postcopy because it's only safe to restart the migration if you know the destination hasn't been running (which you might if you started the destination with -S and hadn't got around to 'c' ing it before the postcopy failed). Even then it's a small window but potentially you could hit if there's a problem loading the devices on the destination. This corresponds to: https://bugzilla.redhat.com/show_bug.cgi?id=1355683 Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Message-Id: <1468601086-32117-1-git-send-email-dgilbert@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> 22 July 2016, 07:53:09 UTC
206d0c2 Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging pc, pci, virtio: new features, cleanups, fixes - interrupt remapping for intel iommus - a bunch of virtio cleanups - fixes all over the place Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 21 Jul 2016 18:49:30 BST # gpg: using RSA key 0x281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: (57 commits) intel_iommu: avoid unnamed fields virtio: Update migration docs virtio-gpu: Wrap in vmstate virtio-gpu: Use migrate_add_blocker for virgl migration blocking virtio-input: Wrap in vmstate 9pfs: Wrap in vmstate virtio-serial: Wrap in vmstate virtio-net: Wrap in vmstate virtio-balloon: Wrap in vmstate virtio-rng: Wrap in vmstate virtio-blk: Wrap in vmstate virtio-scsi: Wrap in vmstate virtio: Migration helper function and macro virtio-serial: Remove old migration version support virtio-net: Remove old migration version support virtio-scsi: Replace HandleOutput typedef Revert "mirror: Workaround for unexpected iohandler events during completion" virtio-scsi: Call virtio_add_queue_aio virtio-blk: Call virtio_add_queue_aio virtio: Introduce virtio_add_queue_aio ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org> 21 July 2016, 19:12:37 UTC
back to top