summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-01-22qapi: extend qdict_flatten() for QListsMax Reitz1-6/+48
Reversing qdict_array_split(), qdict_flatten() should flatten QLists as well by interpreting them as QDicts where every entry's key is its index. This allows bringing QDicts with QLists from QMP commands to the same form as they would be given as command-line options, thereby allowing them to be parsed the same way. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22qdict: Add qdict_array_split()Max Reitz2-0/+38
This function splits a QDict consisting of entries prefixed by incrementally 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> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22blkdebug: Don't require sophisticated filenameMax Reitz1-1/+3
If the filename is not prefixed by "blkdebug:" in blkdebug_parse_filename(), the blkdebug driver was not selected through that protocol prefix, but by an explicit command line option (file.driver=blkdebug or something similar). Contrary to the current reaction, this is not a problem at all; we just need to store the filename (in the x-image option) and can go on; the user just has to manually specify the config option. 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>
2014-01-22blkdebug: Use errp for read_config()Max Reitz1-4/+6
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>
2014-01-22qemu-io: add command completionStefan Hajnoczi3-1/+25
Autocomplete qemu-io commands at the interactive prompt. Note this only completes command names and not their options. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22qemu-io: use readline.cStefan Hajnoczi1-45/+58
Use readline.c for command-line history. There was support for GNU Readline and BSD Editline but it was never compiled in. Since QEMU has its own readline.c, just use that when qemu-io runs with stdin attached to a terminal. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22osdep: add qemu_set_tty_echo()Stefan Hajnoczi3-0/+39
Using stdin with readline.c requires disabling echo and line buffering. Add a portable wrapper to set the terminal attributes under Linux and Windows. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22readline: move readline to a generic locationStefan Hajnoczi6-4/+4
Now that the monitor and readline are decoupled, readline.h no longer belongs in include/monitor/. Put the header into include/qemu/. Move the source file into util/ so it can be linked as part of libqemuutil.a. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22readline: decouple readline from the monitorStefan Hajnoczi4-38/+71
Make the readline.c functionality reusable. Instead of calling monitor_printf() and monitor_flush() directly, invoke function pointers provided by the user. This way readline.c does not know about Monitor and other users will be able to make use of readline.c. Note that there is already an "opaque" argument to the ReadLineFunc callback. Consistently call it "readline_opaque" from now on to distinguish from the ReadLinePrintfFunc/ReadLineFlushFunc "opaque" argument. I also dropped the printf macro trickery since it's now highly unlikely that anyone modifying readline.c would call printf(3) directly. We no longer need this protection. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22vmdk: Fix big flat extent IOFam Zheng3-2/+83
Local variable "n" as int64_t avoids overflow with large sector number calculation. See test case change for failure case. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22docs: qcow2 compat=1.1 is now the defaultStefan Hajnoczi2-8/+8
Commit 9117b47717ad208b12786ce88eacb013f9b3dd1c ("qcow2: Change default for new images to compat=1.1") changed the default qcow2 image format version but forgot to update qemu-doc.texi and qemu-img.texi. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22qtest: Fix the bug about disable vnc causes "make check" failKewei Yu2-7/+1
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. Signed-off-by: Kewei Yu <keweihk@gmail.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22sheepdog: fix clone operation by 'qemu-img create -b'Liu Yuan1-8/+8
We should pass base_inode->vdi_id to base_vdi_id of SheepdogVdiReq so that sheep can create a clone instead a fresh volume. This fixes following command: qemu-create -b sheepdog:base sheepdog:clone so users can boot sheepdog:clone as a normal volume. Cc: qemu-devel@nongnu.org Cc: Kevin Wolf <kwolf@redhat.com> Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Liu Yuan <namei.unix@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22gluster: Add support for creating zero-filled imageBharata B Rao1-1/+49
GlusterFS supports creation of zero-filled file on GlusterFS volume by means of an API called glfs_zerofill(). Use this API from QEMU to create an image that is filled with zeroes by using the preallocation option of qemu-img. qemu-img create gluster://server/volume/image -o preallocation=full 10G The allowed values for preallocation are 'full' and 'off'. By default preallocation is off and image is not zero-filled. glfs_zerofill() offloads the writing of zeroes to the server and if the storage supports SCSI WRITESAME, GlusterFS server can issue BLKZEROOUT ioctl to achieve the zeroing. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22gluster: Implement .bdrv_co_write_zeroes for glusterBharata B Rao2-19/+68
Support .bdrv_co_write_zeroes() from gluster driver by using GlusterFS API glfs_zerofill() that off-loads the writing of zeroes to GlusterFS server. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22gluster: Convert aio routines into coroutinesBharata B Rao1-147/+74
Convert the read, write, flush and discard implementations from aio-based ones to coroutine based ones. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22block/iscsi: return -ENOMEM if an async call fails immediatelyPeter Lieven1-6/+6
if an async libiscsi call fails directly it can only be due to an out of memory condition. All other errors are returned through the callback. Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22qemu-iotests: Clean up all extents for vmdkFam Zheng1-3/+14
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> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22qemu-iotests: Add _unsupported_imgopts for vmdk subformatsFam Zheng9-0/+21
Some cases are not applicable for vmdk subformats those don't support certain features, e.g. backing file, and some others can't run on mult-file image, e.g. monolithicFlat. This adds declaration in test cases to skip them automatically, so that iotests on vmdk can go more smoothly (without manually picking of cases for each subformat). Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22qemu-iotests: Introduce _unsupported_imgoptsFam Zheng1-0/+11
Introduce _unsupported_imgopts that causes _notrun for specific image options. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-22rbd: switch from pipe to QEMUBH completion notificationStefan Hajnoczi1-108/+22
rbd callbacks are called from non-QEMU threads. Up until now a pipe was used to signal completion back to the QEMU iothread. The pipe writer code handles EAGAIN using select(2). The select(2) API is not scalable since fd_set size is static. FD_SET() can write beyond the end of fd_set if the file descriptor number is too high. (QEMU's main loop uses poll(2) to avoid this issue with select(2).) Since the pipe itself is quite clumsy to use and QEMUBH is now thread-safe, just schedule a BH from the rbd callback function. This way we can simplify I/O completion in addition to eliminating the potential FD_SET() crash when file descriptor numbers become too high. Crash scenario: QEMU already has 1024 file descriptors open. Hotplug an rbd drive and get the pipe writer to take the select(2) code path. Reviewed-by: Josh Durgin <josh.durgin@inktank.com> Tested-by: Josh Durgin <josh.durgin@inktank.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-17Revert "error: Don't use error_report() for assertion msgs."Peter Crosthwaite1-4/+4
This reverts commit d32934c84c72f57e78d430c22974677b7bcabe5d. The original implementation before this patch makes abortive error messages much more friendly. The underlying bug that required this change is now fixed. Revert. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2014-01-17tests: Add libqemustub to qom-interface-checkPeter Crosthwaite1-1/+1
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 monitor related symbols. All these symbols are however defined by libqemustub. Add this libary to the link. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2014-01-15SPARC: Fix LEON3 power down instructionSebastian Huber1-0/+1
Synchronize the program counter before the power down helper call otherwise interrupts will return to the wrong context. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de> Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2014-01-15error: Don't use error_report() for assertion msgs.Peter Crosthwaite1-4/+4
Use fprintf(stderr instead. This removes dependency of libqemuutil.a on the monitor. We can further justify this change, in that this code path should only trigger under a fatal error condition. fprintf-stderr is probably the appropriate medium as under a fatal error conidition the monitor itself may be down and out for the count. So assertion failure messages should go lowest common denominator - straight to stderr. Fixes the build as reported by Kevin Wolf. Issue debugged and change suggested by Luiz Capitulino. Issue introduced by 5d24ee70bcbcf578614193526bcd5ed30a8eb16c. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2014-01-14Merge remote branch 'luiz/queue/qmp' into qmpqEdgar E. Iglesias45-155/+405
* luiz/queue/qmp: migration: qmp_migrate(): keep working after syntax error qerror: Remove assert_no_error() qemu-option: Remove qemu_opts_create_nofail target-i386: Remove assert_no_error usage hw: Remove assert_no_error usages qdev: Delete dead code error: Add error_abort monitor: add object-add (QMP) and object_add (HMP) command monitor: add object-del (QMP) and object_del (HMP) command qom: catch errors in object_property_add_child qom: fix leak for objects created with -object rng: initialize file descriptor to -1 qemu-monitor: HMP cpu-add wrapper vl: add missing transition debug->finish_migrate Message-Id: 1389045795-18706-1-git-send-email-lcapitulino@redhat.com Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2014-01-14Microblaze: Convert Microblaze-pic handling to GPIOsAlistair Francis7-68/+31
This patch uses inbound GPIO lines (IRQ and FIR) for interrupts 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 updates the Microblaze boards to use this new method. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Suggested-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reveiwed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2014-01-14target-arm: Switch ARMCPUInfo arrays to use terminator entriesPeter Maydell2-12/+12
Switch the ARMCPUInfo arrays in cpu.c and cpu64.c to use a terminator entry rather than looping based on ARRAY_SIZE. The latter causes compile warnings on some versions of gcc if the configure options happen to result in an empty array. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2014-01-13Merge remote-tracking branch 'quintela/tags/migration/20140113' into stagingAnthony Liguori22-1755/+2241
migration.next for 20140113 # gpg: Signature made Mon 13 Jan 2014 09:38:27 AM PST using RSA key ID 5872D723 # gpg: Can't check signature: public key not found * quintela/tags/migration/20140113: (49 commits) migration: synchronize memory bitmap 64bits at a time ram: split function that synchronizes a range memory: syncronize kvm bitmap using bitmaps operations memory: move bitmap synchronization to its own function kvm: refactor start address calculation kvm: use directly cpu_physical_memory_* api for tracking dirty pages memory: unfold memory_region_test_and_clear() memory: split cpu_physical_memory_* functions to its own include memory: cpu_physical_memory_set_dirty_tracking() should return void memory: make cpu_physical_memory_reset_dirty() take a length parameter memory: s/dirty/clean/ in cpu_physical_memory_is_dirty() memory: cpu_physical_memory_clear_dirty_range() now uses bitmap operations memory: cpu_physical_memory_set_dirty_range() now uses bitmap operations memory: use find_next_bit() to find dirty bits memory: s/mask/clear/ cpu_physical_memory_mask_dirty_range memory: cpu_physical_memory_get_dirty() is used as returning a bool memory: make cpu_physical_memory_get_dirty() the main function memory: unfold cpu_physical_memory_set_dirty_flag() memory: unfold cpu_physical_memory_set_dirty() in its only user memory: unfold cpu_physical_memory_clear_dirty_flag() in its only user ... Message-id: 1389634834-24181-1-git-send-email-quintela@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2014-01-13migration: synchronize memory bitmap 64bits at a timeJuan Quintela1-9/+29
We use the old code if the bitmaps are not aligned Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13ram: split function that synchronizes a rangeJuan Quintela1-14/+20
This function is the only bit where we care about speed. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: syncronize kvm bitmap using bitmaps operationsJuan Quintela1-18/+36
If bitmaps are aligned properly, use bitmap operations. If they are not, just use old bit at a time code. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: move bitmap synchronization to its own functionJuan Quintela2-25/+33
We want to have all the functions that handle directly the dirty bitmap near. We will change it later. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13kvm: refactor start address calculationJuan Quintela1-4/+4
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13kvm: use directly cpu_physical_memory_* api for tracking dirty pagesJuan Quintela1-2/+5
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>
2014-01-13memory: unfold memory_region_test_and_clear()Juan Quintela1-3/+7
We are going to update the bitmap directly Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: split cpu_physical_memory_* functions to its own includeJuan Quintela5-76/+101
All the functions that use ram_addr_t should be here. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: cpu_physical_memory_set_dirty_tracking() should return voidJuan Quintela1-6/+4
Result was always 0, and not used anywhere. Once there, use bool type for the parameter. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: make cpu_physical_memory_reset_dirty() take a length parameterJuan Quintela4-20/+12
We have an end parameter in all the callers, and this make it coherent with the rest of cpu_physical_memory_* functions, that also take a length parameter. Once here, move the start/end calculation to tlb_reset_dirty_range_all() as we don't need it here anymore. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: s/dirty/clean/ in cpu_physical_memory_is_dirty()Juan Quintela3-7/+7
All uses except one really want the other meaning. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: cpu_physical_memory_clear_dirty_range() now uses bitmap operationsJuan Quintela1-6/+4
We were clearing a range of bits, so use bitmap_clear(). Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: cpu_physical_memory_set_dirty_range() now uses bitmap operationsJuan Quintela1-12/+7
We were setting a range of bits, so use bitmap_set(). Note: xen has always been wrong, and should have used start instead of addr from the beginning. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: use find_next_bit() to find dirty bitsJuan Quintela1-10/+6
This operation is way faster than doing it bit by bit. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: s/mask/clear/ cpu_physical_memory_mask_dirty_rangeJuan Quintela2-4/+4
Now all functions use the same wording that bitops/bitmap operations Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: cpu_physical_memory_get_dirty() is used as returning a boolJuan Quintela1-7/+8
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: make cpu_physical_memory_get_dirty() the main functionJuan Quintela1-17/+19
And make cpu_physical_memory_get_dirty_flag() to use it. It used to be the other way around. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: unfold cpu_physical_memory_set_dirty_flag()Juan Quintela1-3/+6
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: unfold cpu_physical_memory_set_dirty() in its only userJuan Quintela1-8/+3
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: unfold cpu_physical_memory_clear_dirty_flag() in its only userJuan Quintela1-8/+2
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
2014-01-13memory: split dirty bitmap into threeJuan Quintela4-15/+16
After all the previous patches, spliting the bitmap gets direct. Note: For some reason, I have to move DIRTY_MEMORY_* definitions to the beginning of memory.h to make compilation work. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>