Commit Graph

460 Commits

Author SHA1 Message Date
Andrea Bolognani
0ee6f885e0 conf: Parse and format HPT maxpagesize
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-06-26 10:15:52 +02:00
Anya Harter
22b7247d48 tests: add test file for smartcard database
Add test case explicitly defining a smartcard host certificates
database via the following xml:

    <smartcard mode='host-certificates'>
      <database>/tmp/foo</database>
    </smartcard>

This case is not currently covered in the test suite.

Signed-off-by: Anya Harter <aharter@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-06-18 19:27:49 -04:00
Martin Kletzander
d60b730b48 qemu: Add support for setting the TSEG size
The default is stable per machine type so there should be no need to keep that.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1469338

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-06-08 10:28:46 +02:00
Peter Krempa
18d94e17f8 tests: Drop tests enabling allowDiskFormatProbing
Format probing will be dropped so remove the tests which will become
obsolete.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-06-08 09:26:37 +02:00
Stefan Berger
33af0b2b7c conf: Add support for external swtpm TPM emulator to domain XML
This patch adds support for an external swtpm TPM emulator. The XML for
this type of TPM looks as follows:

 <tpm model='tpm-tis'>
   <backend type='emulator'/>
 </tpm>

The XML will currently only define a TPM 1.2.

Extend the documentation.

Add a test case testing the XML parser and formatter.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-06-06 10:48:41 -04:00
Peter Krempa
c4eedd7930 qemu: domain: Forbid storage with old QCOW2 encryption
The encryption was buggy and qemu actually dropped it upstream. Forbid
it for all versions since it would cause other problems too.

Problems with the old encryption include weak crypto, corruption of
images with blockjobs and a lot of usability problems.

This requires changing of the encryption type for the encrypted disk
tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-06-05 08:14:00 +02:00
Peter Krempa
07119a2a6a tests: qemu: Rename disk-drive-network-tlsx509-vxhs test
Drop the 'vxhs' suffix so other network protocols using TLS can be
put into the same test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-06-05 08:13:59 +02:00
Peter Krempa
ecd785dd84 tests: qemustatusxml2xml: Add test data for re-generating LUKS/auth aliases
Add tests for upcoming re-generation of aliases for the secret objects
used by qemu when upgrading libvirt.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-06-05 08:13:57 +02:00
Peter Krempa
3bf1959524 tests: qemuxml2argv: Verify that disk secret alias is correct with user-aliases
Change the disk encryption type to qcow2+luks so that the appropriate
secret objects are generated. This tests that the proper alias is used
for the passphrase secret object.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-06-05 08:11:12 +02:00
Ján Tomko
8a7003f669 qemu: check for QEMU_CAPS_DEVICE_VHOST_VSOCK
My commit b8b42ca added support for formatting the vsock
command line without actually checking if it's supported.

Add it to the per-device validation function.

https://bugzilla.redhat.com/show_bug.cgi?id=1291851

Reported-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2018-06-04 21:42:40 +02:00
Ján Tomko
d4abb7b45d conf: introduce <vsock> element
Add a new 'vsock' element for the vsock device.
The 'model' attribute is optional.
A <source cid> subelement should be used to specify the guest cid,
or <source auto='yes'/> should be used.

https://bugzilla.redhat.com/show_bug.cgi?id=1291851

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2018-05-29 15:42:03 +02:00
John Ferlan
b50efe97ad conf: Add VM Generation ID parse/format support
The VM Generation ID is a mechanism to provide a unique 128-bit,
cryptographically random, and integer value identifier known as
the GUID (Globally Unique Identifier) to the guest OS. The value
is used to help notify the guest operating system when the virtual
machine is executed with a different configuration.

This patch adds support for a new "genid" XML element similar to
the "uuid" element. The "genid" element can have two forms "<genid/>"
or "<genid>$GUID</genid>". If the $GUID is not provided, libvirt
will generate one and save it in the XML.

Since adding support for a generated GUID (or UUID like) value to
be displayed modifying the xml2xml test to include virrandommock.so
is necessary since it will generate a "known" value.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
2018-05-25 08:04:34 -04:00
Peter Krempa
99223c8cca test: Add status XML test for NBD tls storage migration
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-23 13:18:25 +02:00
Peter Krempa
1efda36765 qemu: Move validation of PR manager support
Disk source definition should be validated in
qemuDomainValidateStorageSource rather than in individual generators of
command line arguments.

Change to the XML2XML test is required since now the definition is
actually validated at define time.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-05-16 06:32:28 +02:00
Maciej Wolny
fff9e25a2b conf: Add gl property to graphics of type sdl in domain config
Support OpenGL accelerated rendering when using SDL graphics in the
domain config. Add associated test and documentation.

