summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-06-17tcg-ppc64: Fix add2_i64Anton Blanchard1-7/+7
add2_i64 was adding the lower double word to the upper double word of each input. Fix this so we add the lower double words, then the upper double words with carry propagation. Cc: qemu-stable@nongnu.org Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Richard Henderson <rth@twiddle.net> (cherry picked from commit 84247357104044b8c4ec4a634e84769f432cbe52) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-17tcg-ppc64: bswap64 rotates output 32 bitsAnton Blanchard1-2/+0
If our input and output is in the same register, bswap64 tries to undo a rotate of the input. This just ends up rotating the output. Cc: qemu-stable@nongnu.org Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Richard Henderson <rth@twiddle.net> (cherry picked from commit 82e0f9170ac9307de4fc15bfb4d12d5534550322) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-17tcg-ppc64: Fix RLDCL opcodeAnton Blanchard1-5/+6
The rldcl instruction doesn't have an sh field, so the minor opcode is shifted 1 bit. We were using the XO30 macro which shifted the minor opcode 2 bits. Remove XO30 and add MD30 and MDS30 macros which match the Power ISA categories. Cc: qemu-stable@nongnu.org Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Richard Henderson <rth@twiddle.net> (cherry picked from commit 8a94cfb05ea9a8991c832236b4174d354025a7b7) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-17ivshmem: add missing error exit(2)Stefan Hajnoczi1-0/+1
If the user fails to specify 'chardev' or 'shm' then we cannot continue. Exit right away so that we don't invoke shm_open(3) with a NULL pointer. It would be nice to replace exit(1) with error returns in the PCI device .init() function, but leave that for another patch since exit(1) is currently used elsewhere. Spotted by Coverity. Cc: Cam Macdonell <cam@cs.ualberta.ca> Cc: qemu-stable@nongnu.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> (cherry picked from commit baefb8bf8e4a708c601bbab898a6039cd9cd12e3) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-17Makefile: Install qemu-img and qemu-nbd man pages only if builtAndreas Färber1-1/+4
When splitting openSUSE's qemu and qemu-linux-user packages we noticed that for linux-user-only builds unrelated man pages got installed. It's surely possible to delete them before packaging, but not installing them in the first place seems more logical. Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> (cherry picked from commit 8a3e8f7fd8144343f6c83e810b988c1e8a99d50a) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-17tap: fix NULL dereference when passing invalid parameters to tapJason Wang1-6/+12
This patch forbid the following invalid parameters to tap: 1) fd and vhostfds were specified but vhostfd were not specified 2) vhostfds were specified but fds were not specified 3) fds and vhostfd were specified For 1 and 2, net_init_tap_one() will still pass NULL as vhostfdname to monitor_handle_fd_param(), which may crash the qemu. Also remove the unnecessary has_fd check. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Stefan Hajnoczi <shajnocz@redhat.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit c87826a878be05208c3906eb9d5e1f37cff5e98e) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-14create qemu_openpty_raw() helper function and move it to a separate fileMichael Tokarev5-95/+146
In two places qemu uses openpty() which is very system-dependent, and in both places the pty is switched to raw mode as well. Make a wrapper function which does both steps, and move all the system-dependent complexity into a separate file, together with static/local implementations of openpty() and cfmakeraw() from qemu-char.c. It is in a separate file, not part of oslib-posix.c, because openpty() often resides in -lutil which is not linked to every program qemu builds. This change removes #including of <pty.h>, <termios.h> and other rather specific system headers out of qemu-common.h, which isn't a place for such specific headers really. This version has been verified to build correctly on Linux, OpenBSD, FreeBSD and OpenIndiana. On the latter it lets qemu to be built with gtk gui which were not possible there due to missing openpty() and cfmakeraw(). Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Tested-by: Andreas Färber <andreas.faerber@web.de> (cherry picked from commit 4efeabbbe8441cc327052304976c7b9b86309d72) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-13blockdev: reset werror/rerror on drive_delStefan Hajnoczi2-0/+6
Paolo Bonzini <pbonzini@redhat.com> suggested the following test case: 1. Launch a guest and wait at the GRUB boot menu: qemu-system-x86_64 -enable-kvm -m 1024 \ -drive if=none,cache=none,file=test.img,id=foo,werror=stop,rerror=stop -device virtio-blk-pci,drive=foo,id=virtio0,addr=4 2. Hot unplug the device: (qemu) drive_del foo 3. Select the first boot menu entry Without this patch the guest pauses due to ENOMEDIUM. The guest is stuck in a continuous pause loop since the I/O request is retried and fails immediately again when the guest is resumed. With this patch the error is reported to the guest. Note that this scenario actually happens sometimes during libvirt disk hot unplug, where device_del is followed by drive_del. I/O may still be submitted to the drive after drive_del if the guest does not process the PCI hot unplug notification. Reported-by: Dafna Ron <dron@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 293c51a6ee369228633a8428ab689f14c045ff98) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-12q35: set fw_nameMichael S. Tsirkin1-0/+1
PCI host bridges need to set fw_name to be discoverable by bios for boot device selection. In particular, seabios expects root device to be called "/pci/@i0cf8", so let's set it up like that for Q35. Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Amos Kong <akong@redhat.com> (cherry picked from commit 68c0e134a090666246b467deaf9046e573b089f2) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-12target-i386: Fix aflag logic for CODE64 and the 0x67 prefixRichard Henderson1-15/+15
The code reorganization in commit 4a6fd938 broke handling of PREFIX_ADR. While fixing this, tidy and comment the code so that it's more obvious what's going on in setting both aflag and dflag. The TARGET_X86_64 ifdef can be eliminated because CODE64 expands to the constant zero when TARGET_X86_64 is undefined. Cc: Paolo Bonzini <pbonzini@redhat.com> Reported-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1369855851-21400-1-git-send-email-rth@twiddle.net Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit dec3fc9657e0682637de4d5a29d947284d01985c) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-12qemu-char: don't issue CHR_EVENT_OPEN in a BHMichael Roth7-24/+26
When CHR_EVENT_OPENED was initially added, it was CHR_EVENT_RESET, and it was issued as a bottom-half: 86e94dea5b740dad65446c857f6959eae43e0ba6 Which we basically used to print out a greeting/prompt for the monitor. AFAICT the only reason this was ever done in a BH was because in some cases we'd modify the chr_write handler for a new chardev backend *after* the site where we issued the reset (see: 86e94d:qemu_chr_open_stdio()) At some point this event was renamed to CHR_EVENT_OPENED, and we've maintained the use of this BH ever since. However, due to 9f939df955a4152aad69a19a77e0898631bb2c18, we schedule the BH via g_idle_add(), which is causing events to sometimes be delivered after we've already begun processing data from backends, leading to: known bugs: QMP: session negotation resets with OPENED event, in some cases this is causing new sessions to get sporadically reset potential bugs: hw/usb/redirect.c: can_read handler checks for dev->parser != NULL, which may be true if CLOSED BH has not been executed yet. In the past, OPENED quiesced outstanding CLOSED events prior to us reading client data. If it's delayed, our check may allow reads to occur even though we haven't processed the OPENED event yet, and when we do finally get the OPENED event, our state may get reset. qtest.c: can begin session before OPENED event is processed, leading to a spurious reset of the system and irq_levels gdbstub.c: may start a gdb session prior to the machine being paused To fix these, let's just drop the BH. Since the initial reasoning for using it still applies to an extent, work around that by deferring the delivery of CHR_EVENT_OPENED until after the chardevs have been fully initialized, toward the end of qmp_chardev_add() (or some cases, qemu_chr_new_from_opts()). This defers delivery long enough that we can be assured a CharDriverState is fully initialized before CHR_EVENT_OPENED is sent. Also, rather than requiring each chardev to do an explicit open, do it automatically, and allow the small few who don't desire such behavior to suppress the OPENED-on-init behavior by setting a 'explicit_be_open' flag. We additionally add missing OPENED events for stdio backends on w32, which were previously not being issued, causing us to not recieve the banner and initial prompts for qmp/hmp. Reported-by: Stefan Priebe <s.priebe@profihost.ag> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Message-id: 1370636393-21044-1-git-send-email-mdroth@linux.vnet.ibm.com Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit bd5c51ee6c4f1c79cae5ad2516d711a27b4ea8ec) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11xilinx_axidma: Do not set DMA .notify to NULL after notifyWendy Liang1-1/+2
If a stream notify function is not ready, it may re-populate the notify call- back to indicate it should be re-polled later. This break in this usage, as immediately following the notify() call, .notify is set to NULL. reverse the ordering of the notify call and NULL assignment accordingly. [PC: Reworked commit message] Signed-off-by: Wendy Liang <jliang@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> (cherry picked from commit 4f293bd6e53739e089f33b458f70a9c4ac136b92) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11virtio-ccw: Fix unsetting of indicators.Cornelia Huck1-4/+4
Interpretation of the ccws to register (configuration) indicators contained a thinko: We want to disallow reading from 0, but setting the indicator pointer to 0 is fine. Let's fix the handling for CCW_CMD_SET{,_CONF}_IND. Cc: qemu-stable@nongnu.org Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> (cherry picked from commit d1db1fa8dfcea9c62643f624f2a07d2fd375ce45) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11s390x/css: Fix concurrent sense.Cornelia Huck1-1/+1
Fix an off-by-one error when indicating availablity of concurrent sense data. Cc: qemu-stable@nongnu.org Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> (cherry picked from commit 8312976e73fce9689ab831c1da565ec413680cff) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11ui/gtk.c: Fix *BSD build of Gtk+ UIBrad Smith1-0/+1
Fix the build of the Gtk+ UI on *BSD systems. Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-id: 20130521161324.GA29977@rox.home.comstyle.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 17bf9735dd5a46d829cfb175703c6a2c254a9aa2) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11vmxnet3: fix NICState cleanupStefan Hajnoczi1-1/+1
Use qemu_del_nic() instead of qemu_del_net_client() to correctly free the entire NICState. Cc: qemu-stable@nongnu.org Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit 3ffee3cd5fb29de2115bdcbde0a02f47ce69a24c) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11Fix usage of USB_DEV_FLAG_IS_HOST flag.Michael Marineau1-1/+1
USB_DEV_FLAG_IS_HOST is the bit number, not value. Booting with a "Fitbit Base Station" USB dongle was triggering this assert. Signed-off-by: Michael Marineau <mike@marineau.org> Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 756335292f2b46775992c314cc70b54480a46d26) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11host-libusb: Correct test for USB packet stateEd Maste1-1/+1
USB_RET_ASYNC is -6, so inflight was always false. Signed-off-by: Ed Maste <emaste@freebsd.org> Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 45ec267160307ce2ca7494d942589ba222b29479) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11qdev: fix get_fw_dev_path to support to add nothing to fw_dev_pathAmos Kong2-1/+15
Recent virtio refactoring in QEMU made virtio-bus become the parent bus of scsi-bus, and virtio-bus doesn't have get_fw_dev_path implementation, typename will be added to fw_dev_path by default, the new fw_dev_path could not be identified by seabios. It causes that bootindex parameter of scsi device doesn't work. This patch implements get_fw_dev_path() in BusClass, it will be called if bus doesn't implement the method, tyename will be added to fw_dev_path. If the implemented method returns NULL, nothing will be added to fw_dev_path. It also implements virtio_bus_get_fw_dev_path() to return NULL. Then QEMU will still pass original style of fw_dev_path to seabios. Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-id: 1369814202-10346-1-git-send-email-akong@redhat.com -- v2: only add nothing to fw_dev_path when get_fw_dev_path() is implemented and returns NULL. then it will not effect other devices don't have get_fw_dev_path() implementation. v3: implement default get_fw_dev_path() in BusClass Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit bbfa18fca4e44ff9c23d36b50d8a998af9c9e9fc) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11do not check pointers after dereferencing themPaolo Bonzini2-5/+5
Two instances, both spotted by Coverity. In one, two blocks were swapped. In the other, the check is not needed anymore. Cc: qemu-stable@nongnu.org Cc: qemu-trivial@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> (cherry picked from commit a4cc73d629d43c8a4d171d043ff229a959df3ca6) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11xen: start PCI hole at 0xe0000000 (same as pc_init1 and qemu-xen-traditional)Stefano Stabellini3-9/+12
We are currently setting the PCI hole to start at HVM_BELOW_4G_RAM_END, that is 0xf0000000. Start the PCI hole at 0xe0000000 instead, that is the same value used by pc_init1 and qemu-xen-traditional. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> CC: qemu-stable@nongnu.org (cherry picked from commit 9f24a8030a70ea4954b5b8c48f606012f086f65f) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11Remove OSS support for OpenBSDBrad Smith2-7/+2
Remove the OSS support for OpenBSD. The OSS API has not been usable for quite some time. Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit 4f6ab397b60615d2da77bff4f32666be9ac2e949) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11target-i386: fix abort on bad PML4E/PDPTE/PDE/PTE addressesLuiz Capitulino1-4/+6
The code used to walk IA-32e page-tables, and possibly PAE page-tables, uses the bit mask ~0xfff to get the next PML4E/PDPTE/PDE/PTE address. However, as we use a uint64_t to store the resulting address, that mask gets expanded to 0xfffffffffffff000 which not only ends up selecting reserved bits but also selects the XD bit (execute-disable) which happens to be enabled by Windows 8, causing qemu_get_ram_ptr() to abort. This commit fixes that problem by replacing ~0xfff by a correct mask that only selects the address bit range (ie. bits 51:12). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit fbc2ed9518efcdcdcbf0adb9539c17a65addd20a) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11update seabios to release 1.7.2.2Gerd Hoffmann2-0/+0
git shortlog from 1.7.2.1 Asias He (2): virtio-scsi: Pack struct virtio_scsi_{req_cmd,resp_cmd} virtio-scsi: Set _DRIVER_OK flag before scsi target scanning Kevin O'Connor (1): Cache boot-fail-wait to avoid romfile access after POST. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 6683d7bc2759e9da8b5c4907a9de85d500933ffb) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11Revert "roms: switch oldnoconfig to olddefconfig"Gerd Hoffmann1-1/+1
This reverts commit a5519b42cfd6c00e9f8b31c5aad7682e7a9f1181. Breaks "make bios" in roms/ as the kconfig version in seabios doesn't support olddefconfig. Must have been be totally untested. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 19cd090e17b293b49eec59346df94a668f5d2438) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11ide: Set BSY bit during FLUSHAndreas Färber1-0/+1
The implementation of the ATA FLUSH command invokes a flush at the block layer, which may on raw files on POSIX entail a synchronous fdatasync(). This may in some cases take so long that the SLES 11 SP1 guest driver reports I/O errors and filesystems get corrupted or remounted read-only. Avoid this by setting BUSY_STAT, so that the guest is made aware we are in the middle of an operation and no ATA commands are attempted to be processed concurrently. Addresses BNC#637297. Suggested-by: Gonglei (Arei) <arei.gonglei@huawei.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit f68ec8379e88502b4841a110c070e9b118d3151c) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11chardev: fix "info chardev" outputGerd Hoffmann1-0/+3
Fill unset CharDriverState->filename with the backend name, so 'info chardev' will return at least the chardev type. Don't touch it in case the chardev init function filled it already, like the socket+pty chardevs do for example. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 60d95386abf1f5f37ded6a812d12ac458df2491b) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11xen_machine_pv: do not create a dummy CPU in machine->initStefano Stabellini1-16/+0
This fixes a regression introduced by: commit 62fc403f11523169eb4264de31279745f48e3ecc Author: Igor Mammedov <imammedo@redhat.com> Date: Mon Apr 29 18:54:13 2013 +0200 target-i386: Attach ICC bus to CPU on its creation X86CPU should have parent bus so it could provide bus for child APIC. The commit makes it mandatory to pass a valid ICC bus to cpu_x86_create, but cpu_x86_init just passes NULL to it. xen_machine_pv uses cpu_x86_init, therefore it has been broken. This patch fixes the problem by removing the dummy CPU creation altogether from xen_init_pv, relying on the fact that QEMU can now cope with a machine without an emulated CPU. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Andreas Färber <afaerber@suse.de> CC: imammedo@redhat.com CC: qemu-stable@nongnu.org (cherry picked from commit 58ee9b0ae05d81c74d6869a25ce4263fc22ed809) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11main_loop: do not set nonblocking if xen_enabled()Stefano Stabellini1-1/+1
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> CC: qemu-stable@nongnu.org (cherry picked from commit a7d4207d378069a5bb3175a131e8fdedd39ef97d) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11xen: simplify xen_enabledStefano Stabellini1-4/+0
No need for preprocessor conditionals in xen_enabled: xen_allowed is always defined. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> CC: qemu-stable@nongnu.org (cherry picked from commit 49fa9881b2358e390e9e9466ddde74e995927efa) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11qom/object: Don't poll cast cache for NULL objectsPeter Crosthwaite1-2/+2
object_dynamic_cast_assert used to be tolerant of NULL objects and not assert. It's clear from the implementation that this is the expected behavior. The preceding check of the cast cache dereferences obj however causing a segfault. Fix by conditionalizing the cast cache logic on obj being non-null. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Message-id: 8e2bef6a55753869c50bfa32226f7fcf0439ca62.1369183592.git.peter.crosthwaite@xilinx.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 95916abcf428fb03644468c7fbce64356c6483c0) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11rtl8139: flush queued packets when RxBufPtr is writtenStefan Hajnoczi1-0/+3
Net queues support efficient "receive disable". For example, tap's file descriptor will not be polled while its peer has receive disabled. This saves CPU cycles for needlessly copying and then dropping packets which the peer cannot receive. rtl8139 is missing the qemu_flush_queued_packets() call that wakes the queue up when receive becomes possible again. As a result, the Windows 7 guest driver reaches a state where the rtl8139 cannot receive packets. The driver has actually refilled the receive buffer but we never resume reception. The bug can be reproduced by running a large FTP 'get' inside a Windows 7 guest: $ qemu -netdev tap,id=tap0,... -device rtl8139,netdev=tap0 The Linux guest driver does not trigger the bug, probably due to a different buffer management strategy. Reported-by: Oliver Francke <oliver.francke@filoo.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit 00b7ade807b5ce6779ddd86ce29c5521ec5c529a) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11hw/9pfs: use O_NOFOLLOW for mapped readlink operationAneesh Kumar K.V1-1/+1
With mapped security models like mapped-xattr and mapped-file, we save the symlink target as file contents. Now if we ever expose a normal directory with mapped security model and find real symlinks in export path, never follow them and return proper error. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> (cherry picked from commit aed858ce10ef09c7bdf03f73e75e772f567c74cd) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-06-11hw/9pfs: Fix segfault with 9p2000.uAneesh Kumar K.V1-1/+1
When guest tries to chmod a block or char device file over 9pfs, the qemu process segfaults. With 9p2000.u protocol we use wstat to change mode bits and client don't send extension information for chmod. We need to check for size field to check whether extension info is present or not. Reported-by: Michael Tokarev <mjt@tls.msk.ru> Acked-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> (cherry picked from commit c7e587b73ebac05943df78f5f37d80d32ff47d3d) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2013-05-20Update version for 1.5.0 release.Anthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20osdep: fix qemu_anon_ram_free trace (+ fix compilation on 32 bit hosts)Hervé Poussineau1-1/+1
Commit e7a09b92b70786f9e8c5fbf787e0248c6ebbe707 added a trace at each memory freeing, but unfortunately inverted size and pointer when printing them. Fix trace. This also led to a compilation error on 32 bit hosts: In file included from include/trace.h:4:0, from trace/generated-events.c:3: ./trace/generated-tracers.h: In function ‘trace_qemu_anon_ram_free’: ./trace/generated-tracers.h:64:9: error: format ‘%zu’ expects argument of type ‘size_t’, but argument 3 has type ‘void *’ [-Werror=format] ./trace/generated-tracers.h:64:9: error: format ‘%p’ expects argument of type ‘void *’, but argument 4 has type ‘size_t’ [-Werror=format] Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Message-id: 1369045989-14016-1-git-send-email-hpoussin@reactos.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20Rename hexdump to avoid FreeBSD libutil conflictEd Maste4-5/+5
On FreeBSD libutil is used for openpty(), but it also provides a hexdump() which conflicts with QEMU's. Signed-off-by: Ed Maste <emaste@freebsd.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1368718348-15199-1-git-send-email-emaste@freebsd.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20vl: new runstate transition: RUN_STATE_GUEST_PANICKED -> ↵Hu Tao1-0/+1
RUN_STATE_FINISH_MIGRATE This fixes a problem that after guest panic happens, virsh dump without --memory-only fails: ERROR: invalid runstate transition: 'guest-panicked' -> 'finish-migrate' Reported-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1369046780-17498-1-git-send-email-pbonzini@redhat.com Cc: qemu-stable@nongnu.org Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20chardev: Make consistent with udp device for new qapi backendLei Li2-9/+9
When register and open a chardev udp, the backend name should be udp not dgram, and we do not have backend dgram in the chardev list. This patch makes the new qapi udp backend consistent with the original udp device. Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com> Message-id: 1369032665-18159-2-git-send-email-lilei@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-20ide/macio: fix wrong opaque with TRIM supportAurelien Jarno1-1/+1
Commit 215e47b9 enabled TRIM by default, which revealed a bug in TRIM support for the IDE macio emulation driver, introduced in d353fb72. The call to dma_bdrv_io() is using a wrong opaque of type IDEState instead of DBDMA_io. This patch fixes that. Fixes LP#1179104 Reported-by: Michael Tokarev <mjt@tls.msk.ru> Tested-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-19target-mips: set carry bit correctly in DSPControl registerPetar Jovanovic1-3/+4
First we need to clear the bit and then we set the given value. Instruction ADDSC sets the bit and instruction ADDWC uses this bit. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-19target-mips: fix EXTPDP and setting up pos field in the DSPControl regPetar Jovanovic2-5/+23
This change makes sure that modifications of pos field in the DSPControl register do not trash other bits in the register. This bug can be triggered with the additional test case in mips32-dsp/extpdp.c in this commit. In addition to this, this change corrects incorrect calculation of the mask for EXTPDP. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-17target-mips: fix incorrect behaviour for EXTPPetar Jovanovic2-2/+19
The mask for EXTP instruction when size=31 has not been correctly calculated. The test (mips32-dsp/extp.c) has been extended to include the case that triggers the issue. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-17Update version for 1.5.0-rc3 releaseAnthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-17Merge remote-tracking branch 'mdroth/qga-pull-2013-05-13' into stagingAnthony Liguori1-6/+19
* mdroth/qga-pull-2013-05-13: qga: unlink just created guest-file if fchmod() or fdopen() fails on it qga: distinguish binary modes in "guest_file_open_modes" map Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-17Revert "migration: don't account sleep time for calculating bandwidth"Michael Roth1-4/+1
This reverts commit 7161082c8d8cf167c508976887a0a63f4db92b51. Reverting this patch fixes a divide-by-zero error in qemu that can be fairly reliably triggered by doing block migration. In this case, the configuration/error was: source: temp/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -L temp-bios -M pc-i440fx-1.4 -m 512M -kernel boot/vmlinuz-x86_64 -initrd boot/test-initramfs-x86_64.img.gz -vga std -append seed=1234 -drive file=disk1.img,if=virtio -drive file=disk2.img,if=virtio -device virtio-net-pci,netdev=net0 -netdev user,id=net0 -monitor unix:/tmp/vm-hmp.sock,server,nowait -qmp unix:/tmp/vm-qmp.sock,server,nowait -vnc :100 16837 Floating point exception(core dumped) target: temp/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -L temp-bios -M pc-i440fx-1.4 -m 512M -kernel boot/vmlinuz-x86_64 -initrd boot/test-initramfs-x86_64.img.gz -vga std -append seed=1234 -drive file=target_disk1.img,if=virtio -drive file=target_disk2.img,if=virtio -device virtio-net-pci,netdev=net0 -netdev user,id=net0 -incoming unix:/tmp/migrate.sock -monitor unix:/tmp/vm-hmp-incoming.sock,server,nowait -qmp unix:/tmp/vm-qmp-incoming.sock,server,nowait -vnc :101 Receiving block device images 20 % 21 % load of migration failed This revert potentially re-introduces a bug that was present in 1.4, but fixes a prevalent issue with block migration so we should revert it for now and take an updated patch later. Conflicts: migration.c * fixed up to remove logic introduced in 7161082c while leaving changes in HEAD intact Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Message-id: 1368739544-31021-1-git-send-email-mdroth@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-16main-loop: partial revert of 5e3bc73Stefan Hajnoczi1-18/+14
This patch reverts part of 5e3bc735d93dd23f074b5116fd11e1ad8cd4962f. Paolo Bonzini wrote this patch and commented: "WSAEventSelect is edge-triggered and the event will not be signaled if the socket handler does not consume all the data in the socket buffer." Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1368718561-7816-3-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-16main-loop: narrow win32 pollfds_fill() event bitmasksStefan Hajnoczi1-4/+4
pollfds_fill() and pollfds_poll() translate GPollFD to rfds/wfds/xfds for sockets on win32. select(2) is the underlying system call which is used to monitor sockets for activity. Currently file descriptors that monitor G_IO_ERR will be included in both rfds and wfds. As a result, select(2) will report writability on file descriptors where we only really wanted to monitor readability (with errors). slirp_pollfds_poll() hit this issue: UDP sockets are blocking sockets so we hang in sorecvfrom() when G_IO_ERR is set due to the socket being writable (we only wanted to check for readability). This patch fixes the slirp_pollfds_poll() hang. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1368718561-7816-2-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-16virtio: add virtio_bus_get_dev_path.KONRAD Frederic1-0/+14
This adds virtio_bus_get_dev_path to fix migration id string which is wrong since the virtio refactoring. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1368723967-21050-1-git-send-email-fred.konrad@greensocs.com Cc: mdroth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-15Update version for 1.5.0-rc2 releaseAnthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>