readline: decouple readline from the monitor
Make the readline.c functionality reusable. Instead of callingmonitor_printf() and monitor_flush() directly, invoke function pointersprovided by the user.
This way readline.c does not know about Monitor and other users will be...
readline: move readline to a generic location
Now that the monitor and readline are decoupled, readline.h no longerbelongs in include/monitor/. Put the header into include/qemu/.
Move the source file into util/ so it can be linked as part oflibqemuutil.a....
osdep: add qemu_set_tty_echo()
Using stdin with readline.c requires disabling echo and line buffering.Add a portable wrapper to set the terminal attributes under Linux andWindows.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-io: use readline.c
Use readline.c for command-line history. There was support for GNUReadline and BSD Editline but it was never compiled in. Since QEMU hasits own readline.c, just use that when qemu-io runs with stdin attachedto a terminal.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>...
qemu-io: add command completion
Autocomplete qemu-io commands at the interactive prompt.
Note this only completes command names and not their options.
blkdebug: Use errp for read_config()
Use an Error variable in the read_config() function.
Signed-off-by: Max Reitz <mreitz@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blkdebug: Don't require sophisticated filename
If the filename is not prefixed by "blkdebug:" inblkdebug_parse_filename(), the blkdebug driver was not selected throughthat protocol prefix, but by an explicit command line option(file.driver=blkdebug or something similar). Contrary to the current...
qdict: Add qdict_array_split()
This function splits a QDict consisting of entries prefixed byincrementally enumerated indices into a QList of QDicts.
Signed-off-by: Max Reitz <mreitz@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
qapi: extend qdict_flatten() for QLists
Reversing qdict_array_split(), qdict_flatten() should flatten QLists aswell by interpreting them as QDicts where every entry's key is itsindex.
This allows bringing QDicts with QLists from QMP commands to the same...
qemu-option: Add qemu_config_parse_qdict()
This function basically parses command-line options given as a QDictreplacing a config file.
For instance, the QDict {"section.opt1": 42, "section.opt2": 23}corresponds to the config file:
[section]opt1 = 42...
blkdebug: Always call read_config()
Move the check whether there actually is a config file into theread_config() function.
blkdebug: Use command-line in read_config()
Use qemu_config_parse_qdict() to parse the command-line options inaddition to the config file.
Signed-off-by: Max Reitz <mreitz@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Allow reference for bdrv_file_open()
Allow specifying a reference to an existing block device (by name) forbdrv_file_open() instead of a filename and/or options.
Signed-off-by: Max Reitz <mreitz@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>...
rbd: switch from pipe to QEMUBH completion notification
rbd callbacks are called from non-QEMU threads. Up until now a pipe wasused to signal completion back to the QEMU iothread.
The pipe writer code handles EAGAIN using select(2). The select(2) API...
qemu-iotests: Introduce _unsupported_imgopts
Introduce _unsupported_imgopts that causes _notrun for specific imageoptions.
Signed-off-by: Fam Zheng <famz@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-iotests: Add _unsupported_imgopts for vmdk subformats
Some cases are not applicable for vmdk subformats those don't supportcertain features, e.g. backing file, and some others can't run onmult-file image, e.g. monolithicFlat. This adds declaration in test...
qemu-iotests: Clean up all extents for vmdk
This modifies _cleanup_test_img to remove all the extent files listed by"qemu-img info"'s format specific information.
Signed-off-by: Fam Zheng <famz@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>...
block/iscsi: return -ENOMEM if an async call fails immediately
if an async libiscsi call fails directly it can only be dueto an out of memory condition. All other errors are returnedthrough the callback.
Signed-off-by: Peter Lieven <pl@kamp.de>Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>...
gluster: Convert aio routines into coroutines
Convert the read, write, flush and discard implementations from aio-basedones to coroutine based ones.
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>...
gluster: Implement .bdrv_co_write_zeroes for gluster
Support .bdrv_co_write_zeroes() from gluster driver by using GlusterFS APIglfs_zerofill() that off-loads the writing of zeroes to GlusterFS server.
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>...
gluster: Add support for creating zero-filled image
GlusterFS supports creation of zero-filled file on GlusterFS volumeby means of an API called glfs_zerofill(). Use this API from QEMU tocreate an image that is filled with zeroes by using the preallocation...
sheepdog: fix clone operation by 'qemu-img create -b'
We should pass base_inode->vdi_id to base_vdi_id of SheepdogVdiReq so that sheepcan create a clone instead a fresh volume.
This fixes following command:
qemu-create -b sheepdog:base sheepdog:clone...
qtest: Fix the bug about disable vnc causes "make check" fail
When we disable vnc from "./configure", QEMU can't use the vnc option.So qtest can't use the "vnc -none ", otherwise "make check" fails.If QEMU uses "-display none", "-vnc none" is excrescent, So we just need to drop it....
docs: qcow2 compat=1.1 is now the default
Commit 9117b47717ad208b12786ce88eacb013f9b3dd1c ("qcow2: Change defaultfor new images to compat=1.1") changed the default qcow2 image formatversion but forgot to update qemu-doc.texi and qemu-img.texi.
vmdk: Fix big flat extent IO
Local variable "n" as int64_t avoids overflow with large sector numbercalculation. See test case change for failure case.
Signed-off-by: Fam Zheng <famz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Revert "error: Don't use error_report() for assertion msgs."
This reverts commit d32934c84c72f57e78d430c22974677b7bcabe5d.
The original implementation before this patch makes abortive errormessages much more friendly. The underlying bug that required this...
tests: Add libqemustub to qom-interface-check
The recent addition of util/error.c's dependency on error_report()causes this test to fail to link due to a number of missing monitorrelated symbols. All these symbols are however defined by libqemustub.Add this libary to the link....
SPARC: Fix LEON3 power down instruction
Synchronize the program counter before the power down helper callotherwise interrupts will return to the wrong context.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>Reviewed-by: Richard Henderson <rth@twiddle.net>...
error: Don't use error_report() for assertion msgs.
Use fprintf(stderr instead. This removes dependency of libqemuutil.aon the monitor.
We can further justify this change, in that this code path should onlytrigger under a fatal error condition. fprintf-stderr is probably the...
Merge remote branch 'luiz/queue/qmp' into qmpq
Microblaze: Convert Microblaze-pic handling to GPIOs
This patch uses inbound GPIO lines (IRQ and FIR) forinterrupts instead of using the old pic_cpu method,which doesn't correspond to real hardware.
This creates the CPU's inbound IRQ and FIR GPIO lines and...
target-arm: Switch ARMCPUInfo arrays to use terminator entries
Switch the ARMCPUInfo arrays in cpu.c and cpu64.c to use a terminatorentry rather than looping based on ARRAY_SIZE. The latter causescompile warnings on some versions of gcc if the configure options...
Merge remote-tracking branch 'quintela/tags/migration/20140113' into staging
migration.next for 20140113
kvm: use directly cpu_physical_memory_* api for tracking dirty pages
Performance is important in this function, and we want to optimize even further.
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>
kvm: refactor start address calculation
memory: move bitmap synchronization to its own function
We want to have all the functions that handle directly the dirtybitmap near. We will change it later.
memory: syncronize kvm bitmap using bitmaps operations
If bitmaps are aligned properly, use bitmap operations. If they arenot, just use old bit at a time code.
ram: split function that synchronizes a range
This function is the only bit where we care about speed.
migration: synchronize memory bitmap 64bits at a time
We use the old code if the bitmaps are not aligned
memory: cpu_physical_memory_mask_dirty_range() always clears a single flag
Document it
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>
memory: use bit 2 for migration
For historical reasons it was bit 3. Once there, create a constant toknow the number of clients.
memory: make sure that client is always inside range
memory: only resize dirty bitmap when memory size increases
memory: cpu_physical_memory_clear_dirty_flag() result is never used
bitmap: Add bitmap_zero_extend operation
memory: split dirty bitmap into three
After all the previous patches, spliting the bitmap gets direct.
Note: For some reason, I have to move DIRTY_MEMORY_* definitions tothe beginning of memory.h to make compilation work.
Signed-off-by: Juan Quintela <quintela@redhat.com>...
memory: unfold cpu_physical_memory_clear_dirty_flag() in its only user
memory: unfold cpu_physical_memory_set_dirty() in its only user
memory: unfold cpu_physical_memory_set_dirty_flag()
memory: make cpu_physical_memory_get_dirty() the main function
And make cpu_physical_memory_get_dirty_flag() to use it. It used tobe the other way around.
memory: cpu_physical_memory_get_dirty() is used as returning a bool
memory: s/mask/clear/ cpu_physical_memory_mask_dirty_range
Now all functions use the same wording that bitops/bitmap operations
memory: use find_next_bit() to find dirty bits
This operation is way faster than doing it bit by bit.
memory: cpu_physical_memory_set_dirty_range() now uses bitmap operations
We were setting a range of bits, so use bitmap_set().
Note: xen has always been wrong, and should have used start insteadof addr from the beginning.
memory: cpu_physical_memory_clear_dirty_range() now uses bitmap operations
We were clearing a range of bits, so use bitmap_clear().
memory: s/dirty/clean/ in cpu_physical_memory_is_dirty()
All uses except one really want the other meaning.
memory: make cpu_physical_memory_reset_dirty() take a length parameter
We have an end parameter in all the callers, and this make it coherentwith the rest of cpu_physical_memory_* functions, that also take alength parameter.
Once here, move the start/end calculation to...
memory: cpu_physical_memory_set_dirty_tracking() should return void
Result was always 0, and not used anywhere. Once there, use bool typefor the parameter.
memory: split cpu_physical_memory_* functions to its own include
All the functions that use ram_addr_t should be here.
memory: unfold memory_region_test_and_clear()
We are going to update the bitmap directly
tests: Some unit tests for vmstate.c
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
bitmap: use long as index
Move index and size fields from int to long. We need that formigration. long is 64 bits on sane architectures, and 32bits shouldbe enough on all the 32bits architectures.
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
memory: cpu_physical_memory_set_dirty_flags() result is never used
So return void.
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
memory: cpu_physical_memory_set_dirty_range() return void
exec: use accessor function to know if memory is dirty
memory: create function to set a single dirty bit
exec: create function to get a single dirty bit
memory: make cpu_physical_memory_is_dirty return bool
memory: all users of cpu_physical_memory_get_dirty used only one flag
So cpu_physical_memory_get_dirty_flags is not needed anymore
memory: set single dirty flags when possible
memory: cpu_physical_memory_set_dirty_range() always dirty all flags
So remove the flag argument and do it directly. After this change,there is nothing else using cpu_physical_memory_set_dirty_flags() soremove it.
savevm.c: Coding style fixes
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>Signed-off-by: Juan Quintela <quintela@redhat.com>
savevm.c: Coding style fix
vmstate: Move VMState code to vmstate.c
This will allow unit tests to be written for VMState code withoutpulling dependencies from the savevm code.
qemu-file: Move QEMUFile code to qemu-file.c
savevm: Small comment about why timer QEMUFile/VMState code is in savevm.c
avoid a bogus COMPLETED->CANCELLED transition
Avoid a bogus COMPLETED->CANCELLED transition.There is a period of time from the timing of setting COMPLETED state to that of migration thread exits, so during which it's problematic in COMPLETED->CANCELLED transition....
introduce MIG_STATE_CANCELLING state
Introduce MIG_STATE_CANCELLING state to avoid starting a new migration task while the previous one still exist.
Signed-off-by: Zeng Junliang <zengjunliang@huawei.com>Signed-off-by: Zhang Haoyu <haoyu.zhang@huawei.com>...
migration: Fix rate limit
The migration thread appears to want to allow writeout to occur at fullspeed rather than being rate limited during completion of state saving,but sets the limit to INT_MAX when xfer_limit is INT64_MAX. This causesproblems if there's more than 2GB of state left to save at this point. It...
qemu-file: Make a few functions non-static
The QEMUFile code will be moved to qemu-file.c. This will require makingthe following functions non-static because they are used by the savevm.ccode:
migration: Move QEMU_VM_* defines to migration/migration.h
The VMState code will be moved to vmstate.c and it uses some of theQEMU_VM_* constants, so move it to a header.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>Reviewed-by: Orit Wasserman <owasserm@redhat.com>...
savevm: Convert all tabs to spaces
Merge remote-tracking branch 'pmaydell/tags/pull-cocoa-20140112' into staging
cocoa queue: * pass command key to guest when VM has mousegrab * add .qcow2 to extension list for image load dialog * fix bugs in code for starting QEMU via image load dialog...
Merge remote-tracking branch 'pmaydell/tags/pull-target-arm-20140112' into staging
target-arm queue: * build fix for bigendian hosts
ui/cocoa: Add ".qcow2" to extension list for image load dialog
Add ".qcow2" to the list of file extensions which are acceptedby the initial disk image load dialog which is displayed if theuser runs QEMU without any command line arguments.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
ui/cocoa: Fix code for starting QEMU via image file load dialog
Fix a number of bugs in the code for starting QEMU via the imagefile load dialog: * use the actual argv0 rather than "qemu": this avoids failures to find BIOS image files caused by not looking in the correct directory...
ui/cocoa: Redraw at correct size when switching surface
If the surface switch involved a resize, we were doing the redrawat the old size rather than the new, because the update ofscreen.width and screen.height was being done after the setFramemethod calls which triggered a redraw. Normally this isn't very...
ui/cocoa: Draw black rectangle if we have no data yet
If our redraw method is called before we have any data from the guest,then draw a black rectangle rather than leaving the window empty.This mostly only matters when the guest machine has no framebuffer...
ui/cocoa: Remove stray tabs
The ui/cocoa.m file has just three lines with hardcoded tabs; fix them.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Stefan Weil <sw@weilnetz.de>Message-id: 1387886052-27067-1-git-send-email-peter.maydell@linaro.org
MAINTAINERS: add myself as cocoa UI co-maintainer
Add myself to the maintainers list for the cocoa UI; statusremains "Odd Fixes".
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Acked-by: Andreas Färber <andreas.faerber@web.de>Message-id: 1387207075-10280-1-git-send-email-peter.maydell@linaro.org
ui/cocoa: Send warning message to stderr, not stdout
Bring a warning message into line with the others in this file bysending it to stderr, not stdout.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1386543546-31919-4-git-send-email-peter.maydell@linaro.org
ui/cocoa: Pass command key through to guest when VM has mousegrab
The guest might want to be able to use the command key for its wonpurposes (as command if it is MacOS X, or for the Windows key ifit is a PC guest, for instance). In line with other UI frontends,...
ui/cocoa: Correct typos in comments and variable names
Fix various non-user-visible typos in comments and variable names.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Stefan Weil <sw@weilnetz.de>Message-id: 1386543546-31919-3-git-send-email-peter.maydell@linaro.org
arm: fix compile on bigendian host
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Merge remote-tracking branch 'bonzini/scsi-next' into staging
Message-id: 1387720926-11421-1-git-send-email-pbonzini@redhat.com...
Merge remote-tracking branch 'stefanha/block' into staging
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
acpi,pci,pc,fedora,virtio fixes and enhancements
This includes some Preparatory patches for cpu hotplug for q25 and memoryhotplug by Igor, tests and memory mapping changeby Laszlo and pci reset cleanup by Paolo....
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
QOM CPUState refactorings / X86CPU
Merge remote-tracking branch 'pmaydell/tags/pull-target-arm-20140107' into staging
target-arm queue: * further A64 decoder patches, including enabling the aarch64-linux-user target; this includes full floating point support. Neon is not yet supported....
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging
Message-id: 1389364137-23287-1-git-send-email-riku.voipio@linaro.org...