Signed-off-by: Maciej Wolny <maciej.wolny@codethink.co.uk>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-15 16:50:38 -04:00
Shalini Chellathurai Saroja
7224144400 qemu: vfio-ccw device address generation
Introduces the vfio-ccw model for mediated devices and prime vfio-ccw
devices such that CCW address will be generated.

Alters the qemuxml2xmltest for testing a basic mdev device using vfio-ccw.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-14 12:27:44 -04:00
Shalini Chellathurai Saroja
f245a9791c qemu: introduce capability for virtual-css-bridge
Let us introduce the capability QEMU_CAPS_CCW for virtual-css-bridge
and replace QEMU_CAPS_VIRTIO_CCW with QEMU_CAPS_CCW in code segments
which identify support for ccw devices.

The virtual-css-bridge is part of the ccw support introduced in QEMU 2.7.
The QEMU_CAPS_CCW capability is based on the existence of the QEMU type.

Let us also add the capability QEMU_CAPS_CCW to the tests which
require support for ccw devices.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-14 11:26:15 -04:00
Michal Privoznik
687730540e virstoragefile: Introduce virStoragePRDef
This is a definition that holds information on SCSI persistent
reservation settings. The XML part looks like this:

  <reservations enabled='yes' managed='no'>
    <source type='unix' path='/path/to/qemu-pr-helper.sock' mode='client'/>
  </reservations>

If @managed is set to 'yes' then the <source/> is not parsed.
This design was agreed on here:

https://www.redhat.com/archives/libvir-list/2017-November/msg01005.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-11 09:02:56 +02:00
Ján Tomko
941c8b0d00 Deprecate QEMU_CAPS_NO_KVM_PIT
The -no-kvm-pit-reinjection option has been deprecated since
its introduction in QEMU 1.3. See commit <1569fa1>.

Drop the capability since all the QEMUs we support allow tuning
the kvm-pit properties via -global.

Also add the QEMU_CAPS_KVM_PIT_TICK_POLICY to the clock-catchup
tests, since expecting it to succeed with QEMU that does not
have kvm-pit makes no sense.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-07 10:33:13 +02:00
Stefan Berger
fead27f4b3 conf: Enable TPM CRB interface in the domain XML
Enable the TPM CRB to be specified in the domain XML. This
now allows to describe the TPM device like this:

  <tpm model='tpm-crb'>
    <backend type='passthrough'>
      <device path='/dev/tpm0'/>
    </backend>
  </tpm>

Extend the XML schema to also allow tpm-crb.
Extend the documentation.
Add a test case for testing the XML parser and formatter.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-03 11:28:42 -04:00
Andrea Bolognani
38848325df tests: Make sure rom.file='' for PCI devices keeps working
Even though we just introduced the rom.enabled attribute to
properly cover the use case, there might be guests out there
that use the only previously available way of disabling PCI
ROM loading by not opting in to schema validation.

To make sure such guests will keep working going forward,
introduce a test case covering the legacy workaround.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-04-23 15:20:54 +02:00
Andrea Bolognani
4d11d9a292 qemu: Format rom.enabled attribute for PCI devices
The attribute can be used to disable ROM loading completely
for a device.

