summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* create_config: remove *dir blockEduardo Habkost2012-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now only the qemu_*dir variables will become #defines. The other directory names aren't used by the C code. That means the following #defines won't be available in C code anymore: - CONFIG_QEMU_BINDIR - CONFIG_QEMU_LIBDIR - CONFIG_QEMU_INCLUDEDIR - CONFIG_QEMU_MANDIR - CONFIG_QEMU_SYSCONFDIR - CONFIG_QEMU_LIBEXECDIR The following #defines are going to be kept because they are handled by the qemu_* block on create_config: - CONFIG_QEMU_CONFDIR - CONFIG_QEMU_DATADIR - CONFIG_QEMU_DOCDIR This one will be kept because it is set directly by ./configure: - CONFIG_QEMU_HELPERDIR This patch keeps the 'prefix=*' (CONFIG_QEMU_PREFIX) pattern because other variables may use $prefix on their config-host.mak definitions. The remaining code will be simplified on a further patch. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* config-host.mak: reorder variables a bitEduardo Habkost2012-04-241-2/+2
| | | | | | | Cosmetic change. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* config-host.mak: remove CONFIG_QEMU_SHAREDIREduardo Habkost2012-04-241-1/+0
| | | | | | | | There is no code using that variable according to 'git grep', so kill it. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* config-host.mak: rename docdir to qemu_docdirEduardo Habkost2012-04-242-3/+3
| | | | | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Makefile: use $(qemu_confdir) instead of $(sysconfdir)/qemuEduardo Habkost2012-04-241-2/+2
| | | | | | | | Instead of hardcoding the directory suffix, use the qemu-specific directory variable. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* config-host.mak: rename confdir to qemu_confdirEduardo Habkost2012-04-241-1/+1
| | | | | | | | | | | | | $confdir is a confusing name, as it's not clear if it's "the system config dir" or "the Qemus-specific directory inside the config dir". $qemu_confdir makes it more clear. The current C code that uses CONFIG_QEMU_CONFDIR should be safe, as now create_config generates the same #define name (CONFIG_QEMU_CONFDIR) for both "confdir" and "qemu_confdir" variables. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* config-host.mak: rename datadir to qemu_datadirEduardo Habkost2012-04-243-7/+7
| | | | | | | | | | | | | Autoconf concept of "datadir" is supposed to be "$prefix/share", not "$prefix/share/PACKAGE", so using datadir for the Qemu-specific directory is confusing. The current C code that uses CONFIG_QEMU_DATADIR should be safe, as now create_config generates the same #define name (CONFIG_QEMU_DATADIR) for both "datadir" and "qemu_datadir" variables. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* create_config: separate section for qemu_*dir variables (v2)Eduardo Habkost2012-04-241-0/+9
| | | | | | | | | | | | | | | | | The generic *dir section will eventually go away and be replaced with qemu_* section. By now, both sections will be kept, while the variables get renamed on config-host.mak. With this patch, a XXXdir variable will become a CONFIG_QEMU_XXXDIR define, and a qemu_XXXdir variable will become CONFIG_QEMU_XXXDIR as well (instead of becoming a CONFIG_QEMU_QEMU_XXXDIR define). Changes v1 -> v2: - Rebase on top of newer qemu.git changes, that changed "tr '[:lower:]' '[:upper:]'" to "LC_ALL=C tr '[a-z]' '[A-Z]'". Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* configure: rename $confdir to $qemu_confdirEduardo Habkost2012-04-241-2/+2
| | | | | | | | | There's no "confdir" variable on Autoconf, but it's good to make it clear that it's a variable for the Qemu-specific subdirectory inside $sysconfdir. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* configure: rename $docdir to $qemu_docdirEduardo Habkost2012-04-241-4/+4
| | | | | | | | | The autoconf "docdir" variable is used for the program-specific subdirectory, but anyway it's better to make it clear that the variable is used for the qemu-specific subdirectory path. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* configure: rename $datadir to $qemu_datadirEduardo Habkost2012-04-241-5/+5
| | | | | | | | | | | | The variable is used for the qemu-specific directory and has a different meaning of the autoconf "datadir" variable (that's used for the $prefix/share directory, not for $prefix/share/PACKAGE). This doesn't change behavior or interfaces, it's just an internal variable rename. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* target-microblaze: QOM'ify CPU initAndreas Färber2012-04-242-2/+11
| | | | | | | | Move code from cpu_mb_init() to a QOM initfn. Signed-off-by: Andreas Färber <afaerber@suse.de> Tested-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> [AF: Leave cpu_reset() call in cpu_mb_init()]
* target-microblaze: QOM'ify CPU resetAndreas Färber2012-04-242-50/+52
| | | | | | | Move code from cpu_state_reset() to QOM mb_cpu_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de> Tested-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
* target-microblaze: QOM'ify CPUAndreas Färber2012-04-245-1/+135
| | | | | | | | | | Embed CPUMBState as first member of QOM MicroBlazeCPU. Let CPUClass::reset() call cpu_state_reset() for now. Signed-off-by: Andreas Färber <afaerber@suse.de> Tested-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> [AF: Updated cpu.c to include cpu-qom.h indirectly via cpu.h]
* target-cris: Start QOM'ifying CPU initAndreas Färber2012-04-242-1/+10
| | | | | | Move VR-independent code from cpu_cris_init() into an initfn. Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-cris: QOM'ify CPU resetAndreas Färber2012-04-242-21/+24
| | | | | | | Move code from cpu_state_reset() into QOM cris_cpu_reset(). Let CPU init call cpu_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-cris: QOM'ify CPUAndreas Färber2012-04-245-1/+136
| | | | | | | | Embed CPUCRISState as first member of QOM CRISCPU. Let CPUClass::reset() call cpu_state_reset() for now. Signed-off-by: Andreas Färber <afaerber@suse.de>
* Merge remote-tracking branch 'origin/master' into stagingAnthony Liguori2012-04-231-2/+2
|\ | | | | | | | | * origin/master: qtest: fix memread and memwrite on 32 bit hosts
| * qtest: fix memread and memwrite on 32 bit hostsBlue Swirl2012-04-231-2/+2
| | | | | | | | | | | | | | | | Use PRIx64 to print 64 bit values to avoid truncation on 32 bit hosts. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2012-04-234-24/+34
|\ \ | | | | | | | | | | | | | | | * qmp/queue/qmp: qapi: g_hash_table_find() instead of GHashTableIter. qmp: make block job command naming consistent
| * | qapi: g_hash_table_find() instead of GHashTableIter.NODA, Kai2012-04-231-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | GHashTableIter was first introduced in glib 2.16. This patch removes it in favor of older g_hash_table_find() for better compatibility with RHEL5. Signed-off-by: NODA, Kai <nodakai@gmail.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * | qmp: make block job command naming consistentStefan Hajnoczi2012-04-233-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The block streaming and job commands used '_' instead of '-' for reasons of compatibility with libvirt, which already included support for the '_' naming. However, the semantics of block_job_cancel have changed and libvirt now needs to handle the new semantics. Since the old semantics were never in a QEMU release we can still rename the commands to use '-' instead of '_'. Libvirt is also happy because the new name can be used to distinguish QEMU binaries that support the latest block-job-cancel semantics from those that include a downstream block_job_cancel command. Therefore, let's apply the QAPI/QMP naming rules to the block streaming and job commands. QEMU 1.1 will be the first release with these commands so no upstream users can break. Note that HMP commands are left with '_' because that is the convention there. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | | Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2012-04-2350-567/+1704
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kwolf/for-anthony: (38 commits) qemu-iotests: Fix test 031 for qcow2 v3 support qemu-iotests: Add -o and make v3 the default for qcow2 qcow2: Zero write support qemu-iotests: Test backing file COW with zero clusters qemu-iotests: add a simple test for write_zeroes qcow2: Support for feature table header extension qcow2: Support reading zero clusters qcow2: Version 3 images qcow2: Ignore reserved bits in check_refcounts qcow2: Ignore reserved bits in refcount table entries qcow2: Simplify count_cow_clusters qcow2: Refactor qcow2_free_any_clusters qcow2: Ignore reserved bits in L1/L2 entries qcow2: Fail write_compressed when overwriting data qcow2: Ignore reserved bits in count_contiguous_clusters() qcow2: Ignore reserved bits in get_cluster_offset qcow2: Save disk size in snapshot header Specification for qcow2 version 3 qcow2: Fix refcount block allocation during qcow2_alloc_cluster_at() iotests: Resolve test failures caused by hostname ...
| * | qemu-iotests: Fix test 031 for qcow2 v3 supportKevin Wolf2012-04-203-26/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qcow2.py must be updated to work with version 3 images at all, the output has changed since the feature table extension has been added, and version 2 and version 3 images can't possibly have the same test output. Change the test case to completely ignore IMGOPTS and run the test for both compat=1.1 and compat=0.10 regardless of the ./check command line. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qemu-iotests: Add -o and make v3 the default for qcow2Kevin Wolf2012-04-203-5/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an -o option to qemu-iotests, which is an option string that is passed through to qemu-img create -o... This allows testing different subformat with a command like './check -qcow2 -o compat=0.10'. For qcow2, if no compat option is specified, compat=1.1 is the new default. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Zero write supportKevin Wolf2012-04-204-3/+105
| | | | | | | | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qemu-iotests: Test backing file COW with zero clustersKevin Wolf2012-04-203-0/+195
| | | | | | | | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qemu-iotests: add a simple test for write_zeroesPaolo Bonzini2012-04-203-0/+103
| | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Support for feature table header extensionKevin Wolf2012-04-202-9/+69
| | | | | | | | | | | | | | | | | | | | | Instead of printing an ugly bitmask, qemu can now print a more helpful string even for yet unknown features. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Support reading zero clustersKevin Wolf2012-04-204-4/+33
| | | | | | | | | | | | | | | | | | This adds support for reading zero clusters in version 3 images. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Version 3 imagesKevin Wolf2012-04-203-15/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the basic infrastructure to qcow2 to handle version 3 images. It includes code to create v3 images, allow header updates for v3 images and checks feature bits. It still misses support for zero clusters, so this is not a fully compliant implementation of v3 yet. The default for creating new images stays at v2 for now. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Ignore reserved bits in check_refcountsKevin Wolf2012-04-201-44/+54
| | | | | | | | | | | | | | | | | | | | | Also don't infer the cluster type directly from the L2 entries, but use qcow2_get_cluster_type() to keep everything in a single place. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Ignore reserved bits in refcount table entriesKevin Wolf2012-04-202-1/+3
| | | | | | | | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Simplify count_cow_clustersKevin Wolf2012-04-201-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | count_cow_clusters() tries to reuse existing functions, and all it achieves is to make things much more complicated than they really are: Everything needs COW, unless it's a normal cluster with refcount 1. This patch implements the obvious way of doing this, and by using qcow2_get_cluster_type() it gets rid of all flag magic. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Refactor qcow2_free_any_clustersKevin Wolf2012-04-201-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Zero clusters will add another cluster type. Refactor the open-coded cluster type detection into a switch of QCOW2_CLUSTER_* options so that the detection is in a single place. This makes it easier to add new cluster types. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Ignore reserved bits in L1/L2 entriesKevin Wolf2012-04-202-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the still existing places that assume that the only flags are QCOW_OFLAG_COPIED and QCOW_OFLAG_COMPRESSED to properly mask out reserved bits. It does not convert bdrv_check yet. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Fail write_compressed when overwriting dataKevin Wolf2012-04-201-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qcow2_alloc_compressed_cluster_offset() already fails if the copied flag is set, because qcow2_write_compressed() doesn't perform COW as it would have to do to allow this. However, what we really want to check here is whether the cluster is allocated or not. With internal snapshots the copied flag may not be set on allocated clusters. Check the cluster offset instead. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Ignore reserved bits in count_contiguous_clusters()Kevin Wolf2012-04-201-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, count_contiguous_clusters() has an argument that allowed to specify flags that should be ignored in the comparison, i.e. that are allowed to change between contiguous clusters. This patch changes the function so that it ignores all flags by default now and you need to pass the flags on which it should stop. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Ignore reserved bits in get_cluster_offsetKevin Wolf2012-04-203-19/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, reading from a qcow2 image ignores all reserved bits that are set in an L1 or L2 table entry. Now get_cluster_offset() assigns *cluster_offset only the offset without any other flags. The cluster type is not longer encoded in the offset, but a positive return value in case of success. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Save disk size in snapshot headerKevin Wolf2012-04-202-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows that different snapshots of an image can have different sizes, which is a requirement for enabling image resizing even with images that have internal snapshots. We don't do the actual support for it now, but make sure that the additional field is present and not completely ignored in all version 3 images. When trying to load a snapshot of different size, it returns an error. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | Specification for qcow2 version 3Kevin Wolf2012-04-201-23/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the qcow2 specification to cover version 3. It contains the following changes: - Added compatible/incompatible/auto-clear feature bits plus an optional feature name table to allow useful error messages even if an older version doesn't know some feature at all. - Configurable refcount width. If you don't want to use internal snapshots, make refcounts one bit and save cache space and I/O. - Zero cluster flags. This allows discard even with a backing file that doesn't contain zeros. It is also useful for copy-on-read/image streaming, as you'll want to keep sparseness without accessing the remote image for an unallocated cluster all the time. - Fixed internal snapshot metadata to use 64 bit VM state size. You can't save a snapshot of a VM with >= 4 GB RAM today. - Extended internal snapshot metadata to contain the disk size, so that resizing images that have snapshots can be allowed in the future. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qcow2: Fix refcount block allocation during qcow2_alloc_cluster_at()Kevin Wolf2012-04-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refcount block allocation and refcount table growth rely on s->free_cluster_index pointing to somewhere after the current allocation. Change qcow2_alloc_cluster_at() to fulfill this assumption. Without this change it could happen that a newly allocated refcount block and the allocated data block point to the same area in the image file, causing data corruption in the long run. This fixes a bug that became first visible after commit 250196f1. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | iotests: Resolve test failures caused by hostnameAndreas Färber2012-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `hostname -s` may output an errror: hostname: Name or service not known This causes all tests to fail for `make check-block`. Suppress such error messages, letting the tests succeed. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qemu-img: let 'qemu-img convert' flush dataLiu Yuan2012-04-202-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'qemu-img convert -h' advertise that the default cache mode is 'writeback', while in fact it is 'unsafe'. This patch 1) fix the help manual and 2) let bdrv_close() call bdrv_flush() 2) is needed because some backend storage doesn't have a self-flush mechanism(for e.g., sheepdog), so we need to call bdrv_flush() to make sure the image is really writen to the storage instead of hanging around writeback cache forever. Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | aio: simplify qemu_aio_waitPaolo Bonzini2012-04-191-69/+64
| | | | | | | | | | | | | | | | | | | | | | | | The do...while loop can never loop, because select will just not return 0 when invoked with infinite timeout. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | aio: return "AIO in progress" state from qemu_aio_waitPaolo Bonzini2012-04-192-28/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The definition of when qemu_aio_flush should loop is much simpler than it looks. It just has to call qemu_aio_wait until it makes no progress and all flush callbacks return false. qemu_aio_wait is the logical place to tell the caller about this. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | aio: remove process_queue callback and qemu_aio_process_queuePaolo Bonzini2012-04-199-64/+21
| | | | | | | | | | | | | | | | | | | | | Both unused after the previous patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | posix-aio: merge posix_aio_process_queue and posix_aio_readPaolo Bonzini2012-04-191-28/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | posix_aio_read already calls qemu_aio_process_queue, and dually qemu_aio_process_queue is always followed by a select loop that calls posix_aio_read. No races are possible, so there is no need for a separate process_queue callback. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qemu-tool: map vm_clock to rt_clockPaolo Bonzini2012-04-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | QED uses vm_clock timers so that images are not touched during and after migration. This however does not apply to qemu-io and qemu-img. Treat vm_clock as a synonym for rt_clock there, and enable it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qemu-io: use main_loop_waitPaolo Bonzini2012-04-192-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | This will let timers run during aio_read and aio_write commands, though not during synchronous commands. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud