qemu-img: Require larger zero areas for sparse handling
By default, require 4k of consecutive zero bytes for qemu-img to make theoutput file sparse by not issuing a write request for the zeroed parts. Add an-S option to allow users to tune this setting....
block: latency accounting
Account the total latency for read/write/flush requests. This allowsmanagement tools to average it based on a snapshot of the nr opscounters and allow checking for SLAs or provide statistics.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
block: explicit I/O accounting
Decouple the I/O accounting from bdrv_aio_readv/writev/flush andmake the hardware models call directly into the accounting helpers.
This means: - we do not count internal requests from image formats in addition to guest originating I/O...
qcow2: remove unused qcow2_create_refcount_update function
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: use always stderr for debugging
let all DEBUG_ALLOC2 printf goes to stderr
sheepdog: use coroutines
This makes the sheepdog block driver support bdrv_co_readv/writevinstead of bdrv_aio_readv/writev.
With this patch, Sheepdog network I/O becomes fully asynchronous. Theblock driver yields back when send/recv returns EAGAIN, and is resumed...
qcow2: remove memory leak
block/curl: Handle failed reads gracefully.
Current behaviour if a read fails is for the acb to not get finished.This causes an infinite loop in bdrv_read_em (block.c). The read failurenever gets reported to the guest and if the error condition clears, the...
block: include flush requests in info blockstats
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
posix-aio-compat: fix latency issues
In certain circumstances, posix-aio-compat can incur a lot of latency: - threads are created by vcpu threads, so if vcpu affinity is set, aio threads inherit vcpu affinity. This can cause many aio threads to compete for one cpu....
qcow/qcow2: Allocate QCowAIOCB structure using stack
instead of calling qemi_aio_get use stack
qcow: QCowAIOCB field cleanup
remove unused field from this structure and put some of them in qcow_aio_read_cb and qcow_aio_write_cb
qcow: move some blocks of code to avoid useless variable initialization
qcow: Remove QCowAIOCB
Embed qcow_aio_read_cb into qcow_co_readv and qcow_aio_write_cb into qcow_co_writev
qcow: remove old #undefined code
qcow2: Removed unused AIOCB fields
qcow2: removed cur_nr_sectors field in QCowAIOCB
qcow2: remove l2meta from QCowAIOCB
qcow2: remove cluster_offset from QCowAIOCB
qcow2: remove common from QCowAIOCB
qcow2: reindent and use while before the big jump
prepare to remove read/write callbacks
qcow2: Removed QCowAIOCB entirely
coroutine: Add CoRwlock support
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: parse cache mode flags in a single place
This patch introduces bdrv_parse_cache_flags() which sets open flagsgiven a cache mode. Previously this was duplicated in blockdev.c andqemu-img.c.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
block: add cache=directsync parameter to -drive
This patch adds -drive cache=directsync for O_DIRECT | O_SYNC host fileI/O with no disk write cache presented to the guest.
This mode is useful when guests may not be sending flushes whenappropriate and therefore leave data at risk in case of power failure....
qcow2: Fix DEBUG_* compilation
By introducing BlockDriverState compiling qcow2 with DEBUG_ALLOC and DEBUG_EXTdefined got broken.Define a BdrvCheckResult structure locally which is now needed as the secondargument.
Also fix qcow2_read_extensions() needing BDRVQcowState....
qemu-img: Use qemu_blockalign
Now that you can use cache=none for the output file in qemu-img, we shouldproperly align our buffers so that raw-posix doesn't have to use its (smaller)bounce buffer.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qcow2: fix typo in documentation for qcow2_get_cluster_offset()
Documentation states the num is measured in clusters, but itsactually measured in sectors
Signed-off-by: Devin Nakamura <devin122@gmail.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow: initialize coroutine mutex
commit 52b8eb60132b27ad53476490e9d7579003390cfa added a mutex,but never initialized it. This caused a segfault.
Reported-by: Alexander Graf <agraf@suse.de>Signed-off-by: Scott Wood <scottwood@freescale.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img: print error codes when convert fails
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
xilinx.h: Added missing includes
Added some missing #includes for this file. Previously this filerelied on its clients to pre-include its dependencies.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
xilinx: removed microbalze_pic_init from xilinx.h
This is a microblaze target specific function that belongs outsideof xilinx.h (which is a collection of target independent device modelinstantiator functions)
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...
sdl: Don't release input on mouse mode change in full-screen mode
While in full-screen mode, the input focus naturally belongs to the SDLwindow. Avoid dropping it when switching from absolute to relativemouse mode.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
target-i386: Remove unused polarity arguments from APIC API
Polarity of external interrupts needs to be handled in the IOAPIC.Passing it to the APIC is pointless. So remove all these arguments.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ioapic: Implement polarity
If the polarity bit is set in the redirection table, the input levelsimply has to inverted as it is low active in this case.
vmware-vga: Register reset service
Fixes cold reset in vmware graphic modes. We need to split up the resetfunction for this purpose, breaking out init-once bits.
Cc: Andrzej Zaborowski <balrogg@gmail.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
vmware-vga: Disable verbose mode
Elimiates 'vmsvga_value_write: guest runs Linux.' messages from theconsole.
CC: Andrzej Zaborowski <balrogg@gmail.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmware-vga: Remove dead DIRECT_VRAM mode
The code was disabled since day 1 of vmware-vga, and now it does noteven build anymore. Time for a cleanup.
vmware-vga: Eliminate vga_dirty_log_restart
After the conversion to the new Memory API, vga_dirty_log_restart becameseriously pointless. Remove it from vmware-vga and and then finally dropthe service.
CC: Andrzej Zaborowski <balrogg@gmail.com>CC: Avi Kivity <avi@redhat.com>...
vga: Use linear mapping + dirty logging in chain 4 memory access mode
Most VGA memory access modes require MMIO handling as they demand weirdlogic to get a byte from or into the video RAM. However, there is oneexception: chain 4 mode with all memory planes enabled for writing. This...
vga: Drop some unused fields
Memory region refactorings obsoleted them.
CC: Avi Kivity <avi@redhat.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Replace qemu_system_cond with VCPU stop mechanism
We can express the VCPU thread wakeup with the stop mechanism, savingboth qemu_system_ready and the qemu_system_cond. For KVM threads, we canjust enter the main loop as long as the thread is stopped. The central...
Do not drop global mutex for polled main loop runs
If we call select without a timeout, it's more efficient to keep theglobal mutex locked as we may otherwise just play ping pong with avcpu thread contending for it. This is particularly important for TCG...
Poll main loop after I/O events were received
Polling until select returns empty fdsets helps to reduce the switchesbetween iothread and vcpus. The benefit of this patch is best visiblewhen running an SMP guest on an SMP host in emulation mode.
Do not kick vcpus in TCG mode
In TCG mode, iothread and vcpus run in lock-step. So it's pointless tosend a signal from qemu_cpu_kick to the vcpu thread - if we got here,the receiver already left the vcpu loop.
Merge remote-tracking branch 'qemu-kvm/memory/core' into staging
microblaze-user: Deliver SIGFPE on div by zero
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
memory: Fix old_portio vs non-zero offset
The legacy functions that we're wrapping expect that offsetto be included in the register. Indeed, they generallyexpect the absolute address and then mask off the "high" bits.
The FDC is the first converted device with a non-zero offset....
memory: temporarily suppress the subregion collision warning
After 312b4234, the APIC and PCI devices are colliding with each other. Thisis harmless in practice because the APIC accesses are special cased and nevermake there way onto the bus.
Avi is working on a proper fix, but until that's ready, avoid printing the...
isa: add isa_address_space()
A helper that returns the address space used by ISA devices. Usefulfor getting rid of isa_mem_base, multiple ISA buses, or ISA buses behindbridges.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: add pci_address_space()
Returns the PCI address space. Useful for bridges that can obscurepart of the PCI address space.
vga: drop get_system_memory() from vga devices and derivatives
Instead, use the bus accessors, or get the address space directlyfrom the board constructor.
440fx: fix PAM, PCI holes
The current implementation of PAM and the PCI holes is broken in severalways:
- PCI BARs are not restricted to the PCI hole (a BAR may hide memory) - PCI devices do not respect PAM (if a PCI device maps a region while PAM maps the region to RAM, the request will be honored)...
sh_pci: convert to memory API
arm11mpcore: use sysbus_init_mmio_cb2
This tells the sysbus code it need not use IO_MEM_UNASSIGNED.
versatile_pci: convert to memory API
ppce500_pci: convert to sysbus_init_mmio_cb2()
Not a huge step forward, but at least we now have a 1:1 relationshipbetween registration and unregistration.
sysbus: remove sysbus_init_mmio_cb()
This problem with this function is that it is not reversible - it isimpossible to know where things are registered and unregister themexactly. As there are no more users, we can remove it.
Signed-off-by: Avi Kivity <avi@redhat.com>...
sysbus: add a variant of sysbus_init_mmio_cb with an unmap callback
sysbus_init_mmio_cb() uses the destructive IO_MEM_UNASSIGNED to remove aregion. Provide an alternative that calls an unmap callback, so the removalmay be done non-destructively.
ppc4xx_sdram: convert to memory API
Clumsy due to the lack of clipping support, needed forchanging exposed ram size.
ppc405_uc: convert to memory API
onenand: convert to memory API
pcie_host: convert to memory API
Assuming that mmcfg size cannot change at runtime.
omap_gpmc/nseries/tusb6010: convert to memory API
Somewhat clumsy since it needs a variable sized region.
arm_timer: convert to memory API
armv7m: convert to memory API
gt64xxx.c: convert to memory API
tusb6010: move declarations to new file tusb6010.h
Avoid #include hell.
arm_sysctl: convert to memory API
Improvements to libtool support.
Improvements to the libtool support in QEMU. Replace hard codedlibtool in the infrastructure with $(LIBTOOL) and allowoverriding the libtool binary used via the configurescript.
Reviewed-by: Andreas F=E4rber <andreas.faerber@web.de>...
pcnet: fix wrong opaque (broken by bd8d6f7cadb6ace98c779135217a4ed7b5fccc23)
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
apb_pci: convert to memory API
apic: convert to memory API
arm_gic: convert to memory API
build: list libraries after objects, for proper linkage
Without this change, when using -Wl,--as-needed with GNU linker, thelibraries would be discarded.
Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
w32: Fix qemu_ftruncate64
SetFilePointer returns INVALID_SET_FILE_POINTER when it fails.In addition, GetLastError must be checked.
The first call of SetFilePointer did not use INVALID_SET_FILE_POINTER,the second call used wrong error handling.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
fix code format
Fix code format to make checkpatch.pl happy.
Signed-off-by: Robert Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
e1000: use MII status register for link up/down
Some guests will use the standard MII status registerto verify link state. They will not notice link changesunless this register is updated.
Verified with Linux 3.0 and Windows XP guests.
Without this patch, ethtool will report speed and duplex as...
char: rename qemu_chr_get_msgfd() -> qemu_chr_fe_get_msgfd()
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
char: remove qemu_chr_send_event()
It's dead code.
char: document the functions that will be the public interface
char: rename qemu_chr_open() -> qemu_chr_new()
char: qemu_chr_open_opts() -> qemu_chr_new_from_opts()
char: rename qemu_chr_close() -> qemu_chr_delete()
char: qemu_chr_ioctl() -> qemu_chr_fe_ioctl()
char: rename qemu_chr_set_echo() -> qemu_chr_fe_set_echo()
char: rename qemu_chr_read() -> qemu_chr_be_write()
char: rename qemu_chr_can_read() -> qemu_chr_be_can_read()
char: rename qemu_chr_guest_open() -> qemu_chr_fe_open()
char: rename qemu_chr_guest_close() -> qemu_chr_fe_close()
char: rename qemu_chr_write() -> qemu_chr_fe_write()
char: rename qemu_chr_printf() -> qemu_chr_fe_printf()
tcg/ppc64: fix 16/32 mixup
Signed-off-by: malc <av1474@comtv.ru>
Merge branch 'master' of git://git.qemu.org/qemu
tcg/ppc64: implement not_i32/64 and ext32u_i64
tcg/ppc32: implement deposit_i32
Merge remote-tracking branch 'pmaydell/armhw-for-upstream' into staging
guest agent: remove g_strcmp0 usage
g_strcmp0 isn't in all version of glib 2.0, so don't use it to avoidbuild breakage on older distros.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
guest agent: remove uneeded dependencies
This patch tries to cull any uneeded library dependencies from the guestagent to improve portability across various distros. We do so by beingas explicit as possible about in-tree dependencies rather than relying...
memory: crack wide ioport accesses into smaller ones when needed
The memory API supports cracking wide accesses into narrower oneswhen needed; but this was no implemented for the pio address space,causing lsi53c895a's IO BAR to malfunction.
Fix by correctly cracking wide accesses when needed....