summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-09-11vmstate: rename run_after_load() -> post_load()Juan Quintela6-11/+12
This naming was used in kvm tree, and is easier to remember Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11vmstate: add sensible arguments to vmstate_unregister()Juan Quintela2-3/+10
vmsd alone is not enugh, because we can have several structs saved with the same description (vmsd). Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11Make get_ticks_per_sec() a static inlineAnthony Liguori2-15/+10
ticks_per_sec is a constant. There's no need to store it as a variable as it never changes since our time is based on units. Convert get_ticks_per_sec() to a static inline and move the constant into qemu-timer.h. Remove all references to QEMU_TIMER_BASE so that we consistently use this interface. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11timers: move them to VMStateJuan Quintela1-22/+12
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11timers: Createt TimersState and put all timers state thereJuan Quintela1-31/+39
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11Unexport ticks_per_sec variable. Create get_ticks_per_sec() functionJuan Quintela44-113/+130
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11timers: remove useless checkJuan Quintela1-6/+0
loadvm_state is called from: vl.c during startup, vmstart() is called after finishing loading. The other caller do_loadvm() does the call after a vm_stop(). At both places where we can be saving state we are stoped a few lines before Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11Remove SaveVM v2 supportJuan Quintela1-43/+4
In previosu series I remove v2 support for RAM (that was the version that was supported when SaveVM v3 appeared). Now we can't load RAM for any image saved in SaveVM v2, we can as well remove SaveVM v2 entirely. Note: That SaveVM RAM was at v2 when General SaveVM support went from v2 to v3 makes talking about versions confusing at least Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11ram: Remove SaveVM Version 2 supportJuan Quintela1-93/+1
It don't work. It fails in this check if (qemu_get_be32(f) != last_ram_offset) With 512MB of ram, values were for me: v = 20c00000 last_ram_offset = 20840000 Last time that some code changed that was this one. commit 94a6b54fd6d2d3321066cb4db7abeeb417af9365 Implement dynamic guest ram allocation. (I.e. it has been broken since at least April) Going back to the previous commit, ram load correctly, but vga screen gets corrupted and ide don't load correctly. At this point I decide that removing support is the only viable thing. The last user of the ram_compress_* were RAM_SAVE_FLAG_FULL flag, but that flag was never ever been stored in an image. Mark the flag obsolete and remove the functions. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11ram: remove support for loading v1Juan Quintela1-42/+0
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11move mux focus field from CharDriverState to MuxDriverGerd Hoffmann2-14/+14
Now that monitor stopped using focus we can make it internal to the mux driver. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11monitor: fix muxingGerd Hoffmann2-11/+28
make the mux driver send mux_in and mux_out events when switching focus while hooking up more handlers. stop using CharDriverState->focus in monitor.c, track state using the mux events instead. This also removes the implicit assumtion that a muxed monitor allways has mux channel 0. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11qdev: add parser for chardev propertiesGerd Hoffmann1-0/+11
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11Allow -serial chardev:<name>Gerd Hoffmann3-0/+20
Lets put -chardev into use now. With this patch applied chardev:name is accepted as chardev specification everywhere, i.e. now you can: -chardev stdio,id=ttyS0 -serial chardev:ttyS0 which does the same as '-serial stdio". Muxing can be done this way: -chardev stdio,id=mux,mux=on -serial chardev:mux -monitor chardev:mux You can mux more than two streams. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11convert udp chardev to QemuOpts.Gerd Hoffmann4-38/+156
While being at it: create a new inet_dgram_opts() function for udp setup, so udp can handle IPv6 now. new cmd line syntax: -chardev udp,id=name,host=remotehost,port=remoteport,\ localaddr=bindaddr,localport=bindport Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11convert mux chardev to QemuOpts.Gerd Hoffmann1-11/+21
new cmd line syntax: you can add mux=1 to any chardev to enable muxing, then attach it multiple times, like this: -chardev pty,name=mux,mux=on Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11convert vc chardev to QemuOpts.Gerd Hoffmann4-32/+55
new cmd line syntax: -chardev vc,id=name -chardev vc,id=name,width=pixels,height=pixels -chardev vc,id=name,cols=chars,rows=chars Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11convert tty + parport chardevs to QemuOpts.Gerd Hoffmann1-25/+32
new cmd line syntax: -chardev tty,id=name,path=/dev/tty* -chardev parport,id=name,path=/dev/parport* Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11convert windows console chardev to QemuOpts.Gerd Hoffmann1-4/+6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11convert braille chardev to QemuOpts.Gerd Hoffmann3-7/+6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11convert msmouse chardev to QemuOpts.Gerd Hoffmann3-7/+7
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11convert stdio chardev to QemuOpts.Gerd Hoffmann1-5/+4
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11convert pty chardev to QemuOpts.Gerd Hoffmann1-6/+7
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11convert unix+tcp chardevs to QemuOpts.Gerd Hoffmann2-56/+93
new cmd line syntax: unix socket: -chardev socket,id=name,path=/path/to/socket tcp socket: -chardev socket,id=name,host=hostaddr|ipaddr,port=portnr server and nowait options work as usual. Alternatively you can use server=[on|off] + wait=[on|off] syntax. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11sockets: add inet_listen_optsGerd Hoffmann2-55/+49
Add inet_listen_opts(). Does the same as inet_listen(), but uses QemuOpts. inet_listen() is a compatibility wrapper for inet_listen_opts() now and should go away some day. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11sockets: add inet_connect_optsGerd Hoffmann2-33/+97
Add inet_connect_opts(). Does the same as inet_connect(), but uses QemuOpts. inet_connect() is a compatibility wrapper for inet_connect_opts() now and should go away some day. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11sockets: add unix_*_opts for windows.Gerd Hoffmann1-0/+12
Add unix_*_opts function dummys for windows. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11sockets: add unix_listen_optsGerd Hoffmann2-14/+34
Add unix_listen_opts(). Does the same as unix_listen(), but uses QemuOpts. unix_listen() is a compatibility wrapper for unix_listen_opts() now and should go away some day. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-09-11sockets: add unix_connect_optsGerd Hoffmann2-1/+36
Add unix_connect_opts(). Does the same as unix_connect(), but uses QemuOpts. unix_connect() is a compatibility wrapper for unix_connect_opts() now and should go away some day. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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>