aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-12-05qcow2: Return real error code in qcow2_read_snapshotsKevin Wolf
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-12-05block: Add coroutine_fn marker to coroutine functionsDong Xu Wang
Looks better when reviewing these source files. 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>
2011-12-05hmp/qmp: add block_set_io_throttleZhi Yong Wu
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-05block: add I/O throttling algorithmZhi Yong Wu
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-05CoQueue: introduce qemu_co_queue_wait_insert_headZhi Yong Wu
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-05block: add the blockio limits command line supportZhi Yong Wu
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-05block: Use bdrv functions to replace file operation in cow.cLi Zhi Hui
Since common file operation functions lack of error detection, so change them to bdrv series functions. Signed-off-by: Li Zhi Hui <zhihuili@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-05xen_disk: remove dead codePaolo Bonzini
Xen_disk.c has support for using synchronous I/O instead of asynchronous, but it is compiled out by default. Remove it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-05qed: adjust the way to get nb_sectorsZhi Yong Wu
This patch is only to refactor some lines of codes to get better and more robust codes. As you have seen, in qed_read_table_cb() it's nice to use qiov->size because that function doesn't obviously use a single struct iovec. In other two functions, if qiov use more than one struct iovec, the existing way will get wrong nb_sectors. To make the code more robust, it will be nicer to refactor the existing way as below. Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-05qcow2: avoid reentrant bdrv_read() in copy_sectors()Stefan Hajnoczi
A BlockDriverState should not issue requests on itself through the public block layer interface. Nested, or reentrant, requests are problematic because they do I/O throttling and request tracking twice. Features like block layer copy-on-read use request tracking to avoid race conditions between concurrent requests. The reentrant request will have to "wait" for its parent request to complete. But the parent is waiting for the reentrant request to make progress so we have reached deadlock. The solution is for block drivers to avoid the public block layer interfaces for reentrant requests. Instead they should call their own internal functions if they wish to perform reentrant requests. This is also a good opportunity to make copy_sectors() a true coroutine_fn. That means calling bdrv_co_writev() instead of bdrv_write(). Behavior is unchanged but we're being explicit that this executes in coroutine context. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-05qcow2: Unlock during COWKevin Wolf
Unlocking during COW allows for more parallelism. One change it requires is that buffers are dynamically allocated instead of just using a per-image buffer. While touching the code, drop the synchronous qcow2_read() function and replace it by a bdrv_read() call. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-12-01Update version for 1.0 releaseAnthony Liguori
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-30Makefile: use full path for qapi-generated directoryMichael Roth
Generally $(BUILD_DIR) == $(CURDIR), but that isn't necessarilly the case, so use $(BUILD_DIR)/qapi-generated for generated files to avoid potentionally sticking generating files in odd places outside the build's include paths. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-30qapi: fix guardname generationMichael Roth
Fix a bug in handling dotted paths, and exclude directory prefixes from generated guardnames to avoid odd/pseudo-random guardnames in generated headers. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28Update version for 1.0-rc4Anthony Liguori
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28ccid: Fix buffer overrun in handling of VSC_ATR messageMarkus Armbruster
ATR size exceeding the limit is diagnosed, but then we merrily use it anyway, overrunning card->atr[]. The message is read from a character device. Obvious security implications unless the other end of the character device is trusted. Spotted by Coverity. CVE-2011-4111. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28Revert "fix out of tree build"Anthony Liguori
This reverts commit be85c90b74f56dca51782fa3080fcdf88593e045. This patch is incorrect and breaks the build with a freshly cloned git tree. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28configure: avoid screening of --{en, dis}able-usb-redir optionsMax Filippov
--*dir) option pattern precede --{en,dis}able-usb-redir) patterns in the option analysis switch, making the latter options have no effect. There were some --*dir that are supported by Autoconf and not by QEMU configure. The aim was to let QEMU packagers use the rpm (or similar) macro that overrides directories for their distribution. Replace --*dir with exact option names. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28cutils: Make strtosz & friends leave follow set to callersMarkus Armbruster
strtosz() & friends require the size to be at the end of the string, or be followed by whitespace or ','. I find this surprising, because the name suggests it works like strtol(). The check simplifies callers that accept exactly that follow set slightly. No such callers exist. The check is redundant for callers that accept a smaller follow set, and thus need to check themselves anyway. Right now, this is the case for all but one caller. All of them neglected to check, or checked incorrectly, but the previous few commits fixed them up. Finally, the check is problematic for callers that accept a larger follow set. This is the case in monitor_parse_command(). Fortunately, the problems there are relatively harmless. monitor_parse_command() uses strtosz() for argument type 'o'. When the last argument is of type 'o', a trailing ',' is diagnosed differently than other trailing junk: (qemu) migrate_set_speed 1x invalid size (qemu) migrate_set_speed 1, migrate_set_speed: extraneous characters at the end of line A related inconsistency exists with non-last arguments. No such command exists, but let's use memsave to explore the inconsistency. The monitor permits, but does not require whitespace between arguments. For instance, "memsave (1-1)1024foo" is parsed as command memsave with three arguments 0, 1024 and "foo". Yes, this is daft, but at least it's consistently daft. If I change memsave's second argument from 'i' to 'o', then "memsave (1-1)1foo" is rejected, because the size is followed by an 'f'. But "memsave (1-1)1," is still accepted, and duly saves to file ",". We don't have any users of strtosz that profit from the check. In the users we have, it appears to encourage sloppy error checking, or gets in the way. Drop the bothersome check. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28qemu-img: Tighten parsing of size argumentsMarkus Armbruster
strtosz_suffix() fails unless the size is followed by 0, whitespace or ','. Useless here, because we need to fail for any junk following the size, even if it starts with whitespace or ','. Check manually. Things like "qemu-img create xxx 1024," and "qemu-img convert -S '1024 junk'" are now caught. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28x86/cpuid: Tighten parsing of tsc_freq=FREQMarkus Armbruster
cpu_x86_find_by_name() uses strtosz_suffix_unit(), but screws up the error checking. It detects some failures, but not all. Undetected failures result in a zero tsc_khz value (error value -1 divided by 1000), which means "no tsc_freq set". To reproduce, try "-cpu qemu64,tsc_freq=9999999T". strtosz_suffix_unit() fails, because the value overflows int64_t, Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28vl: Tighten parsing of -m argumentMarkus Armbruster
strtosz_suffix() fails unless the size is followed by 0, whitespace or ','. Useless here, because we need to fail for any junk following the size, even if it starts with whitespace or ','. Check manually. Things like "-m 1024," are now caught. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28vl: Tighten parsing of -numa's parameter memMarkus Armbruster
strtosz_suffix() fails unless the size is followed by 0, whitespace or ','. Useless here, because we need to fail for any junk following the size, even if it starts with whitespace or ','. Check manually. Things like -smp 4 -numa "node,mem=1024,cpus=0-1" -numa "node,mem=1024 cpus=2-3" are now caught. Before, the second -numa's argument was silently interpreted as just "node,mem=1024". Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28cutils: Drop broken support for zero strtosz default_suffixMarkus Armbruster
Commit 9f9b17a4's strtosz() defaults a missing suffix to 'M', except it rejects fractions then (switch case 0). When commit d8427002 introduced strtosz_suffix(), that changed: fractions are no longer rejected, because we go to switch case 'M' on missing suffix now. Not mentioned in commit message, probably unintentional. Not worth changing back now. Because case 0 is still around, you can get the old behavior by passing a zero default_suffix to strtosz_suffix() or strtosz_suffix_unit(). Undocumented and not used. Drop. Commit d8427002 also neglected to update the function comment. Fix it up. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28configure: tighten pie toolchain support test for tls variablesAvi Kivity
Some toolchains don't support pie properly when tls variables are in use. Disallow pie when such toolchains are detected. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28usb-redir: Don't try to write to the chardev after a close eventHans de Goede
Since we handle close async in a bh, do_write and thus write can get called after receiving a close event. This patch adds a check to the usb-redir write callback to not call qemu_chr_fe_write on a closed backend. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28usb-redir: Device disconnect + re-connect robustness fixesHans de Goede
These fixes mainly target the other side sending some (error status) packets after a disconnect packet. In some cases these would get queued up and then reported to the controller when a new device gets connected. * Fully reset device state on disconnect * Don't allow a connect message when already connected * Ignore iso and interrupt status messages when disconnected Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28usb-redir: Call qemu_chr_fe_open/closeHans de Goede
To let the chardev now we're ready start receiving data. This is necessary with the spicevmc chardev to get it registered with the spice-server. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28spice-qemu-char: Generate chardev open/close eventsHans de Goede
Define a state callback and make that generate chardev open/close events when called by the spice-server. Notes: 1) For all but the newest spice-server versions (which have a fix for this) the code ignores these events for a spicevmc with a subtype of vdagent, this subtype specific knowledge is undesirable, but unavoidable for now, see: http://lists.freedesktop.org/archives/spice-devel/2011-July/004837.html 2) This code deliberately sends the events immediately rather then from a bh. This is done this way because: a) There is no need to do it from a bh; and b) Doing it from a bh actually causes issues because the spice-server may send data immediately after the open and when the open runs from a bh, then qemu_chr_be_can_write will return 0 for the first write which the spice-server does not expect, when this happens the spice-server will never retry the write causing communication to stall. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28qemu-char: rename qemu_chr_event to qemu_chr_be_event and make it publicHans de Goede
Rename qemu_chr_event to qemu_chr_be_event, since it is only to be called by backends and make it public so that it can be used by chardev code which lives outside of qemu-char.c Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-289pfs: improve portability to older systemsAneesh Kumar K.V
I guess we can also make sure we don't call local_ioc_getversion at all. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28tci: Make flush_icache_range() inlineStefan Weil
This is standard for other tcg targets and improves tci, too. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28eepro100: Fix alignment requirement for statistical countersStefan Weil
According to Intel's Open Source Software Developer Manual, the dump counters address must be Dword aligned. The new code enforces this alignment, so s->statsaddr may now be used with stw_le_pci_dma() and stl_le_pci_dma(). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28virtio: add and use virtio_set_featuresPaolo Bonzini
vdev->guest_features is not masking features that are not supported by the guest. Fix this by introducing a common wrapper to be used by all virtio bus implementations. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-289pfs: improve portability to older systemsPaolo Bonzini
Small requirements on "new" features have percolated to virtio-9p-local.c. In particular, the utimensat wrapper actually only supports dirfd = AT_FDCWD and flags = AT_SYMLINK_NOFOLLOW in the fallback code. Remove the arguments so that virtio-9p-local.c will not use AT_* constants. At the same time, fail local_ioc_getversion if the ioctl is not supported by the host. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-28Merge remote-tracking branch 'kwolf/block-stable' into stagingAnthony Liguori
2011-11-28Merge remote-tracking branch 'kraxel/usb.32' into stagingAnthony Liguori
2011-11-28Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori
2011-11-28Revert "i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID"Anthony Liguori
This reverts commit 66e3dd9282141b5ae75637c9676002cf3ceeb988. From Avi, "Anthony, I think we should revert that commit and refactor cpuid for 1.1. The logic is spread over too many places which makes it hard to reason about." Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-26tci: Add entry to MAINTAINERSStefan Weil
This should have be part of my TCI patch series. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-11-26MAINTAINERS: add checkpatchBlue Swirl
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-11-26checkpatch.pl: fix CAST detectionFlorian Mickler
We should only claim that something is a cast if we did not encouter a token before, that did set av_pending. This fixes the operator * in the line below to be detected as binary (vs unary). kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL); Reported-by: Peter Chubb <nicta.com.au> Signed-off-by: Florian Mickler <florian@mickler.org> (cherry-picked from Linux kernel commit c023e4734c3e8801e0ecb5e81b831d42a374d861) Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-11-26target-xtensa: fix MMUv3 initializationMax Filippov
- ITLB/DTLB ways 5 and 6 have 4 and 8 entries respectively; - ITLB/DTLB way 6 attr field is set to 3 on reset. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-11-23usb-host: add usb_host_do_reset function.Gerd Hoffmann
Add a special function to reset the host usb device. It tracks the time needed by the USBDEVFS_RESET ioctl and prints a warning in case it needs too long. Usually it should be finished in 200 - 300 miliseconds. Warning threshold is one second. Intention is to help troubleshooting by indicating that the usb device stopped responding even to a reset request and is possibly broken. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-11-23vpc: Add missing error handling in alloc_blockKevin Wolf
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-23vdi: Fix memory leakKevin Wolf
The block map is allocated in vdi_open, but was never freed. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-23vvfat: Add migration blockerKevin Wolf
vvfat caches more or less everything when in writable mode. For migration to work, it would have to be invalidated. Block migration for now when in writable mode (default is readonly). Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-23vpc: Add migration blockerKevin Wolf
vpc caches the BAT. For migration to work, it would have to be invalidated. Block migration for now. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-23vmdk: Add migration blockerKevin Wolf
VMDK caches L2 tables. For migration to work, they would have to be invalidated. Block migration for now. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-23vdi: Add migration blockerKevin Wolf
vdi caches the block map. For migration to work, it would have to be invalidated. Block migration for now. Signed-off-by: Kevin Wolf <kwolf@redhat.com>