This might be needed because, even when the guest is configured
such that the PCI ROM will not be loaded in the PCI BAR, some
hypervisors (eg. QEMU) might still make it available to the
guest in a form (eg. fw_cfg) that some firmwares (eg. SeaBIOS)
will consume, thus not achieving the desired result.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1425058

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-04-23 15:20:54 +02:00
Ján Tomko
5a41bd6df2 qemu: deprecate QEMU_CAPS_DISPLAY
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 14:49:21 +02:00
Ján Tomko
4a42ece13a qemu: deprecate QEMU_CAPS_HOST_PCI_MULTIDOMAIN
Implied by QEMU >= 1.2.0.
Delete the negative test cases now that they always pass.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 14:40:38 +02:00
Ján Tomko
69420756b2 qemu: deprecate QEMU_CAPS_MACHINE_OPT
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 14:24:09 +02:00
Ján Tomko
2089a801ba qemu: deprecate QEMU_CAPS_DTB
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 13:01:10 +02:00
Ján Tomko
b6389394e0 qemu: deprecate QEMU_CAPS_FSDEV_WRITEOUT
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-17 12:57:14 +02:00
Jiri Denemark
0272a3ffae qemuxml2xmltest: Add status XML tests for migration params
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-04-17 10:46:23 +02:00
Ján Tomko
c3eaccfa60 qemu: deprecate QEMU_CAPS_CHARDEV_SPICEVMC
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 17:11:26 +02:00
Ján Tomko
e559bf3826 qemu: deprecate QEMU_CAPS_FSDEV
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 16:27:54 +02:00
Ján Tomko
8b66c1bc85 qemu: deprecate QEMU_CAPS_BOOT_MENU
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 16:26:13 +02:00
Ján Tomko
61623e42bc qemu: deprecate QEMU_CAPS_NODEFCONFIG
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixed-up-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 16:16:16 +02:00
Ján Tomko
470c3827cf qemu: deprecate QEMU_CAPS_RTC
Implied by QEMU >= 1.2.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-16 14:55:55 +02:00
Ján Tomko
ad8a7c4f85 qemu: deprecate QEMU_CAPS_NETDEV
This makes qemuDomainSupportsNetdev identical to
qemuDomainSupportsNicdev and leaves some code in
qemuDomainAttachNetDevice to be cleaned up later.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-12 17:17:16 +02:00
Ján Tomko
6826c99ac1 qemu: deprecate QEMU_CAPS_PCI_MULTIFUNCTION
Supported since QEMU 0.13, but we require QEMU 1.5.0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-04-12 17:17:16 +02:00
John Ferlan
d4aaa1651b conf: Fix virDomainObjParseFile object handling
When virDomainObjParseFile runs, it returns a locked @obj with
one reference. Rather than just use virObjectUnref to clean that
up, use virObjectEndAPI.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:14:37 -04:00
Andrea Bolognani
8238b04405 tests: Use pcie-to-pci-bridge for aarch64-traditional-pci
Now that support for the pcie-to-pci-bridge controller has
been implemented, adding the QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE
capability to the existing test is enough to cause the guest
to use pcie-to-pci-bridge instead of dmi-to-pci-bridge.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:12:25 +02:00
Andrea Bolognani
d47de9e698 tests: Add aarch64-traditional-pci test
This test shows what happens when you add a traditional PCI
device such as pci-serial to a pure PCIe machine type such
as aarch64/virt.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:12:11 +02:00
Farhan Ali
24149bc060 qemu: Add support for virtio input ccw devices
QEMU on S390 (since v2.11) can support virtio input ccw devices.
So build the qemu command line for ccw devices.

Also add test cases for virtio-{keyboard, mouse, tablet}-ccw.

Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2018-03-23 19:40:20 +01:00
Farhan Ali
2a0c3490dd qemu: Change default video model type to virtio for S390
S390 guests can only support a virtio-gpu-ccw device as a video
device. So set default video model type to VIR_DOMAIN_VIDEO_TYPE_VIRTIO
for S390 guests.

Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
2018-03-23 19:40:20 +01:00
Farhan Ali
a6441402a5 qemu: Introduce a new capability for virtio-gpu-ccw
QEMU on S390 (since v2.11) can support virtio-gpu-ccw device.
Let's introduce a new qemu capability for the device.

Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2018-03-23 19:40:20 +01:00
Andrea Bolognani
a7ae7f53a0 tests: Rename pseries-features-hpt test
We're going to use the same test case to exercise all optional
pSeries features, so a more generic name is needed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-03-21 17:59:24 +01:00
Peter Krempa
4833e128a2 tests: qemuxml2xml: Add status XML with outgoing migration with NBD
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-03-13 13:54:11 +01:00
Peter Krempa
881af99766 tests: qemuxml2xml: Add modern example of status XML to the test
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-03-13 13:54:11 +01:00
Peter Krempa
1b28038300 tests: util: Remove callback from testCompareDomXML2XMLFiles
The testCompareDomXML2XMLPreFormatCallback is no longer used and thus
can be removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-03-13 13:54:11 +01:00
Peter Krempa
d1a7fc8bb3 tests: qemuxml2xml: Remove fake status XML testing
Now that the better approach is in place we can remove the old functions
doing the fake formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-03-13 13:54:11 +01:00
Peter Krempa
99e30acfdc tests: qemuxml2xml: Add proper domain status XML testing
Add new approach to properly test status XML files by supplying a full
XML file rather than generating synthetic test cases by prepending the
status header. The two tests introduced here are copies of existing
cases using the synthetic header so that current level of testing is
kept. The files are chosen to excercising the vcpu and blockjob quirks
present in the current testing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-03-13 13:54:11 +01:00
Peter Krempa
9fc796887d tests: qemuxml2xml: Remove testing with allowed format detection
Nobody should use format detection due to security implications. The
result of the change is that 'raw' format will be printed unless
specified explicitly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-03-13 13:05:43 +01:00
Peter Krempa
d493e03ad4 tests: qemu: Explicitly add tests with format probing allowed
Add a single testcase for the case where format probing is allowed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-03-13 13:05:43 +01:00
Peter Krempa
5972e8631f tests: qemuxml2xml: Rename testInfoFree to testInfoClear
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-03-13 13:05:43 +01:00