configure: Print a banner comment at the top of config.log
Print a banner comment at the top of config.log identifyingwhen configure was run and the arguments used. This is occasionallyuseful for debugging purposes.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
net/socket.c : fix memory leak
Signed-off-by: Li Zhi Hui <zhihuili@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
win32: fix memory leak
string is allocated by g_malloc, will not be used after putenv, should befree before return.
Paolo Bonzini <pbonzini@redhat.com> confirmed this is safe under Wine:
"1) the underlying Win32 APIs require separate arguments for the...
fix typo: delete redundant semicolon
Double semicolons should be single.
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
fix spelling in hw sub directory
Correct obvious spelling errors in qemu/hw directory.
console: Clean up confusing indentation in console_putchar()
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
console: Fix console_putchar() for CSI J
It falls through to the code for CSI K. "Erase Down" also does "EraseEnd of Line", "Erase Up" also does "Erase Start of Line", and "EraseScreen" also does "Erase Line". Happens not to be visible. Fix itanyway. Spotted by Coverity....
console: Fix qemu_default_pixelformat() for 24 bpp
Falls through to 32 bpp. Harmless, because the only difference is thealpha component, and we're not using that. Spotted by Coverity.
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>...
configure: Include #define name in check_define compiler error
Include the name of the #define being tested for in the compilererror produced when a check_define test is run and fails. Thisappears only in the config.log, but it does make it a little easier...
hw/arm_gic.c: Ignore attempts to complete nonexistent IRQs
Ignore attempts to complete non-existent IRQs; this fixes a bufferoverrun if the guest writes a bad value to the GICC_EOIR register.(This case is UNPREDICTABLE so ignoring it is a valid choice.)...
configure: Drop armv4l/armv4b distinction in $cpu
Drop the distinction between armv4l/armv4b in the $cpu variable(ie host cpu type) in favour of calling everything 'arm'. Thismakes it the same as the ARCH setting and removes some specialcasing. The only thing we were using the distinction for was to...
pseries: Fix array overrun bug in PCI code
spapr_populate_pci_devices() containd a loop with PCI_NUM_REGIONS (7)iterations. However this overruns the 'bars' global array, which only has6 elements. In fact we only want to run this loop for things listed in the...
target-arm/helper.c: Don't allocate TCG resources unless TCG enabled
Don't call arm_translate_init() (which allocates TCG resources)unless TCG is enabled.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
target-arm/translate.c: Fix slightly misleading comment in Thumb decoder
Clarify some slightly misleading comments in the Thumb decoder'shandling of the memory hint space -- in particular one code pathmarked as 'UNPREDICTABLE or unallocated hint' also includes some...
Fix hw_error messages from arm_timer.c
Two of the calls to hw_error() in arm_timer.c contain the wrong function name.
As suggested by Andreas Färber, use the C99 standard func macro toget the correct name, instead of putting the name directly into the code....
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'aneesh/1.0-fixes' into staging
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging
Update version for 1.1 development branch
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block: convert qemu_aio_flush() calls to bdrv_drain_all()
Many places in QEMU call qemu_aio_flush() to complete all pendingasynchronous I/O. Most of these places actually want to drain all blockrequests but there is no block layer API to do so.
This patch introduces the bdrv_drain_all() API to wait for requests...
block: wait_for_overlapping_requests() deadlock detection
Debugging a reentrant request deadlock was fun but in the future we needa quick and obvious way of detecting such bugs. Add an assert thatchecks we are not about to deadlock when waiting for another request....
block: implement bdrv_co_is_allocated() boundary cases
Cases beyond the end of the disk image are only implemented for blockdrivers that do not provide .bdrv_co_is_allocated(). It's worth makingthese cases generic so that block drivers that do implement...
coroutine: add qemu_co_queue_restart_all()
It's common to wake up all waiting coroutines. Introduce theqemu_co_queue_restart_all() function to do this instead of looping overqemu_co_queue_next() in every caller.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
block: add request tracking
The block layer does not know about pending requests. This informationis necessary for copy-on-read since overlapping requests must beserialized to prevent races that corrupt the image.
The BlockDriverState gets a new tracked_request list field which...
block: add interface to toggle copy-on-read
The bdrv_enable_copy_on_read()/bdrv_disable_copy_on_read() functions canbe used to programmatically enable or disable copy-on-read for a blockdevice. Later patches add the actual copy-on-read logic.
block: wait for overlapping requests
When copy-on-read is enabled it is necessary to wait for overlappingrequests before issuing new requests. This prevents races between thecopy-on-read and a write request.
block: request overlap detection
Detect overlapping requests and remember to align to cluster boundariesif the image format uses them. This assumes that allocating I/O isperformed in cluster granularity - which is true for qcow2, qed, etc.
block: core copy-on-read logic
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: add -drive copy-on-read=on|off
This patch adds the -drive copy-on-read=on|off command-line option:
copy-on-read=on|off copy-on-read is "on" or "off" and enables whether to copy read backing file sectors into the image file. Copy-on-read avoids accessing the...
cow: use bdrv_co_is_allocated()
Now that bdrv_co_is_allocated() is available we can use it instead ofthe synchronous bdrv_is_allocated() interface. This is a follow-up thatKevin Wolf <kwolf@redhat.com> pointed out after applying the series thatintroduces bdrv_co_is_allocated()....
dma-helpers: Add trace events
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qed: convert to .bdrv_co_is_allocated()
The bdrv_qed_is_allocated() function is a synchronous wrapper aroundqed_find_cluster(), which performs the cluster lookup. In order toconvert the synchronous function to a coroutine function we yieldinstead of using qemu_aio_wait(). Note that QED's cache is already safe...
block: convert qcow2, qcow2, and vmdk to .bdrv_co_is_allocated()
The qcow2, qcow, and vmdk block drivers are based on coroutines. They have acoroutine mutex which protects internal state. We can convert the.bdrv_is_allocated() function to .bdrv_co_is_allocated() by holding the mutex...
vvfat: convert to .bdrv_co_is_allocated()
It is trivial to switch from the synchronous .bdrv_is_allocated()interface to .bdrv_co_is_allocated() since vvfat_is_allocated() does notblock.
vdi: convert to .bdrv_co_is_allocated()
It is trivial to switch from the synchronous .bdrv_is_allocated()interface to .bdrv_co_is_allocated() since vdi_is_allocated() does notblock.
cow: convert to .bdrv_co_is_allocated()
The cow block driver does not keep internal state for cluster lookups.This means it is safe to perform cluster lookups in coroutine contextwithout risk of race conditions that corrupt internal state.
block: drop .bdrv_is_allocated() interface
Now that all block drivers have been converted to.bdrv_co_is_allocated() we can drop .bdrv_is_allocated().
Note that the public bdrv_is_allocated() interface is still availablebut is in fact a synchronous wrapper around .bdrv_co_is_allocated()....
block: add bdrv_co_is_allocated() interface
This patch introduces the public bdrv_co_is_allocated() interface whichcan be used to query image allocation status while the VM is running.
qemu-common: add QEMU_ALIGN_DOWN() and QEMU_ALIGN_UP() macros
Add macros for aligning a number to a multiple, for example:
QEMU_ALIGN_DOWN(500, 2000) = 0QEMU_ALIGN_UP(500, 2000) = 2000
Since ALIGN_UP() is a common macro name use the QEMU_* namespace prefix....
qcow2: Update snapshot table information at once
Failing in the middle wouldn't help with the integrity of the image, sodoing everything in a single request seems better.
qcow2: Cleanups and memleak fix in qcow2_snapshot_create
sn->id_str could be leaked before this. The rest of this patch changescomments, fixes coding style or removes checks that are unnecessary withg_malloc.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
qcow2: Rework qcow2_snapshot_create error handling
Increase refcounts only after allocating a new L1 table has succeeded inorder to make leaks less likely. If writing the snapshot table fails,revert in-memory state to be consistent with that on disk.
While at it, make it return the real error codes instead of -1....
qcow2: Return real error in qcow2_snapshot_goto
Besides fixing the return code, this adds some comments that make clearhow the code works and that it potentially breaks images if we fail inthe wrong place. Actually fixing this is left for the next patch....
qcow2: Fix order of refcount updates in qcow2_snapshot_goto
The refcount updates must be moved so that in the worst case we can getcluster leaks, but refcounts may never be too low.
qcow2: Fix order in qcow2_snapshot_delete
First the snapshot must be deleted and only then the refcounts can bedecreased.
qcow2: Fix error path in qcow2_snapshot_load_tmp
If the bdrv_read() of the snapshot's L1 table fails, return the righterror code and make sure that the old L1 table is still loaded and wedon't break the BlockDriverState completely.
block: use public bdrv_is_allocated() interface
There is no need for bdrv_commit() to use the BlockDriver.bdrv_is_allocated() interface directly. Converting to the publicinterface gives us the freedom to drop .bdrv_is_allocated() entirely infavor of a new .bdrv_co_is_allocated() in the future....
block: add .bdrv_co_is_allocated()
This patch adds the .bdrv_co_is_allocated() interface which is identicalto .bdrv_is_allocated() but runs in coroutine context. Running incoroutine context implies that other coroutines might be performing I/Oat the same time. Therefore it must be safe to run while the following...
block: Use bdrv functions to replace file operation in cow.c
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>...
block: add the blockio limits command line support
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>
CoQueue: introduce qemu_co_queue_wait_insert_head
block: add I/O throttling algorithm
hmp/qmp: add block_set_io_throttle
block: Add coroutine_fn marker to coroutine functions
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>
qcow2: Return real error code in qcow2_read_snapshots
qcow2: Return real error code in qcow2_write_snapshots
Doesn't immediately fix anything as the callers don't use the returnvalue, but they will be fixed next.
qed: adjust the way to get nb_sectors
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 touse qiov->size because that function doesn't obviously use a singlestruct iovec....
xen_disk: remove dead code
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>
qcow2: avoid reentrant bdrv_read() in copy_sectors()
A BlockDriverState should not issue requests on itself through thepublic block layer interface. Nested, or reentrant, requests areproblematic because they do I/O throttling and request tracking twice....
qcow2: Unlock during COW
Unlocking during COW allows for more parallelism. One change it requires isthat buffers are dynamically allocated instead of just using a per-imagebuffer.
While touching the code, drop the synchronous qcow2_read() function and replace...
hw/9pfs: use migration blockers to prevent live migration when virtfs export path is mounted
Now when you try to migrate with VirtFS export path mounted, you get a proper QMP error:
(qemu) migrate tcp:localhost:4444Migration is disabled when VirtFS export path '/tmp/' is mounted in the guest using mount_tag 'v_tmp'...
hw/9pfs: Reset server state during TVERSION
As per the 9p rfc, during TVERSION its necessary to clean all the activefids, so that we start the session from a clean state. Its also needed inscenarios where the guest is booting off 9p, and boot fails, and client...
hw/9pfs: Add qdev.reset callback for virtio-9p-pci device
Add the device reset callback
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Use the correct file descriptor in Fsdriver Callback
Fsdriver callback that operate on file descriptor need todifferentiate between directory fd and file fd.
Based on the original patch from Sassan Panahinejad <sassan@sassan.me.uk>
hw/9pfs: Improve portability to older systems
handle fs driver require a set of newly added syscalls. Don'tCompile handle FS driver if those syscalls are not available.Instead of adding #ifdef for all those syscalls we check foropen by handle syscall. If that is available then rest of the...
fix spelling in QMP sub directory
Cc: Markus Armbruster <armbru@redhat.com>Acked-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
fix spelling in scripts sub directory
fix spelling in target sub directory
Cc: Richard Henderson <rth@twiddle.net>Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>Cc: Aurelien Jarno <aurelien@aurel32.net>Cc: Alexander Graf <agraf@suse.de>Cc: Aurelien Jarno <aurelien@aurel32.net>Cc: Blue Swirl <blauwirbel@gmail.com>...
fix spelling in tcg sub directory
fix spelling in tests sub directory
fix spelling in ui sub directory
Cc: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
fix spelling in block sub directory
Cc: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
fix spelling in main directory
sonic: fix typo
Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qxl: Don't convert from size_t to int and back in qxl_cursor()
Just for cleanliness; it would take a truly gigantic cursor to break.
MAINTAINERS: Delete spurious '.'
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
darwin-user: Fix format string in debug message
This was spotted by cppcheck.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
fix spelling in darwin-user sub directory
fix spelling in linux-user sub directory
Cc: Riku Voipio <riku.voipio@iki.fi>Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
fix spelling in libcacard sub directory
Update version for 1.0 release
qapi: fix guardname generation
Fix a bug in handling dotted paths, and exclude directory prefixesfrom generated guardnames to avoid odd/pseudo-random guardnames ingenerated headers.
Makefile: use full path for qapi-generated directory
Generally $(BUILD_DIR) == $(CURDIR), but that isn't necessarilly thecase, so use $(BUILD_DIR)/qapi-generated for generated files toavoid potentionally sticking generating files in odd places outsidethe build's include paths....
configure: avoid screening of --{en, dis}able-usb-redir options
--*dir) option pattern precede --{en,dis}able-usb-redir) patterns in theoption analysis switch, making the latter options have no effect.
There were some --*dir that are supported by Autoconf and not by QEMU configure....
Revert "fix out of tree build"
This reverts commit be85c90b74f56dca51782fa3080fcdf88593e045.
This patch is incorrect and breaks the build with a freshly cloned git tree.
ccid: Fix buffer overrun in handling of VSC_ATR message
ATR size exceeding the limit is diagnosed, but then we merrily use itanyway, overrunning card->atr[].
The message is read from a character device. Obvious securityimplications unless the other end of the character device is trusted....
Update version for 1.0-rc4
configure: tighten pie toolchain support test for tls variables
Some toolchains don't support pie properly when tls variables arein 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>
cutils: Drop broken support for zero strtosz default_suffix
Commit 9f9b17a4's strtosz() defaults a missing suffix to 'M', exceptit 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...
vl: Tighten parsing of -numa's parameter mem
strtosz_suffix() fails unless the size is followed by 0, whitespace or','. Useless here, because we need to fail for any junk following thesize, even if it starts with whitespace or ','. Check manually.
Things like...
vl: Tighten parsing of -m argument
strtosz_suffix() fails unless the size is followed by 0, whitespace or','. Useless here, because we need to fail for any junk following thesize, even if it starts with whitespace or ','. Check manually.Things like "-m 1024," are now caught....
x86/cpuid: Tighten parsing of tsc_freq=FREQ
cpu_x86_find_by_name() uses strtosz_suffix_unit(), but screws up theerror checking. It detects some failures, but not all. Undetectedfailures result in a zero tsc_khz value (error value -1 divided by1000), which means "no tsc_freq set"....
qemu-img: Tighten parsing of size arguments
strtosz_suffix() fails unless the size is followed by 0, whitespace or','. Useless here, because we need to fail for any junk following thesize, even if it starts with whitespace or ','. Check manually.Things like "qemu-img create xxx 1024," and "qemu-img convert -S '1024...
cutils: Make strtosz & friends leave follow set to callers
strtosz() & friends require the size to be at the end of the string,or be followed by whitespace or ','. I find this surprising, becausethe name suggests it works like strtol().
The check simplifies callers that accept exactly that follow set...
qemu-char: rename qemu_chr_event to qemu_chr_be_event and make it public
Rename qemu_chr_event to qemu_chr_be_event, since it is only to becalled by backends and make it public so that it can be used by chardevcode which lives outside of qemu-char.c
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
spice-qemu-char: Generate chardev open/close events
Define a state callback and make that generate chardev open/close events whencalled 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...
usb-redir: Call qemu_chr_fe_open/close
To let the chardev now we're ready start receiving data. This is necessarywith 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>
usb-redir: Device disconnect + re-connect robustness fixes
These fixes mainly target the other side sending some (error status)packets after a disconnect packet. In some cases these would get queuedup and then reported to the controller when a new device gets connected....
usb-redir: Don't try to write to the chardev after a close event
Since we handle close async in a bh, do_write and thus write can getcalled after receiving a close event. This patch adds a check tothe usb-redir write callback to not call qemu_chr_fe_write on a closed...