Kevin Wolf [Thu, 23 Feb 2012 09:33:55 +0000 (10:33 +0100)]
Merge qemu-iotests into for-anthony
Lucas Meneghel Rodrigues [Thu, 1 Dec 2011 13:41:24 +0000 (11:41 -0200)]
qemu-iotests: common.config: Allow use of arbitrary qemu* paths
Since we might want to test arbitrary qemu, qemu-img and
qemu-io paths, allow users to specify environment variable
values for QEMU_PROG, QEMU_IMG_PROG and QEMU_IO_PROG so
the testsuite will use those values rather than find them
on PATH. Obviously, if such env variables are not set
prior to script execution, normal detection mechanism
takes place.
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Lucas Meneghel Rodrigues [Thu, 1 Dec 2011 13:41:23 +0000 (11:41 -0200)]
qemu-iotests: check: print relevant path information
Print the paths of the programs under test
(qemu, qemu-img and qemu-io).
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Fri, 5 Aug 2011 14:37:25 +0000 (16:37 +0200)]
qemu-iotests: test loading internal snapshots
Test loading internal snapshots where the L1 table of the snapshot
is smaller than the current L1 table.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Wed, 8 Jun 2011 11:23:33 +0000 (13:23 +0200)]
qemu-iotests: Update filter for default cluster size
Until recently, qemu-img create displayed cluster_size=0 for the default
cluster size. It is changed to display the real cluster size now, which results
in the cluster size not being filtered out any more.
If the cluster size is specified explicitly in CLUSTER_SIZE, keep the output,
and if using the default, filter it out. This mostly restores the old behaviour
of the test cases; test 015 must be fixed to use CLUSTER_SIZE instead of using
extra_img_options for it.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stefan Hajnoczi [Mon, 16 May 2011 12:59:12 +0000 (13:59 +0100)]
qemu-iotests: add qed support to 025 image resize test
QED now supports the truncate (aka resize) operation for growing images.
Update test 025 so it runs for QED.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Josh Durgin [Wed, 13 Apr 2011 00:47:45 +0000 (17:47 -0700)]
qemu-iotests: Update rbd support
rbd implements bdrv_truncate, so test 025 will work.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Mitnick Lyu [Mon, 11 Apr 2011 20:05:44 +0000 (04:05 +0800)]
qemu-iotests: common.config: Fix no $TEST_DIR directory
mkdir $TEST_DIR on common.config first run
Signed-off-by: Mitnick Lyu <mitnick.lyu@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig [Thu, 21 Apr 2011 06:26:04 +0000 (08:26 +0200)]
qemu-iotests: only run 016 for file and sheepdog protocols
016 writes past EOF which isn't support by most protocols, so limit
it to file and sheepdog, which explicitly support it.
Pointed out by Josh Durgin <josh.durgin@dreamhost.com>.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stefan Hajnoczi [Fri, 4 Feb 2011 12:55:02 +0000 (12:55 +0000)]
qemu-iotests: Use zero-based offsets for IO patterns
The io_pattern style functions have the following loop:
for i in `seq 1 $count`; do
echo ... $(( start + i * step )) ...
done
Offsets are 1-based so start=1024, step=512, count=4 yields:
1536, 2048, 2560, 3072
Normally we expect:
1024, 1536, 2048, 2560
Most tests ignore this detail, which means that they perform I/O to a
slightly different range than expected by the test author.
Later on things got less innocent and tests started trying to compensate
for the 1-based indexing. This included negative start values in test
024 and my own attempt with count-1 in test 028!
The end result is that tests that use io_pattern are hard to reason
about and don't work the way you'd expect. It's time to clean this mess
up.
This patch switches io_pattern to 0-based offsets. This requires
adjusting the golden outputs since I/O ranges are now shifted and output
differs.
Verifying these output diffs is easy, however. Each diff hunk moves one
I/O from beyond the end of the pattern range to the beginning.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
MORITA Kazutaka [Mon, 17 Jan 2011 17:01:17 +0000 (02:01 +0900)]
qemu-iotests: add support for rbd and sheepdog protocols
This patch introduces tests for protocols other than file, and
initially supports rbd and sheepdog.
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stefan Hajnoczi [Wed, 24 Nov 2010 16:12:21 +0000 (17:12 +0100)]
qemu-iotests: filter IMGFMT correctly in 019
Test 019 can be run with qcow2 and qed image formats. Replace the
specific image format value with "IMGFMT" so the golden output does not
hardcode qcow2 or qed.
This patch also includes a typo fix for "occurrences".
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stefan Weil [Sun, 7 Nov 2010 13:56:57 +0000 (14:56 +0100)]
qemu-iotests: README: Fix spelling
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stefan Hajnoczi [Sun, 31 Oct 2010 20:10:20 +0000 (16:10 -0400)]
qemu-iotests: add support for qed format
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig [Sun, 31 Oct 2010 20:07:46 +0000 (16:07 -0400)]
qemu-iotests: filter TEST_DIR correctly in 019
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Anthony Liguori [Mon, 20 Feb 2012 22:28:30 +0000 (16:28 -0600)]
qom: add test tools
Tested-by: Andreas F=E4rber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Anthony Liguori [Mon, 20 Feb 2012 22:28:29 +0000 (16:28 -0600)]
qmp: make qmp.py easier to use
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Kevin Wolf [Sun, 31 Oct 2010 20:05:21 +0000 (16:05 -0400)]
qemu-iotests: fix 019 golden output
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Fri, 15 Oct 2010 21:08:51 +0000 (14:08 -0700)]
qemu-iotests: update expected results after qemu-img changes
The error message for leaked clusters has changed. qemu-iotests needs to be
updated to pass 026 again.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stefan Hajnoczi [Fri, 15 Oct 2010 14:56:35 +0000 (07:56 -0700)]
qemu-iotests: add read/write from smaller backing image test
Some image formats support backing images that are smaller than the
image file. This patch adds a test that verifies that reads and writes
beyond the end of backing image work.
Unallocated reads beyond the end of the backing file should produce
zeroes.
Writes beyond the end of the backing file should copy-on-write using
zeroes.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stefan Hajnoczi [Fri, 15 Oct 2010 14:55:52 +0000 (07:55 -0700)]
qemu-iotests: add sub-cluster allocating write test for sparse image formats
Image formats that grow the image file on demand and are organized into
clusters must handle sub-cluster allocating writes. Such writes touch
a portion of a previously unallocated data cluster. After the image
file is grown with the written data, reads of that cluster should work
as expected:
1. Sectors before the written region are zero.
2. The written region is present and the data is uncorrupted.
3. Sectors after the written region are zero.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Fri, 15 Oct 2010 14:53:00 +0000 (07:53 -0700)]
qemu-iotests: improve test for qemu-img convert with backing file
Additionally to testing the qemu-img convert -B option, also test
-o backing_file.
Also, the old test acidentlly used a pattern of zeros for most of the writes,
so that the allocation test didn't really work out. This is fixed by using an
explicit pattern.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Fri, 1 Oct 2010 04:02:28 +0000 (06:02 +0200)]
qemu-iotests: consider more cases in parsing qemu-io output
I got a bug report with test output diffs like this:
-4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+4 KiB, 1 ops; 0.0000 sec (inf EiB/sec and inf ops/sec)
This patch extends the regular expression to consider terabytes, petabytes and
exabytes, and to allow inf as value for the throughput.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Mon, 14 Jun 2010 09:17:54 +0000 (11:17 +0200)]
qemu-iotests: qcow2 error path tests
This adds test cases for qcow2 error paths (using blkdebug)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Tue, 4 May 2010 16:59:26 +0000 (18:59 +0200)]
qemu-iotests: improve rebase test
The old test didn't consider cases in which the COW files contains some
unallocated clusters and after them allocated ones again.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stefan Hajnoczi [Tue, 4 May 2010 16:59:08 +0000 (18:59 +0200)]
qemu-iotests: test bdrv_truncate
This patch adds an image resize grow test to ensure that existing data
is not lost during grow and new space is zeroed.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stefan Hajnoczi [Mon, 26 Apr 2010 09:44:05 +0000 (11:44 +0200)]
qemu-iotests: explicitly use bash interpreter
The tests use bash language features like 'let', which aren't supported
by /bin/sh on systems that use a conservative shell like dash. This
patch changes the interpreter to /bin/bash.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Sun, 17 Jan 2010 11:23:15 +0000 (12:23 +0100)]
qemu-iotests: test qemu-img rebase
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Thu, 1 Oct 2009 17:30:19 +0000 (14:30 -0300)]
qemu-iotests: test larger clusters sizes on qcow2
This patch adds test case 023 which tests some more cluster sizes. For
anythinger larger than 4k clusters we can't use requests that are l2_size or
more (128k for 1k clusters, 2 MB for 4k clusters, 512 MB for 64k clusters).
Therefore one of the common.pattern cases is changed and needs new expected
results for some old test cases.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Thu, 1 Oct 2009 17:30:13 +0000 (14:30 -0300)]
qemu-iotests: 019: Make cluster size dynamic
Change the offsets for test requests according to CLUSTER_SIZE.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Thu, 1 Oct 2009 17:29:59 +0000 (14:29 -0300)]
qemu-iotests: align test requests according to cluster size
Change the io_test and io_test2 functions to take the cluster size of the image
and the number of test requests to issue. Tests are changed to specify a
cluster size (usually 4k), but expected test results stay the same for now
(apart from qemu-img printing the cluster size now).
Based on a patch written by Christoph Hellwig.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Stefan Weil [Thu, 13 Aug 2009 16:49:48 +0000 (13:49 -0300)]
qemu-iotests: add support for vdi format "static" option
VDI supports an image option 'static'.
Ignore "static=off" from qemu-img output.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Mon, 27 Jul 2009 11:12:40 +0000 (13:12 +0200)]
qemu-iotests: fix expected result for 019 after qemu-io change
The output of the alloc command in qemu-io has changed.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Mon, 20 Jul 2009 12:36:47 +0000 (14:36 +0200)]
qemu-iotests: test bdrv_load/save_vmstate
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Mon, 20 Jul 2009 12:35:43 +0000 (14:35 +0200)]
qemu-iotests: common.pattern: allow spaces in io() operation
We need to be able to pass "write -b" as an operation to the pattern testing
functions. Unfortunately, this contains a space character...
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig [Mon, 20 Jul 2009 12:33:53 +0000 (14:33 +0200)]
qemu-iotests: test invalid pattern argument handling in qemu-io
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Christoph Hellwig [Thu, 16 Jul 2009 17:26:54 +0000 (19:26 +0200)]
qemu-iotests: replace FSF postal addresses with gnu.org links
Blue Swirl notices that we were using the old FSF post address in the
license boilerplates. Replace both the old and new address with links
to the gnu.org licenses homepage as suggested by Ben Pfaff.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Thu, 16 Jul 2009 17:11:58 +0000 (19:11 +0200)]
qemu-iotests: test commiting changes to backing file
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Thu, 16 Jul 2009 17:11:09 +0000 (19:11 +0200)]
qemu-iotests: test qemu-img convert with backing file for the output image
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Thu, 16 Jul 2009 17:09:41 +0000 (19:09 +0200)]
qemu-iotests: test merge of backing file when converting
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Thu, 16 Jul 2009 17:08:22 +0000 (19:08 +0200)]
qemu-iotests: simple backing file test
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig [Thu, 16 Jul 2009 16:43:09 +0000 (18:43 +0200)]
qemu-iotests: test I/O after EOF for growable files
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviwed-by: Kevin Wolf <kwolf@redhat.com>
Stefan Weil [Tue, 14 Jul 2009 21:16:00 +0000 (23:16 +0200)]
qemu-iotests: fix pattern for write test
The write pattern value 0axb is invalid and evaluates to 0,
so the read check (which uses a correct value of 0xab) will fail.
This failure will only be detected with a separate patch for
qemu-io. Without it, qemu-io cannot interpret hex values
and always uses a pattern value of 0.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig [Thu, 9 Jul 2009 13:26:11 +0000 (15:26 +0200)]
qemu-iotests: make a few more tests generic
Pretend that a non-implemented check is always successful and thus allow
various tests that were qcow2-specific before to be generic.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Christoph Hellwig [Wed, 8 Jul 2009 19:39:57 +0000 (21:39 +0200)]
qemu-iotests: remove test image after 015 is done
Signed-off-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig [Mon, 6 Jul 2009 09:48:30 +0000 (11:48 +0200)]
qemu-iotests: add support for the vdi image format
Signed-off-by: Christoph Hellwig <hch@lst.de>
Kevin Wolf [Fri, 3 Jul 2009 15:45:56 +0000 (17:45 +0200)]
qemu-iotests: add test for refcount table growth and snapshots
015: Combined test to grow the refcount table and test snapshots.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Christoph Hellwig [Fri, 3 Jul 2009 15:41:58 +0000 (17:41 +0200)]
qemu-iotests: skip test 005 for vpc format images
The vpc format doesn't support large enough image size for this test.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Christoph Hellwig [Mon, 22 Jun 2009 16:29:05 +0000 (18:29 +0200)]
qemu-iotests: Initial import into the public repository.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Peter Maydell [Tue, 21 Feb 2012 14:44:40 +0000 (14:44 +0000)]
Makefile: Add dependency to fix linux-user-only build
Make qemu-bridge-helper explicitly depend on $(GENERATED_HEADERS)
so that it doesn't fail to build when we configured for linux-user
targets only. (Build breakage introduced in commit 7b93fad.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Peter Maydell [Wed, 8 Feb 2012 05:41:39 +0000 (05:41 +0000)]
Make kernel, initrd and append be machine_opts
Make kernel, initrd, append be machine opts (ie -machine kernel=foo)
with the old plain command line arguments as legacy/convenience
equivalents.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Hervé Poussineau [Fri, 17 Feb 2012 19:27:17 +0000 (20:27 +0100)]
jazz-led: compile it only twice
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Hervé Poussineau [Fri, 17 Feb 2012 19:27:16 +0000 (20:27 +0100)]
jazz-led: convert to QOM
Some simplifications in I/O functions are possible because
Jazz LED only registers one byte of I/O.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Hervé Poussineau [Fri, 17 Feb 2012 19:27:15 +0000 (20:27 +0100)]
jazz-led: use trace framework
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Andreas Färber [Sun, 19 Feb 2012 23:49:07 +0000 (00:49 +0100)]
qom: Fix object_initialize_with_type() assertion
Assert the object is at least sizeof(Object), not sizeof(ObjectClass).
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Michael S. Tsirkin [Tue, 21 Feb 2012 13:57:58 +0000 (15:57 +0200)]
pci: set memory type for memory behind the bridge
As we make upper bits in IO and prefetcheable memory
registers writeable, we should declare support
for 64 bit prefetcheable memory and 32 bit io
in the bridge.
This changes the default for apb, dec, but I'm guessing
they got the defaults wrong by accident.
Alternatively, we could let bridges declare lack of
64 bit support and make the upper bits read-only zero.
With this applied, we can drop these bits
from express code.
Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Could someone familiar with apb,dec ack this please?
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Michael S. Tsirkin [Tue, 21 Feb 2012 13:41:30 +0000 (15:41 +0200)]
pci: add accessors to get/set registers by mask
pci_regs.h specifies many registers by mask +
shifted register values.
There's always some duplication when using such:
for example to override device type, we would need:
pci_word_test_and_clear_mask(cap + PCI_EXP_FLAGS,
PCI_EXP_FLAGS_TYPE);
pci_word_test_and_set_mask(cap + PCI_EXP_FLAGS,
PCI_EXP_TYPE_ENDPOINT << (ffs(PCI_EXP_FLAGS_TYPE) - 1));
Getting such registers also uses some duplication:
word = pci_get_word(cap + PCI_EXP_FLAGS) & PCI_EXP_FLAGS_TYPE;
if ((word >> ffs((PCI_EXP_FLAGS_TYPE) - 1)) == PCI_EXP_TYPE_ENDPOINT)
Add API to access such registers in one line:
pci_set_word_by_mask(cap + PCI_EXP_FLAGS, PCI_EXP_FLAGS_TYPE,
PCI_EXP_TYPE_ENDPOINT)
and
word = pci_get_word_by_mask(cap + PCI_EXP_FLAGS, PCI_EXP_FLAGS_TYPE)
if (word == PCI_EXP_TYPE_ENDPOINT)
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Alexander Barabash [Tue, 21 Feb 2012 10:14:22 +0000 (12:14 +0200)]
qom: Document ways to retrieve child object added by object_property_add_child()
object_property_add_child() creates a property whose values as a string is
the child object's canonical path.
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Barabash <alexander_barabash@mentor.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jordan Justen [Wed, 22 Feb 2012 07:18:56 +0000 (23:18 -0800)]
pc_piix/pc_sysfw: enable flash by default
Now, the pc-sysfw:rom_only property will default
to false which enables flash by default.
All pc types below pc-1.1 set rom_only to true.
This prevents flash from being enabled on these
pc machine types.
For pc-1.1 rom_only will use the default (false),
which will allow flash to be used for pc-1.1.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jordan Justen [Wed, 22 Feb 2012 07:18:55 +0000 (23:18 -0800)]
hw/pc_piix: add pc-1.1
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jordan Justen [Wed, 22 Feb 2012 07:18:54 +0000 (23:18 -0800)]
hw/pc_piix: remove is_default for pc-0.15
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jordan Justen [Wed, 22 Feb 2012 07:18:53 +0000 (23:18 -0800)]
hw/pc_sysfw: support system flash memory with pflash
Flash can be enabled by calling pc_system_firmware_init
with the system_flash_enabled parameter being non-zero.
If system_flash_enabled is zero, then the older qemu
rom creation method will be used.
If flash is enabled and a pflash image is found, then
it is used for the system firmware image.
If flash is enabled and a pflash image is not initially
found, then a read-only pflash device is created using
the -bios filename.
KVM cannot execute from a pflash region currently.
Therefore, when KVM is enabled, the old rom based
initialization method is used.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jordan Justen [Wed, 22 Feb 2012 07:18:52 +0000 (23:18 -0800)]
hw/pc_sysfw: enable pc-sysfw as a qdev
Setup a pc-sysfw device type. It contains a single
property of 'rom_only' which is defaulted to enabled.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jordan Justen [Wed, 22 Feb 2012 07:18:51 +0000 (23:18 -0800)]
hw/pc: move rom init to pc_sysfw.c
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jordan Justen [Wed, 22 Feb 2012 07:18:50 +0000 (23:18 -0800)]
vl: make find_default_machine externally visible
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jordan Justen [Wed, 22 Feb 2012 07:18:49 +0000 (23:18 -0800)]
pflash_cfi01/02: support read-only pflash devices
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jordan Justen [Wed, 22 Feb 2012 07:18:48 +0000 (23:18 -0800)]
blockdev: allow read-only pflash devices
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Anthony Liguori [Wed, 22 Feb 2012 13:35:03 +0000 (07:35 -0600)]
Merge remote-tracking branch 'bonzini/qdev-props-for-anthony' into staging
* bonzini/qdev-props-for-anthony:
qdev: drop unnecessary parse/print methods
qdev: use built-in QOM string parser
qdev: accept hex properties only if prefixed by 0x
qdev: accept both strings and integers for PCI addresses
qom: add generic string parsing/printing
qapi: add tests for string-based visitors
qapi: add string-based visitors
qapi: drop qmp_input_end_optional
qapi: allow sharing enum implementation across visitors
Paolo Bonzini [Thu, 9 Feb 2012 09:12:21 +0000 (10:12 +0100)]
qdev: drop unnecessary parse/print methods
More qdev printers could have been removed in the previous series, and
object_property_parse also made several parsers unnecessary. In fact,
the new code is even more robust with respect to overflows, so clean
them up!
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 9 Feb 2012 09:12:08 +0000 (10:12 +0100)]
qdev: use built-in QOM string parser
object_property_parse lets us drop the legacy setters when their task
is done just as well by the string visitors.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 9 Feb 2012 09:07:38 +0000 (10:07 +0100)]
qdev: accept hex properties only if prefixed by 0x
Hex properties are an obstacle to removal of old qdev string parsing, but
even here we can lay down the foundations for future simplification. In
general, they are rarely used and their printed form is more interesting
than the parsing. For example you'd usually set isa-serial.index
instead of isa-serial.iobase. And luckily our main client, libvirt
only cares about few of these, and always sets them with a 0x prefix.
So the series stops accepting bare hexadecimal numbers, preparing for
making legacy properties read-only in 1.3 or so. The read side will
stay as long as "info qtree" is with us.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 9 Feb 2012 08:53:32 +0000 (09:53 +0100)]
qdev: accept both strings and integers for PCI addresses
Visitors allow a limited form of polymorphism. Exploit it to support
setting the non-legacy PCI address property both as a DD.F string
and as an 8-bit integer.
The 8-bit integer form is just too clumsy, it is unlikely that we will
ever drop it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 9 Feb 2012 08:52:59 +0000 (09:52 +0100)]
qom: add generic string parsing/printing
Add generic property accessors that take a string and parse it
appropriately for the property type. All the magic here is done
by the new string-based visitors.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Gerd Hoffmann [Fri, 17 Feb 2012 14:03:24 +0000 (15:03 +0100)]
qxl: add user-friendly bar size properties
Add two properties to specify bar sizes in megabytes instead of bytes,
which is alot more user-friendly.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Fri, 17 Feb 2012 14:02:40 +0000 (15:02 +0100)]
qxl: move ram size init to new function
Factor memory bar sizing bits out to a separate function.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Fri, 17 Feb 2012 13:40:01 +0000 (14:40 +0100)]
qxl: drop vram bar minimum size
There is no reason to require a minimum size of 16 MB for the vram.
Lower the limit to 4096 (one page). Make it disapper completely would
break guests.
Yonit Halperin [Wed, 8 Feb 2012 13:40:15 +0000 (15:40 +0200)]
spice: support ipv6 channel address in monitor events and in spice info
RHBZ #788444
CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Daniel P. Berrange [Mon, 13 Feb 2012 13:43:08 +0000 (13:43 +0000)]
Add SPICE support to add_client monitor command
With the acceptance of some new APIs to libspice-server.so it
is possible to add support for SPICE to the 'add_client'
monitor command, bringing parity with VNC. Since SPICE can
use TLS or plain connections, the command also gains a new
'tls' parameter to specify whether TLS should be attempted
on the injected client sockets.
This new feature is only enabled if building against a
libspice-server >= 0.10.1
* qmp-commands.hx: Add 'tls' parameter & missing doc for
'skipauth' parameter
* monitor.c: Wire up SPICE for 'add_client' command
* ui/qemu-spice.h, ui/spice-core.c: Add qemu_spice_display_add_client
API to wire up from monitor
[1] http://cgit.freedesktop.org/spice/spice/commit/server/spice.h?id=
d55b68b6b44f2499278fa860fb47ff22f5011faa
http://cgit.freedesktop.org/spice/spice/commit/server/spice.h?id=
bd07dde530d9504e1cfe7ed5837fc00c26f36716
Changes in v3:
- Added 'optional' flag to new parameters documented
- Added no-op impl of qemu_spice_display_add_client when
SPICE is disabled during build
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Yonit Halperin [Wed, 15 Feb 2012 09:22:16 +0000 (11:22 +0200)]
qxl: make sure primary surface is saved on migration also in compat mode
RHBZ #790083
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Yonit Halperin [Wed, 15 Feb 2012 09:22:15 +0000 (11:22 +0200)]
qxl: set only off-screen surfaces dirty instead of the whole vram
We used to assure the guest surfaces were saved before migration by
setting the whole vram dirty. This patch sets dirty only the areas
that are actually used in the vram.
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Wed, 15 Feb 2012 13:04:44 +0000 (14:04 +0100)]
qxl: don't render stuff when the vm is stopped.
This patch fixes the local qxl renderer to not kick spice-server
in case the vm is stopped. First it is largely pointless because
we ask spice-server to process all not-yet processed commands when
the vm is stopped, so there isn't much do do anyway. Second we
avoid triggering an assert in spice-server.
The patch makes sure we still honor redraw requests, even if we don't
ask spice-server for updates. This is needed to handle displaysurface
changes with a stopped vm correctly.
With this patch applied it is possible to take screen shots (via
screendump monitor command) from a qxl gpu even in case the guest
is stopped.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Wed, 8 Feb 2012 14:58:35 +0000 (15:58 +0100)]
qxl: fix warnings on 32bit
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Paolo Bonzini [Thu, 9 Feb 2012 10:21:03 +0000 (11:21 +0100)]
qapi: add tests for string-based visitors
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 9 Feb 2012 08:36:37 +0000 (09:36 +0100)]
qapi: add string-based visitors
String based visitors provide a consistent interface for parsing
strings to C values, as well as consuming C values as strings.
They will be used to parse command-line options.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 9 Feb 2012 08:14:00 +0000 (09:14 +0100)]
qapi: drop qmp_input_end_optional
This method is optional, do not implement it if it is empty.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Paolo Bonzini [Thu, 9 Feb 2012 08:11:52 +0000 (09:11 +0100)]
qapi: allow sharing enum implementation across visitors
Most visitors will use the same code for enum parsing. Move it to
the core.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Gerd Hoffmann [Wed, 15 Feb 2012 08:15:37 +0000 (09:15 +0100)]
input: send kbd+mouse events only to running guests.
Trying to interact with a stopped guest will queue up the events,
then send them all at once when the guest continues running, with
a high chance to have them cause unwanted actions.
Avoid that by only injecting the input events only when the guest
is in running state.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Tue, 24 Jan 2012 15:29:29 +0000 (16:29 +0100)]
i8259: Do not clear level-triggered lines in IRR on init
When an input line is handled as level-triggered, it will immediately
raise an IRQ on the output of a PIC again that goes through an init
reset. So only clear the edge-triggered inputs from IRR in that
scenario.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Wed, 1 Feb 2012 19:31:43 +0000 (20:31 +0100)]
i8254: Factor out pit_get_channel_info
Instead of providing 4 individual query functions for mode, gate, output
and initial counter state, introduce a service that queries all
information at once. This comes with tiny additional costs for
pcspk_callback but with a much cleaner interface. Also, it will simplify
the implementation of the KVM in-kernel PIT model.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Fri, 17 Feb 2012 10:24:34 +0000 (11:24 +0100)]
pcspk: Convert to qdev
Convert the PC speaker device to a qdev ISA model. Move the public
interface to a dedicated header file at this chance.
CC: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Wed, 1 Feb 2012 19:31:41 +0000 (20:31 +0100)]
i8254: Rework & fix interaction with HPET in legacy mode
When the HPET enters legacy mode, the IRQ output of the PIT is
suppressed and replaced by the HPET timer 0. But the current code to
emulate this was broken in many ways. It reset the PIT state after
re-enabling, it worked against a stale static PIT structure, and it did
not properly saved/restored the IRQ output mask in the PIT vmstate.
This patch solves the PIT IRQ control in a different way. On x86, it
both redirects the PIT IRQ to the HPET, just like the RTC. But it also
keeps the control line from the HPET to the PIT. This allows to disable
the PIT QEMU timer when it is not needed. The PIT's view on the control
line state is now saved in the same format that qemu-kvm is already
using.
Note that, in contrast to the suppressed RTC IRQ line, we do not need to
save/restore the PIT line state in the HPET. As we trigger a PIT IRQ
update via the control line, the line state is reconstructed on mode
switch.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Wed, 1 Feb 2012 19:31:40 +0000 (20:31 +0100)]
i8254: Pass alternative IRQ output object on initialization
HPET legacy emulation will require control over the PIT IRQ output. To
enable this, add support for an alternative IRQ output object to the PIT
factory function. If the isa_irq number is < 0, this object will be
used.
This also removes the IRQ number property from the PIT class as we now
use a generic GPIO output pin that is connected by the factory function.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Wed, 1 Feb 2012 19:31:39 +0000 (20:31 +0100)]
i8254: Factor out interface header
Move the public interface of the PIT into its own header file and update
all users.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Wed, 1 Feb 2012 19:31:38 +0000 (20:31 +0100)]
hpet: Save/restore cached RTC IRQ level
In legacy mode, the HPET suppresses the RTC interrupt delivery via IRQ
8 but keeps track of the RTC output level and applies it when legacy
mode is turned off again. This value has to be preserved across save/
restore as it cannot be reconstructed otherwise.
To document that a raised rtc_irq_level won't survive a vmload without
a hpet/rtc_irq_level subsection, add an explicit clearing to the reset
handler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Jan Kiszka [Wed, 1 Feb 2012 19:31:37 +0000 (20:31 +0100)]
i8254: Do not raise IRQ level on reset
Avoid changing the IRQ level to high on reset as it may trigger spurious
events. Instead, open-code the effects of pit_load_count(0) in the reset
handler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Daniel P. Berrange [Tue, 14 Feb 2012 12:37:29 +0000 (12:37 +0000)]
vnc: Don't demote authentication scheme when changing password/disabling login
Currently when disabling login in VNC, the password is cleared out and the
authentication protocol is forced to AUTH_VNC. If you're using a stronger
authentication protocol, this has the effect of downgrading your security
protocol.
Fix this by only changing the authentication protocol if the current
authentication protocol is AUTH_NONE. That ensures we're never downgrading.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
--
NB. This patch is derived from one posted by Anthony last year, which got
accidentally lost after Luiz took over the QMP series work
https://lists.gnu.org/archive/html/qemu-devel/2011-09/msg00392.html
v1 -> v2
- Make sure to not demote when changing password (Daniel)
v2 -> v3
- Rebase to latest GIT master wrt QMP changes
Andreas Färber [Fri, 17 Feb 2012 01:47:44 +0000 (02:47 +0100)]
qdev: Fix qdev_try_create() semantics
Since QOM'ification, qdev_try_create() uses object_new() internally,
which asserts "type != NULL" when the type is not registered.
This was revealed by the combination of kvmclock's kvm_enabled() check
and early QOM type registration.
Check whether the class exists before calling object_new(), so that
the caller (e.g., qdev_create) can fail gracefully, telling us which
device could not be created.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <aliguori@codemonkey.ws>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Andreas Färber [Thu, 16 Feb 2012 17:03:19 +0000 (18:03 +0100)]
qom: Fix identifiers in documentation
Fixes gtk-doc warnings.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Andreas Färber [Thu, 16 Feb 2012 17:03:18 +0000 (18:03 +0100)]
qom: Fix typo in Object's documentation
Fixes a warning from gtk-doc.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Brad Smith [Fri, 10 Feb 2012 20:59:38 +0000 (15:59 -0500)]
configure: Remove OpenBSD workaround for curses probe
Remove the OpenBSD workaround for the curses probe. This has not been
necessary for 5 releases now.
Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>