summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-09-11convert file+pipe chardevs to QemuOpts.Gerd Hoffmann2-15/+39
new cmd line syntax: -chardev file,id=name,path=/path/to/file -chardev pipe,id=name,path=/path/to/pipe Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11switch chardev to QemuOpts: infrastructure, null deviceGerd Hoffmann6-4/+93
start switching chardevs to QemuOpts. This patch adds the infrastructure and converts the null device. The patch brings two new functions: qemu_chr_open_opts() same as qemu_chr_open(), but uses QemuOpts instead of a option char string. qemu_chr_parse_compat() accepts a traditional chardev option string, returns the corresponding QemuOpts instance, to handle backward compatibility. The patch also adds a new -chardev switch which can be used to create named+unconnected chardevs, like this: -chardev null,id=test This uses the new qemu_chr_open_opts. Thus with this patch alone only the null device works. The other devices will follow ... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11qemu-option.h include protectorsGerd Hoffmann1-0/+5
qemu-option.h has no protection against including it twice. This patch adds the usual "#ifndef header" bits. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11QemuOpts: split option parser into two functions.Gerd Hoffmann2-17/+30
looking for id= and creating a new QemuOpts instance is splitted from the actual option parser code now, so the parser can be called from other contexts too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11qdev: Fix i6300 upcastMarkus Armbruster1-4/+4
Use DO_UPCAST() instead of container_of() to go from PCIDevice to I6300State. This ensures that PCIDevice is the first member of struct I6300State. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11VirtIO: Fix QEMU crash during Windows PNP testsYan Vugenfirer1-2/+12
Hello, In some cases bus driver can deassert "bus master" bit in PCI command register. The driver will no longer be able to update related registers in the device. Eventually it will cause QEMU to exit in "virtqueue_num_heads" function. Attached path that fixes the described issue. Best regards, Yan Vugenfirer. >From 3fdafbdfad676ec8479dc073cff70bf356868bfe Mon Sep 17 00:00:00 2001 From: Yan Vugenfirer <yvugenfi@redhat.com> Date: Tue, 8 Sep 2009 10:08:14 -0400 Subject: [PATCH] VirtIO: Fix QEMU crash during Windows PNP tests Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11virtio-blk: add volatile writecache featureChristoph Hellwig2-1/+27
Add a new VIRTIO_BLK_F_WCACHE feature to virtio-blk to indicate that we have a volatile write cache that needs controlled flushing. Implement a VIRTIO_BLK_T_FLUSH operation to flush it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11ide: use bdrv_aio_flushChristoph Hellwig1-3/+13
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11block: add aio_flush operationChristoph Hellwig6-3/+80
Instead stalling the VCPU while serving a cache flush try to do it asynchronously. Use our good old helper thread pool to issue an asynchronous fdatasync for raw-posix. Note that while Linux AIO implements a fdatasync operation it is not useful for us because it isn't actually implement in asynchronous fashion. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11block: use fdatasync instead of fsync if possibleChristoph Hellwig4-2/+19
If we are flushing the caches for our image files we only care about the data (including the metadata required for accessing it) but not things like timestamp updates. So try to use fdatasync instead of fsync to implement the flush operations. Unfortunately many operating systems still do not support fdatasync, so we add a qemu_fdatasync wrapper that uses fdatasync if available as per the _POSIX_SYNCHRONIZED_IO feature macro or fsync otherwise. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11block: add enable_write_cache flagChristoph Hellwig5-3/+27
Add a enable_write_cache flag in the block driver state, and use it to decide if we claim to have a volatile write cache that needs controlled flushing from the guest. The flag is off if cache=writethrough is defined because O_DSYNC guarantees that every write goes to stable storage, and it is on for cache=none and cache=writeback. Both scsi-disk and ide now use the new flage, changing from their defaults of always off (ide) or always on (scsi-disk). Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11qemu: init all queues to NO_VECTOR valueMichael S. Tsirkin1-0/+3
initialize vectors for all vqs to VIRTIO_NO_VECTOR rather than 0 which is a valid vector. This fixes migration which happened before driver was loaded. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reported-by: Amit Shah <amit.shah@redhat.com> Tested-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11qemu: make virtio-blk PCI compliant by defaultMichael S. Tsirkin1-4/+8
commit bf011293faaa7f87e4de83185931e7411b794128 made virtio-blk-pci not PCI-compliant, since it makes region 0 (which is an i/o region) size > 256, and, since PCI 2.1, i/o regions are limited to 256 bytes size. When the ATA serial number feature is off, which is the default, make the device spec compliant again, by making region 0 smaller. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reported-by: Vadim Rozenfeld <vrozenfe@redhat.com> Tested-by: Vadim Rozenfeld <vrozenfe@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11usb-linux.c: fix buffer overflowJim Paris1-2/+10
In usb-linux.c:usb_host_handle_control, we pass a 1024-byte buffer and length to the kernel. However, the length was provided by the caller of dev->handle_packet, and is not checked, so the kernel might provide too much data and overflow our buffer. For example, hw/usb-uhci.c could set the length to 2047. hw/usb-ohci.c looks like it might go up to 4096 or 8192. This causes a qemu crash, as reported here: http://www.mail-archive.com/kvm@vger.kernel.org/msg18447.html This patch increases the usb-linux.c buffer size to 2048 to fix the specific device reported, and adds a check to avoid the overflow in any case. Signed-off-by: Jim Paris <jim@jtan.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11Fix conditional compilation (MIPS host)Stefan Weil1-1/+1
Compilation for MIPS host (not part of official QEMU) checks __mips_isa_rev which is not always defined. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11virtio-blk: Use bdrv_aio_multiwriteKevin Wolf1-8/+42
It is quite common for virtio-blk to submit more than one write request in a row to the qemu block layer. Use bdrv_aio_multiwrite to allow block drivers to optimize its handling of the requests. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11Add bdrv_aio_multiwriteKevin Wolf5-0/+230
One performance problem of qcow2 during the initial image growth are sequential writes that are not cluster aligned. In this case, when a first requests requires to allocate a new cluster but writes only to the first couple of sectors in that cluster, the rest of the cluster is zeroed - just to be overwritten by the following second request that fills up the cluster. Let's try to merge sequential write requests to the same cluster, so we can avoid to write the zero padding to the disk in the first place. As a nice side effect, also other formats take advantage of dealing with less and larger requests. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11Revert "don't call cpu_sychronize_state from reset handlers"Anthony Liguori2-6/+3
This reverts commit 733318ea9c6d846a6a047b87619e7d9d6e9707d1. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11microblaze: Trap if QEMU finds an unknown insns.Edgar E. Iglesias1-0/+6
If PVR settings enable illegal insn trap, trap when QEMU finds an insn it knows nothing about. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-09-11microblaze: Correct prio between MMU and unaligned exceptions.Edgar E. Iglesias1-6/+25
The microblaze gives MMU faults priority. For stores we still have a flaw that the value leaks to memory in the case of an unaligned exception. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-09-11microblaze: HW Exception fixes.Edgar E. Iglesias2-19/+21
* Correct PVR checks for masking off individual exceptions. * Correct FPU exception code. * Set EAR on unaligned and unassigned exceptions. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2009-09-11Update OpenBIOS images to r577Aurelien Jarno1-0/+0
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-09-11X86_64: Use proper jumps/calls when displacement exceeds +-2Gmalc1-12/+19
Signed-off-by: malc <av1474@comtv.ru>
2009-09-10Remove bit-rotten threshold handlingmalc1-13/+2
Thanks to Toshiya Takeda for bringing up an unrelated issue which led to this. Signed-off-by: malc <av1474@comtv.ru>
2009-09-10F_DUPFD_CLOEXEC is not universally availablemalc1-0/+2
The same issue (and the same patch to the byte) was experienced/proposed by Vince Weaver. Signed-off-by: malc <av1474@comtv.ru>
2009-09-10Add information w.r.t default GUS IRQ assigmentmalc1-0/+14
2009-09-10Fix formattingmalc1-5/+5
2009-09-10Fix formatting, get rid of conf and fix descriptionmalc1-14/+7
2009-09-10Fix formatting and and description fieldmalc1-4/+5
2009-09-10qdev/isa: convert real time clockGerd Hoffmann7-18/+38
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev/isa: finish pckbd conversionGerd Hoffmann3-24/+4
drop old init path and switch remaining users to isa_create_simple(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev/isa: convert ne2000Gerd Hoffmann8-93/+170
Also split the isa bits into a separate source file, so we don't drag in a dependency for isa-bus.o for machines which want ne2k_pci only. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev/isa: convert gravis ultrasoundGerd Hoffmann2-28/+51
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev/isa: convert cs4231a sound cardGerd Hoffmann1-13/+33
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev/isa: convert soundblasterGerd Hoffmann1-24/+39
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev: add isa_create() functionGerd Hoffmann2-2/+14
Like isa_create_simple, but doesn't call qdev_init, so one can set properties after creating and before initializing the device. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev: tag isabus-bridge as no-userGerd Hoffmann1-0/+1
isabus-bridge isn't supposed to be added via -device ... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev: simplify isa irq assignmentsGerd Hoffmann7-39/+21
isa-bus owns the isa irqs now, so it can hand them out directly. There is no need for the separate isa_connect_irqs step, drop it. Also hard-code isa interrupts which can't be configured anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev: drop iobase properties from isa busGerd Hoffmann9-34/+23
Lot of ISA devices work at fixed addresses, so having iobase as bus property doesn't make much sense. Devices which can have different iobases will get a device property. Also simply hard-code stuff which can't be configured anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10qdev: add property type for 32bit signed integers.Gerd Hoffmann2-0/+33
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10isapc: pick a more sane default cpu for such old hardware.Gerd Hoffmann1-0/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10isapc: Fix irq routingGerd Hoffmann1-1/+2
Only send irqs to ioapic in case we have one. Fixes qemu segfault. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-09-10Allow to unscale the output window with a Ctrl-Alt-u hotkeymalc2-0/+9
Signed-off-by: malc <av1474@comtv.ru>
2009-09-09Fix VMSTATE_PCI_DEVICE versionJuan Quintela1-1/+0
PCI device entries have to have a default version, not 2, because they are used in the midle of other structures that can have _any_ version number. We can't use proper versioning here until we have SubSections support. Why we didn't noticed before? Because in a PC, the only device ported with a version less that 2 is piix_pm, and for that one, default pci values are right. If you use a virtio-console, you will see that its state it is not loaded back. Thanks to Amit Shah for reporting the problem and help debug the fix. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09don't call cpu_sychronize_state from reset handlersGlauber Costa2-3/+6
Doing this will make the vcpu ioctl be issued from the I/O thread, instead of cpu thread. The correct behaviour is to call it from within the cpu thread, as soon as we are ready to go. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09RTC polling mode brokenBernhard Kauer1-2/+3
The RTC emulation does not set the IRQ flags independent of the IRQ enable bits. The original MC146818A datasheet from 1984 notes: "flag bits in Register C [...] are set independent of the state of the corresponding enable bits in Register B" Similar sections can be found in newer documentation e.g. in rtc82885. Qemu and Bochs set the IRQ flags only if they are enabled, which breaks drivers polling on them. The following patch corrects this for the update-ended-flag in Qemu only. It does not fix the handling of the other flags. Signed-off-by: Bernhard Kauer <kauer@tudos.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09qemu-kvm: fix segfault when running kvm without /dev/kvm, falling back to ↵Dustin Kirkland1-10/+10
non-accelerated mode qemu-kvm: fix segfault when running kvm without /dev/kvm, falling back to non-accelerated mode We're seeing segfaults on systems without access to /dev/kvm. It looks like the global kvm_allowed is being set just a little too late in vl.c. This patch moves the kvm initialization a bit higher in the vl.c main, just after options processing, and solves the segfaults. We're carrying this patch in Ubuntu 9.10 Alpha. Please apply upstream, or advise if and why this might not be the optimal solution. Signed-off-by: Dustin Kirkland <kirkland@canonical.com> Move the kvm_init() call a bit higher to fix a segfault when /dev/kvm is not available. The kvm_allowed global needs to be set correctly a little earlier. Signed-off-by: Dustin Kirkland <kirkland@canonical.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09configure: fix Linux AIO detectionLuiz Capitulino1-0/+1
We should set $linux_aio to 'no' if detection failed, otherwise its contents will be empty, which is a bug as we test for 'yes' or 'no'. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09Fix compilation warnings when DEBUG_BUFFERED_FILE is definedPierre Riteau1-6/+6
gcc 4.3.2 throws warnings when DEBUG_BUFFERED_FILE is defined, because we are using the wrong format specifiers to print size_t/ssize_t values. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-09qcow2: Order concurrent AIO requests on the same unallocated clusterKevin Wolf3-5/+96
When two AIO requests write to the same cluster, and this cluster is unallocated, currently both requests allocate a new cluster and the second one merges the first one when it is completed. This means an cluster allocation, a read and a cluster deallocation which cause some overhead. If we simply let the second request wait until the first one is done, we improve overall performance with AIO requests (specifially, qcow2/virtio combinations). This patch maintains a list of in-flight requests that have allocated new clusters. A second request touching the same cluster is limited so that it either doesn't touch the allocation of the first request (so it can have a non-overlapping allocation) or it waits for the first request to complete. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>