summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-08-22Update VERSION for 1.5.3 releasev1.5.3Michael Roth1-1/+1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-14qemu-char: Fix ringbuf option sizeMarkus Armbruster1-1/+1
Any attempt to use it trips an "opt->desc->type == QEMU_OPT_NUMBER" assertion. Broken in commit 1da48c65. Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> (cherry picked from commit 0f953051178f2e3df36efa5158a71f33d35fa812) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-14qemu-char: fix infinite recursion connecting to monitor ptyJames Hogan1-1/+1
Since commit bd5c51e (qemu-char: don't issue CHR_EVENT_OPEN in a BH), an infinite recursion occurs when putting the monitor on a pty (-monitor pty) and connecting a terminal to the slave port. This is because of the qemu_chr_be_event(s, CHR_EVENT_OPENED) added to qemu_chr_be_generic_open(). This event is captured by monitor_event() which prints a welcome message to the character device. The flush of that welcome message retriggers another open event in pty_chr_state() because it checks s->connected, but only sets it to 1 after calling qemu_chr_be_generic_open(). I've fixed this by setting s->connected = 1 before the call to qemu_chr_be_generic_open() instead of after, so that the recursive pty_chr_state() doesn't call it again. An example snippet of repeating backtrace: ... #107486 0x007aec58 in monitor_flush (mon=0xf418b0) at qemu/monitor.c:288 #107487 0x007aee7c in monitor_puts (mon=0xf418b0, str=0x1176d07 "") at qemu/monitor.c:322 #107488 0x007aef20 in monitor_vprintf (mon=0xf418b0, fmt=0x8d4820 "QEMU %s monitor - type 'help' for more information\n", ap=0x7f432be0) at qemu/monitor.c:339 #107489 0x007aefac in monitor_printf (mon=0xf418b0, fmt=0x8d4820 "QEMU %s monitor - type 'help' for more information\n") at qemu/monitor.c:347 #107490 0x007ba4bc in monitor_event (opaque=0xf418b0, event=2) at qemu/monitor.c:4699 #107491 0x00684c28 in qemu_chr_be_event (s=0xf37788, event=2) at qemu/qemu-char.c:108 #107492 0x00684c70 in qemu_chr_be_generic_open (s=0xf37788) at qemu/qemu-char.c:113 #107493 0x006880a4 in pty_chr_state (chr=0xf37788, connected=1) at qemu/qemu-char.c:1145 #107494 0x00687fa4 in pty_chr_update_read_handler (chr=0xf37788) at qemu/qemu-char.c:1121 #107495 0x00687c9c in pty_chr_write (chr=0xf37788, buf=0x70b3c008 <Address 0x70b3c008 out of bounds>, len=538720) at qemu/qemu-char.c:1063 #107496 0x00684cc4 in qemu_chr_fe_write (s=0xf37788, buf=0x70b3c008 <Address 0x70b3c008 out of bounds>, len=538720) at qemu/qemu-char.c:118 ... Signed-off-by: James Hogan <james.hogan@imgtec.com> Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com> Message-id: 1375960178-10882-1-git-send-email-james.hogan@imgtec.com Cc: Michael Roth <mdroth@linux.vnet.ibm.com> Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 3a3567d337d3ee6fb2e2fcc1d27cd045ed97ae9b) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13Merge tag 'qom-cpu-for-1.5' into stable-1.5-stagingMichael Roth2-0/+2
QOM CPUState and X86CPU for stable-1.5 * Fix X86CPU Westmere CPUID for pc-*-1.4 and older Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13pc: Remove PCLMULQDQ from Westmere on pc-*-1.4 and olderEduardo Habkost2-0/+2
Commit 41cb383f42d0cb51d8e3e25e3ecebc954dd4196f made a guest-visible change by adding the PCLMULQDQ bit to Westmere without adding compatibility code to keep the ABI for older machine-types. Fix it by adding the missing compat code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> (cherry picked from commit 56383703c060777fd01aaf8d63d5f46d660e9fb9) Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-08-13vhost: clear signalled_used_valid on vhost stopMichael S. Tsirkin1-0/+1
When vhost device stops, its implementation synchronizes kernel state back to virtio.c so we can continue emulating the device in userspace. This patch ensures that virtio.c's signalled_used_valid flag is reset so that userspace does not suppress guest notifications due to stale signalled_used values. Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 3561ba14188b3c1e54246ed6db97896bbc082d2f) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13virtio: clear signalled_used_valid when switching from dataplaneStefan Hajnoczi3-0/+7
When the dataplane thread stops, its vring.c implementation synchronizes vring state back to virtio.c so we can continue emulating the virtio device. This patch ensures that virtio.c's signalled_used_valid flag is reset so that we do not suppress guest notifications due to stale signalled_used values. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 6793dfd1b6a99a79b9f2e3c4d6625ccd6513f240) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13dataplane: sync virtio.c and vring.c virtqueue stateStefan Hajnoczi3-5/+7
Load the virtio.c state into vring.c when we start dataplane mode and vice versa when stopping dataplane mode. This patch makes it possible to start and stop dataplane any time while the guest is running. This will eventually allow us to go back to QEMU main loop for bdrv_drain_all() and live migration. In the meantime, this patch makes the dataplane lifecycle more robust but should make no visible difference. It may be useful in the virtio-net dataplane effort. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit 9154b02c53bb6685797c973fcdbec51c4714777d) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13i82801b11: Fix i82801b11 PCI host bridge config spaceGerd Hoffmann1-0/+1
pci_bridge_write_config() was not being used. Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 4965b7f056177ddfb816319e9ff5e766898d0bc5) Conflicts: hw/pci-bridge/i82801b11.c * modified to avoid dependency on 125ee0ed Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13Bugfix for loading multiboot kernelsMartijn van den Broek1-4/+3
This patch fixes a bug in rom_copy introduced by commit d60fa42e8bae39440f997ebfe8fe328269a57d16. rom_copy failed to load roms with a "datasize" of 0. As a result, multiboot kernels were not loaded correctly when they contain a segment with a "file size" of 0. https://bugs.launchpad.net/qemu/+bug/1208944 Signed-off-by: Martijn van den Broek <martijn.vdbrk@gmail.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: CAG1x_oET1u3TMPu3r_zzd3ZXsTWQLiaM0zAc+RkHFCwvJjGOvg@mail.gmail.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 0dd5ce38fbeb2fb97b01cc8c1c97292211e48ee6) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13semaphore: fix a hangup problem under load on NetBSD hosts.Izumi Tsutsui2-13/+17
Fix following bugs in "fallback implementation of counting semaphores with mutex+condvar" added in c166cb72f1676855816340666c3b618beef4b976: - waiting threads are not restarted properly if more than one threads are waiting unblock signals in qemu_sem_timedwait() - possible missing pthread_cond_signal(3) calls when waiting threads are returned by ETIMEDOUT - fix an uninitialized variable The problem is analyzed by and fix is provided by Noriyuki Soda. Also put additional cleanup suggested by Laszlo Ersek: - make QemuSemaphore.count unsigned (it won't be negative) - check a return value of in pthread_cond_wait() in qemu_sem_wait() Signed-off-by: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-id: 1372841894-10634-1-git-send-email-tsutsui@ceres.dti.ne.jp Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 79761c6681f0d1cc1c027116fcb4382d41ed3ece) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13ignore SIGPIPE in qemu-img and qemu-ioMORITA Kazutaka2-0/+8
This prevents the tools from being stopped when they write data to a closed connection in the other side. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 526eda14a68d5b3596be715505289b541288ef2a) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13target-i386: Fix X86CPU error handlingAndreas Färber2-8/+11
Error **errp argument is not for emitting warnings, it means an error has occurred and the caller should not make any assumptions about the state of other return values (unless otherwise documented). Therefore cpu_x86_create() must unref the new X86CPU itself, and pc_new_cpu() must check for an Error rather than NULL return value. While at it, clean up a superfluous NULL check. Reported-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: qemu-stable@nongnu.org Cc: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> (cherry picked from commit cd7b87ffe9b6b7b0089ec8c71555f3b942bc6daf) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13iov: handle EOF in iov_send_recvMORITA Kazutaka1-0/+6
Without this patch, iov_send_recv() never returns when do_send_recv() returns zero. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 840042901710c2dc1a3ac3e5af9bed449c339701) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13seccomp: add additional asynchronous I/O syscallsPaul Moore1-0/+2
A previous commit, "seccomp: add the asynchronous I/O syscalls to the whitelist", added several asynchronous I/O syscalls but left out the io_submit() and io_cancel() syscalls. This patch corrects this by adding the two missing asynchronous I/O syscalls. Signed-off-by: Paul Moore <pmoore@redhat.com> Reviewed-by: Eduardo Otubo <otubo@linux.vnet.ibm.com> Message-id: 20130715193201.943.4913.stgit@localhost Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 94113bd8a1d9acd05a879bc309cc659ace09e287) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13seccomp: add arch_prctl() to the syscall whitelistPaul Moore1-1/+2
It appears that even a very simple /etc/qemu-ifup configuration can require the arch_prctl() syscall, see the example below: #!/bin/sh /sbin/ifconfig $1 0.0.0.0 up /usr/sbin/brctl addif <switch> $1 Signed-off-by: Paul Moore <pmoore@redhat.com> Reviewed-by: Eduardo Otubo <otubo@linux.vnet.ibm.com> Message-id: 20130718135703.8247.19213.stgit@localhost Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit d2509b667caf482b6f827ff2645cbeb9b39ce29e) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13chardev: fix CHR_EVENT_OPENED events for mux chardevsMichael Roth2-0/+51
As of bd5c51ee6c4f1c79cae5ad2516d711a27b4ea8ec, chardevs no longer use bottom-halves to issue CHR_EVENT_OPENED events. To maintain past semantics, we instead defer the CHR_EVENT_OPENED events toward the end of chardev initialization. For muxes, this isn't good enough, since a range of FEs must be able to attach to the mux prior to any CHR_EVENT_OPENED being issued, else each FE will immediately print it's initial output (prompts, banners, etc.) just prior to us switching to the next FE as part of initialization. The is new and confusing behavior for users, as they'll see output for things like the HMP monitor, even though their the current mux focus may be a guest serial port with potentially no output. We fix this by further deferring CHR_EVENT_OPENED events for FEs associated with muxes until after machine init by flagging mux chardevs with 'explicit_be_open', which suppresses emission of CHR_EVENT_OPENED events until we explicitly set the mux as opened later. Currently, we must defer till after machine init since we potentially associate FEs with muxes as part of realize (for instance, serial_isa_realizefn). Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Message-id: 1375207462-8141-1-git-send-email-mdroth@linux.vnet.ibm.com Cc: qemu-stable@nongnu.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 7b7ab18d0b9769b5f39e663fa55caed461b1202e) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13xhci: fix segfaultGerd Hoffmann1-3/+2
Guest trying to reset a endpoint of a disconnected device resulted in xhci trying to dereference uport while being NULL, thereby crashing qemu. Fix that by adding a check. Drop unused dev variable while touching that code bit. Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 75cc1c1fcba1987bdf3979c4289ab756c2b15742) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13pci-bridge: update mappings for migration/restoreDon Koch3-1/+7
Fix for LP#1187529: Devices on PCI bridge stop working when live-migrated. Update bridge mappings for all PCI bridge devices in get_pci_config_device(). Signed-off-by: Don Koch <dkoch@verizon.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit e78e9ae4a933504d383703870d491615b0261801) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13virtio-console: Use exitfn for virtserialport, tooAndreas Färber1-0/+1
virtconsole and virtserialport are identical in every other aspect except for the distinguishing VirtIOSerialPortClass::is_console field. Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1375313326-14966-1-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 203439ce0a832e36b276f10892846bd91ee836eb) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13qapi: Rename ChardevBackend member "memory" to "ringbuf"Markus Armbruster2-7/+10
Commit 1da48c6 called the new member "memory" after commit 3949e59 standardized "ringbuf". Rename for consistency. However, member name "memory" is visible in QMP since 1.5. It's undocumented just like the driver name. Keep it working anyway. Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1374849874-25531-4-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 3a1da42eb35a67d0dbc899dd571ea386fa11c4dd) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13qemu-char: Register ring buffer driver with correct name "ringbuf"Markus Armbruster1-1/+4
The driver is new in 1.4, with the documented name "ringbuf". However, it's actual name is the completely undocumented "memory". Screwed up in commit 3949e59. Fix code to match documentation. Keep the undocumented name working as an alias for compatibility. Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1374849874-25531-3-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit c11ed9666d69abaf217c8800f299c519b487b7d3) Conflicts: qemu-char.c * removed dependency on command-line specifiable mux (bb6fb7c0) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13xhci: handle USB_RET_IOERRORGerd Hoffmann1-0/+1
https://bugzilla.redhat.com/show_bug.cgi?id=980377 Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit ed60ff024fdb0e7ca9c002af166e10683cf49805) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13dataplane: refuse to start if device is already in useStefan Hajnoczi1-0/+8
Dataplane must check whether a block device is in use before launching the dataplane thread. This is necessary since the thread does not synchronize with the main loop and I/O requests could cause corruption. One example is when a drive is added and a block job is started before hotplugging the virtio-blk-pci adapter. In this case we must not use dataplane mode. Cc: qemu-stable@nongnu.org Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit b0f2027cde31c645524256763672e09eeb204a9a) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13gtk: Fix compiler warning (GTK 3 deprecated function)Stefan Weil1-0/+4
With GTK 3, the function gdk_cursor_unref is deprecated: qemu/ui/gtk.c: In function ‘gd_cursor_define’: qemu/ui/gtk.c:380:5: error: ‘gdk_cursor_unref’ is deprecated (declared at /usr/include/gtk-3.0/gdk/gdkcursor.h:233): Use 'g_object_unref' instead [-Werror=deprecated-declarations] Fix the gcc compiler warning by using conditional compilation. Signed-off-by: Stefan Weil <sw@weilnetz.de> Message-id: 1371391987-10795-1-git-send-email-sw@weilnetz.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 030b4b7debf659dcd6fc66826564285fdce5057d) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13gtk: don't use g_object_unref on GdkCursorAnthony Liguori1-1/+1
It's not a GObject. Cc: Gerd Hoffman <kraxel@redhat.com> Reported-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - Fix summary to agree with code (Peter) (cherry picked from commit 171392406d8e230d62e5ebf4805f71460854b8ec) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13megasas: Legacy command line handling fixAndreas Färber1-1/+4
Only apply legacy command line handling when the device has not been hot-plugged. Propagate failure of legacy command line handling. Cc: qemu-stable@nongnu.org Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> (cherry picked from commit 22d6aa03fd87ba5f219d26bc1810646d0f95842a) Conflicts: hw/scsi/megasas.c * modified to avoid dependency on fancy new upcast macros Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13cpus: Let vm_stop[_force_state]() always flush block devicesKevin Wolf1-3/+6
Even if the VM is already stopped, we cannot assume that all data has already been successfully flushed to disk. The flush during the previous vm_stop() could have failed. Run bdrv_flush_all() unconditionally so that we get an error each time if the block device isn't really flushed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit 594a45ce64dbef1829996403506a1154eb2fd1cc) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13cpus: Add return value for vm_stop()Kevin Wolf3-10/+16
If flushing the block devices fails, return an error. The VM is stopped anyway. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit 5698346391b306c2c84358c68ee897c095d714cc) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-13block: Add return value for bdrv_flush_all()Kevin Wolf2-3/+9
bdrv_flush() can fail, and bdrv_flush_all() should return an error as well if this happens for a block device. It returns the first error return now, but still at least tries to flush the remaining devices even in error cases. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit f0f0fdfeec6c67ad374114ecc4b3e3ccde5e94d2) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12iscsi: assert that sectors are aligned to LUN blocksizePeter Lieven1-0/+20
if the blocksize of an iSCSI LUN is bigger than the BDRV_SECTOR_SIZE it is possible that sector_num or nb_sectors are not correctly aligned. to avoid corruption we fail requests which are misaligned. Signed-off-by: Peter Lieven <pl@kamp.de> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit 91bea4e2bb1a5f7954a3b3a4f2e28e96bd25c458) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12iscsi: remove support for misaligned nb_sectors in aio_readvPeter Lieven1-18/+4
this hask is not working (anymore). support for misaligned offsets should be handled at the block layer. Signed-off-by: Peter Lieven <pl@kamp.de> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit 7e4d5a9f94a0d8485bf63e1f8256e0a0014495ab) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12iscsi: fix -ENOSPC in iscsi_create()Peter Lieven1-0/+1
the -ENOPSC case did not work due to the missing goto. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Peter Lieven <pl@kamp.de> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit d3bda7bc166f40326ba646ee145630bb1b59da96) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12ahci: Fix FLUSH commandKevin Wolf3-1/+17
AHCI couldn't cope with asynchronous commands that aren't doing DMA, it simply wouldn't complete them. Due to the bug fixed in commit f68ec837, FLUSH commands would seem to have completed immediately even if they were still running on the host. After the commit, they would simply hang and never unset the BSY bit, rendering AHCI unusable on any OS sending flushes. This patch adds another callback for the completion of asynchronous commands. This is what AHCI really wants to use for its command completion logic rather than an DMA completion callback. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit a62eaa26c1d6d48fbdc3ac1d32bd1314f5fdc8c9) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12qapi: qapi-commands: fix possible leaks on visitor deallocLuiz Capitulino1-7/+10
In qmp-marshal.c the dealloc visitor calls use the same errp pointer of the input visitor calls. This means that if any of the input visitor calls fails, then the dealloc visitor will return early, before freeing the object's memory. Here's an example, consider this code: int qmp_marshal_input_block_passwd(Monitor *mon, const QDict *qdict, QObject **ret) { [...] char * device = NULL; char * password = NULL; mi = qmp_input_visitor_new_strict(QOBJECT(args)); v = qmp_input_get_visitor(mi); visit_type_str(v, &device, "device", errp); visit_type_str(v, &password, "password", errp); qmp_input_visitor_cleanup(mi); if (error_is_set(errp)) { goto out; } qmp_block_passwd(device, password, errp); out: md = qapi_dealloc_visitor_new(); v = qapi_dealloc_get_visitor(md); visit_type_str(v, &device, "device", errp); visit_type_str(v, &password, "password", errp); qapi_dealloc_visitor_cleanup(md); [...] return 0; } Consider errp != NULL when the out label is reached, we're going to leak device and password. This patch fixes this by always passing errp=NULL for dealloc visitors, meaning that we always try to free them regardless of any previous failure. The above example would then be: out: md = qapi_dealloc_visitor_new(); v = qapi_dealloc_get_visitor(md); visit_type_str(v, &device, "device", NULL); visit_type_str(v, &password, "password", NULL); qapi_dealloc_visitor_cleanup(md); Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> (cherry picked from commit 8f91ad8a1b4702966d91ea58cd90bbde1faea1b3) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12seccomp: add the asynchronous I/O syscalls to the whitelistPaul Moore1-1/+4
In order to enable the asynchronous I/O functionality when using the seccomp sandbox we need to add the associated syscalls to the whitelist. Signed-off-by: Paul Moore <pmoore@redhat.com> Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com> Message-id: 20130529203001.20939.83322.stgit@localhost Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit fd21faadb12669e24eaf0a277de61c24fcde4cac) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12qom: Fix class cast of NULL classesPeter Crosthwaite1-3/+3
Its clear from the implementation that class casting is supposed to work with a NULL class argument. Guard all dereferences of the class argument against NULL accordingly. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-id: 94cd5ba46b74eea289a7e582635820c1c54e66fa.1371546907.git.peter.crosthwaite@xilinx.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 9d6a3d58e4d1431ab3809ff621cfd1f9ec75eef5) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12target-openrisc: Fix typename in openrisc_cpu_class_by_name()Dongxue Zhang1-1/+3
Commit 478032a93d908e59085c1ac56f10979942e7dc4f (target-openrisc: Rename CPU subtypes) suffixed CPU sub-types with "-or32-cpu" but forgot to update openrisc_cpu_class_by_name(), so that it was still looking for the types without suffix. Make target-openrisc running OK by adding the suffix to the model name. This means it is no longer possible to use -cpu or1200-or32-cpu or -cpu any-or32-cpu though. Cc: qemu-stable@nongnu.org Signed-off-by: Dongxue Zhang <elta.era@gmail.com> Tested-by: Jia Liu <proljc@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de> (cherry picked from commit 071b3364e7995036816aa4ebf80ecfa04b1a31de) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12block: fix bdrv_flush() ordering in bdrv_close()Stefan Hajnoczi1-2/+3
Since 80ccf93b we flush the block device during close. The bdrv_drain_all() call should come before bdrv_flush() to ensure guest write requests have completed. Otherwise we may miss pending writes when flushing. Call bdrv_drain_all() again for safety as the final step after bdrv_flush(). This should not be necessary but we can be paranoid here in case bdrv_flush() left I/O pending. Cc: qemu-stable@nongnu.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 58fda173e1156d24e5ff62361774715152188a07) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12target-xtensa: gen_intermediate_code_internal() should be inlinedAndreas Färber1-2/+3
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de> (cherry picked from commit ae06d4988d6799f0bd16f27c2bcf80fa1cd2cfd7) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12target-moxie: gen_intermediate_code_internal() should be inlinedAndreas Färber1-1/+1
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de> (cherry picked from commit 13cccc692818a570d1fb1326c84d3edae68987aa) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12target-microblaze: gen_intermediate_code_internal() should be inlinedAndreas Färber1-1/+1
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de> (cherry picked from commit fd327f48f7e5892318b6dca2c9c6030618f65728) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12target-lm32: gen_intermediate_code_internal() should be inlinedAndreas Färber1-2/+3
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Acked-by: Michael Walle <michael@walle.cc> Signed-off-by: Andreas Färber <afaerber@suse.de> (cherry picked from commit 28014bcab244e968cb03f20384943494bd069ee0) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12target-cris: gen_intermediate_code_internal() should be inlinedAndreas Färber1-1/+1
Cc: qemu-stable@nongnu.org Reported-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de> (cherry picked from commit 6f47ec50db92b4bc77de06661a9e7a3eb538b660) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12qemu-char: Fix ID reuse after chardev-remove for qapi-based initMarkus Armbruster1-0/+1
Commit 2c5f488 introduced qapi-based character device initialization as a new code path in qemu_chr_new_from_opts(). Unfortunately, it failed to store parameter opts in the new chardev. Therefore, qemu_chr_delete() doesn't delete it. Even though the device is gone, its options linger, and any attempt to create another one with the same ID fails. Cc: qemu-stable@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1372339512-28149-1-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 2ea3e2c1e85097c45a882dbc1fbba4a7fdb3ff1c) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12kvmclock: clock should count only if vm is runningMarcelo Tosatti1-34/+30
kvmclock should not count while vm is paused, because: 1) if the vm is paused for long periods, timekeeping math can overflow while converting the (large) clocksource delta to nanoseconds. 2) Users rely on CLOCK_MONOTONIC to count run time, that is, time which OS has been in a runnable state (see CLOCK_BOOTTIME). Change kvmclock driver so as to save clock value when vm transitions from runnable to stopped state, and to restore clock value from stopped to runnable transition. Cc: qemu-stable@nongnu.org Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit 00f4d64ee76e873be881a82d893a591487aa7950) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12raw-posix: Fix /dev/cdrom magic on OS XKevin Wolf1-0/+1
The raw-posix driver has code to provide a /dev/cdrom on OS X even though it doesn't really exist. However, since commit c66a6157 the real filename is dismissed after finding it, so opening /dev/cdrom fails. Put the filename back into the options QDict to make this work again. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit a5c5ea3f60c000bf18c99435439533728a5f34a2) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12migration: do not overwrite zero pagesPeter Lieven1-6/+8
on incoming migration do not memset pages to zero if they already read as zero. this will allocate a new zero page and consume memory unnecessarily. even if we madvise a MADV_DONTNEED later this will only deallocate the memory asynchronously. Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Juan Quintela <quintela@redhat.com> (cherry picked from commit 211ea74022f51164a7729030b28eec90b6c99a08) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12Revert "migration: do not sent zero pages in bulk stage"Peter Lieven1-9/+4
Not sending zero pages breaks migration if a page is zero at the source but not at the destination. This can e.g. happen if different BIOS versions are used at source and destination. It has also been reported that migration on pseries is completely broken with this patch. This effectively reverts commit f1c72795af573b24a7da5eb52375c9aba8a37972. Conflicts: arch_init.c Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Juan Quintela <quintela@redhat.com> (cherry picked from commit 9ef051e5536b6368a1076046ec6c4ec4ac12b5c6) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-08-12vmdk: remove wrong calculation of relative pathFam Zheng1-43/+1
When creating image with backing file, the driver tries to calculate the relative path from created image file to backing file, but the path computation is incorrect. e.g.: $ qemu-img create -f vmdk -b vmdk-data-disk.vmdk vmdk-data-snapshot1 Formatting 'vmdk-data-snapshot1', fmt=vmdk size=10737418240 backing_file='vmdk-data-disk.vmdk' compat6=off zeroed_grain=off $ qemu-img info vmdk-data-snapshot1 image: vmdk-data-snapshot1 file format: vmdk virtual size: 10G (10737418240 bytes) disk size: 12K -> backing file: disk.vmdk The common part in file names, "vmdk-data-", is incorrectly forgotten by relative_path(). As the VMDK specification has no restriction on parentNameHint to be relative path, we simply remove this by using the backing_file option. Cc: qemu-stable@nongnu.org Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 8ed610a1c983dd2ed1eed8841036af55751d115f) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>