aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-04-20qemu-img: let 'qemu-img convert' flush dataLiu Yuan2-2/+3
The 'qemu-img convert -h' advertise that the default cache mode is 'writeback', while in fact it is 'unsafe'. This patch 1) fix the help manual and 2) let bdrv_close() call bdrv_flush() 2) is needed because some backend storage doesn't have a self-flush mechanism(for e.g., sheepdog), so we need to call bdrv_flush() to make sure the image is really writen to the storage instead of hanging around writeback cache forever. Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19aio: simplify qemu_aio_waitPaolo Bonzini1-69/+64
The do...while loop can never loop, because select will just not return 0 when invoked with infinite timeout. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19aio: return "AIO in progress" state from qemu_aio_waitPaolo Bonzini2-28/+22
The definition of when qemu_aio_flush should loop is much simpler than it looks. It just has to call qemu_aio_wait until it makes no progress and all flush callbacks return false. qemu_aio_wait is the logical place to tell the caller about this. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19aio: remove process_queue callback and qemu_aio_process_queuePaolo Bonzini9-64/+21
Both unused after the previous patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19posix-aio: merge posix_aio_process_queue and posix_aio_readPaolo Bonzini1-28/+16
posix_aio_read already calls qemu_aio_process_queue, and dually qemu_aio_process_queue is always followed by a select loop that calls posix_aio_read. No races are possible, so there is no need for a separate process_queue callback. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19qemu-tool: map vm_clock to rt_clockPaolo Bonzini1-2/+1
QED uses vm_clock timers so that images are not touched during and after migration. This however does not apply to qemu-io and qemu-img. Treat vm_clock as a synonym for rt_clock there, and enable it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19qemu-io: use main_loop_waitPaolo Bonzini2-8/+9
This will let timers run during aio_read and aio_write commands, though not during synchronous commands. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19block: allow interrupting a co_sleep_nsPaolo Bonzini1-1/+2
In the next patch we want to reenter the coroutine from block_job_cancel_sync and cancel the timer. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19qcow2: Fix return value of alloc_refcount_blockKevin Wolf1-1/+1
Someone forgot something in commit 29c1a730... Documenting the right return value is not enough, you also need to actually return it in the code. This bug sometimes causes error return values even when everything has succeeded: The new offset of the refcount block is truncated to 32 bits and interpreted as signed. At least with small cluster sizes it's easy to get a negative return value this way. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-04-19qcow2: Fix error handling in qcow2_alloc_cluster_offsetKevin Wolf1-1/+1
If do_alloc_cluster_offset() fails, the error handling code tried to remove the request from the in-flight queue, to which it wasn't added yet, resulting in a NULL pointer dereference. m->nb_clusters really only becomes != 0 when the request is in the list. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19ide: convert ide_sector_write() to asynchronous I/OStefan Hajnoczi1-19/+42
The IDE PIO write sector code path uses bdrv_write() and hence can make the guest unresponsive while the I/O request is in progress. This patch converts ide_sector_write() to use bdrv_aio_writev() by using the BUSY_STAT bit to tell the guest that the request is in progress. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Tested-by: Richard Davies <richard@arachsys.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19ide: convert ide_sector_read() to asynchronous I/OStefan Hajnoczi2-21/+58
The IDE PIO interface currently uses bdrv_read() to perform reads synchronously. Synchronous I/O in the vcpu thread is bad because it prevents the guest from executing code - it makes the guest unresponsive. This patch converts IDE PIO to use bdrv_aio_readv(). We simply need to use the BUSY_STAT status so the guest knows to wait while we are busy. The only external user of ide_sector_read() is restart behavior on I/O errors and it is not affected by this change. We still need to restart I/O in the same way. Migration is also unaffected if I understand the code correctly. We continue to use the same transfer function and the BUSY_STAT status should never be migrated since we flush I/O before migrating device state. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Tested-by: Richard Davies <richard@arachsys.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19qemu-io: Add command line switch for cache modeKevin Wolf1-1/+9
To be used as in 'qemu-io -t writeback test.img' Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-04-19block: Fix spelling in comment (ineffcient -> inefficient)Stefan Weil1-1/+1
Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19iotests: fix error in 005Dong Xu Wang2-2/+2
According comment, we should not read again, we will write. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-04-19block: Drain requests in bdrv_closeKevin Wolf1-0/+2
If an AIO request is in flight that refers to a BlockDriverState that has been closed and possibly even freed, more or less anything could happen. I have seen segfaults, -EBADF return values and qcow2 sometimes actually catches the situation in bdrv_close() and abort()s. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-04-19qemu-iotests: Test bdrv_close while AIO is in flightKevin Wolf3-0/+148
If the BlockDriverState is closed/freed without draining the AIO requests first, the request coroutines may work on invalid data and file descriptors or have some dangling pointers that cause segfaults. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-04-19qemu-iotests: Always filter cluster_size out in _make_test_imgKevin Wolf11-127/+125
Some image formats do have a cluster size, others don't, but there are tests that work with both sets of images and currently we get failures because the qemu-img create output doesn't mention the cluster size for some formats. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-04-18Merge remote-tracking branch 'origin/master' into stagingAnthony Liguori7-138/+553
* origin/master: Allow controlling volume with PulseAudio backend configure: pa_simple is not needed anymore Do not use pa_simple PulseAudio API audio/spice: add support for volume control hw/ac97: add support for volume control hw/ac97: the volume mask is not only 0x1f hw/ac97: remove USE_MIXER code audio: don't apply volume effect if backend has VOICE_VOLUME_CAP audio: add VOICE_VOLUME ctl
2012-04-18Merge remote-tracking branch 'spice/spice.v52' into stagingAnthony Liguori3-3/+3
* spice/spice.v52: qxl-render: fix broken vnc+spice since commit f934493 qxl: set default values of vram*_size_mb to -1 trace-events: remove unused qxl_vga_ioport_while_not_in_vga_mode
2012-04-18Merge remote-tracking branch 'kraxel/usb.46' into stagingAnthony Liguori12-191/+390
* kraxel/usb.46: (21 commits) usb-ehci: drop assert() usb-redir: Notify our peer when we reject a device due to a speed mismatch usb-ehci: Drop unused sofv value usb-host: rewrite usb_linux_update_endp_table usb: use USBDescriptor for endpoint descriptors. usb: use USBDescriptor for interface descriptors. usb: use USBDescriptor for config descriptors. usb: use USBDescriptor for device qualifier descriptors. usb: add USBDescriptor, use for device descriptors. usb-ehci: frindex always is a 14 bits counter usb-ehci: fix ehci_child_detach usb-hub: add tracepoints usb_packet_set_state: handle p->ep == NULL usb-host: add property to turn off pipelining usb-host: add usb packet to request tracepoints usb-host: trace canceled requests usb-host: trace emulated requests Add bootindex support to usb-host and usb-redir usb-uhci: queuing fix usb-uhci: stop queue filling when we find a in-flight td ...
2012-04-18qxl-render: fix broken vnc+spice since commit f934493Alon Levy1-0/+1
Notify any listeners such as vnc that the displaysurface has been changed, otherwise they will segfault when first accessing the freed old displaysurface data. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-18qxl: set default values of vram*_size_mb to -1Alon Levy1-2/+2
The addition of those values caused a regression where not specifying any value for the vram bar size would result in a 4096 _byte_ surface area. This is ok for the windows driver but causes the X driver to be unusable. Also, it's a regression. This patch returns the default behavior of having a 64 megabyte vram BAR. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-18trace-events: remove unused qxl_vga_ioport_while_not_in_vga_modeAlon Levy1-1/+0
The resulting stp file fails to load because of an unresolvable probe. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17Allow controlling volume with PulseAudio backendMarc-André Lureau1-5/+94
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2012-04-17configure: pa_simple is not needed anymoreMarc-André Lureau1-3/+3
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2012-04-17Do not use pa_simple PulseAudio APIMarc-André Lureau1-38/+339
Unfortunately, pa_simple is a limited API which doesn't let us retrieve the associated pa_stream. It is needed to control the volume of the stream. In v4: - add missing braces Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2012-04-17audio/spice: add support for volume controlMarc-André Lureau1-0/+41
Use Spice server volume control API when available. Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2012-04-17hw/ac97: add support for volume controlMarc-André Lureau1-0/+81
Combine output volume with Master and PCM registers values. Use default values in mixer_reset (). Set volume on post-load to update backend values. v4,v5: - fix some code style Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2012-04-17hw/ac97: the volume mask is not only 0x1fMarc-André Lureau1-1/+0
It's a case by case (see Table 66. AC ?97 Baseline Audio Register Map) Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2012-04-17hw/ac97: remove USE_MIXER codeMarc-André Lureau1-121/+0
That code doesn't compile. The interesting bits for volume control are going to be rewritten in the following patch. Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2012-04-17audio: don't apply volume effect if backend has VOICE_VOLUME_CAPMarc-André Lureau3-2/+14
If the audio backend is capable of volume control, don't apply software volume (mixeng_volume ()), but instead, rely on backend volume control. This will allow guest to have full range volume control. Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2012-04-17audio: add VOICE_VOLUME ctlMarc-André Lureau2-0/+13
Add a new PCM control operation to update the stream volume on the audio backend. The argument given is a SWVoiceOut/SWVoiceIn. v4: - verified other backends didn't fail/assert on this new control they randomly return 0 or -1, but we ignore return value. Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2012-04-17seabios: update to 1.7.0Gerd Hoffmann2-0/+0
Update roms/seabios and pc-bios/bios.bin to the 1.7.0 release. Most noticable new feature is virtio-scsi support. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-ehci: drop assert()Gerd Hoffmann1-1/+0
Not sure what the purpose of the assert() was, in any case it is bogous. We can arrive there if transfer descriptors passed to us from the guest failed to pass sanity checks, i.e. it is guest-triggerable. We deal with that case by resetting the host controller. Everything is ok, no need to throw a core dump here. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-redir: Notify our peer when we reject a device due to a speed mismatchHans de Goede1-1/+7
Also cleanup (reset) our device state when we reject a device due to a speed mismatch. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-ehci: Drop unused sofv valueHans de Goede1-8/+0
The sofv value only ever gets a value assigned and is never used (read) anywhere, so we can just drop it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-host: rewrite usb_linux_update_endp_tableGerd Hoffmann2-93/+107
This patch carries a complete rewrite of the usb descriptor parser. Changes / improvements: * We are using the USBDescriptor struct instead of hard-coded offsets now to access descriptor data. * (debug) printfs are all gone, tracepoints have been added instead. * We don't try (and fail) to skip over unneeded descriptors. We parse them all one by one. We keep track of which configuration, interface and altsetting we are looking at and use this information to figure which desciptors are in use and which we can ignore. * On parse errors we clear all endpoint information, which will disallow any communication with the device, except control endpoint messages. This makes sure we don't end up with a silly device state where half of the endpoints got enabled and the other half was left disabled. * Some sanity checks have been added. The new parser is more robust and also leaves complete device information in the trace log if you enable the ush_host_parse_* tracepoints. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb: use USBDescriptor for endpoint descriptors.Gerd Hoffmann2-9/+20
Add endpoint descriptor substruct to USBDescriptor, use it in the descriptor generator code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb: use USBDescriptor for interface descriptors.Gerd Hoffmann2-9/+20
Add interface descriptor substruct to USBDescriptor, use it in the descriptor generator code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb: use USBDescriptor for config descriptors.Gerd Hoffmann2-10/+21
Add config descriptor substruct to USBDescriptor, use it in the descriptor generator code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb: use USBDescriptor for device qualifier descriptors.Gerd Hoffmann2-11/+22
Add device qualifier substruct to USBDescriptor, use it in the descriptor generator code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb: add USBDescriptor, use for device descriptors.Gerd Hoffmann2-19/+46
This patch adds a new type for the binary representation of usb descriptors. It is put into use for the descriptor generator code where the struct replaces the hard-coded offsets. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-ehci: frindex always is a 14 bits counterHans de Goede1-2/+6
frindex always is a 14 bits counter, and not a 13 bits one as we were emulating. There are some subtle hints to this in the spec, first of all "Table 2-12. FRINDEX - Frame Index Register" says: "Bit 13:0 Frame Index. The value in this register increments at the end of each time frame (e.g. micro-frame). Bits [N:3] are used for the Frame List current index. This means that each location of the frame list is accessed 8 times (frames or micro-frames) before moving to the next index. The following illustrates values of N based on the value of the Frame List Size field in the USBCMD register. USBCMD[Frame List Size] Number Elements N 00b 1024 12 01b 512 11 10b 256 10 11b Reserved" Notice how the text talks about "Bits [N:3]" are used ..., it does NOT say that when N == 12 (our case) the counter will wrap from 8191 to 0, or in otherwords that it is a 13 bits counter (bits 0 - 12). The other hint is in "Table 2-10. USBSTS USB Status Register Bit Definitions": "Bit 3 Frame List Rollover - R/WC. The Host Controller sets this bit to a one when the Frame List Index (see Section 2.3.4) rolls over from its maximum value to zero. The exact value at which the rollover occurs depends on the frame list size. For example, if the frame list size (as programmed in the Frame List Size field of the USBCMD register) is 1024, the Frame Index Register rolls over every time FRINDEX[13] toggles. Similarly, if the size is 512, the Host Controller sets this bit to a one every time FRINDEX[12] toggles." Notice how this text talks about setting bit 3 when bit 13 of frindex toggles (when there are 1024 entries, so our case), so this indicates that frindex has a bit 13 making it a 14 bit counter. Besides these clear hints the real proof is in the pudding. Before this patch I could not stream data from a USB2 webcam under Windows XP, after this cam using a USB2 webcam under Windows XP works fine, and no regressions with other operating systems were seen. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-ehci: fix ehci_child_detachGerd Hoffmann1-1/+0
Looks like a cut+paste bug from ehci_detach. When the device itself is detached from a ehci port (ehci_detach op) we have to clear the device pointer for the companion port too. When a device gets removed from a downstream port of a usb hub (ehci_child_detach op) the ehci port where the usb hub is plugged in is not affected. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-hub: add tracepointsGerd Hoffmann2-3/+51
Add tracepoints to the usb hub emulation. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb_packet_set_state: handle p->ep == NULLGerd Hoffmann1-6/+11
usb_packet_set_state can be called with p->ep = NULL. The tracepoint there tries to log endpoint information, which leads to a segfault. This patch makes usb_packet_set_state handle the NULL pointer properly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-host: add property to turn off pipeliningGerd Hoffmann1-1/+9
Add a property to usb-host to disable the bulk endpoint pipelining. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-host: add usb packet to request tracepointsGerd Hoffmann2-17/+19
Add pointer to USBPacket to all tracepoints tracking requests to make it easier to identify them when multiple requests are in flight. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-04-17usb-host: trace canceled requestsGerd Hoffmann2-1/+5
Add tracepoints to track canceled requests. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>