[PATCH] Support x-vga=on for PCI host passthrough devices
by Steven Newbury
When using a passthrough GPU with libvirt there is no option to
pass "x-vga=on" to the device specification. This means legacy
VGA support isn't available which prevents any non-UEFI cards from
POSTing and prevents some drivers from initialising for example
Windows 10 NVIDIA driver for GeForce 8800.
Signed-off-by: Steven Newbury <steve(a)snewbury.org.uk>
---
src/conf/device_conf.c | 9 +++++++++
src/conf/domain_conf.c | 4 ++++
src/qemu/qemu_capabilities.c | 1 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 4 ++++
src/util/virpci.h | 1 +
tools/virsh-domain.c | 6 ++++++
7 files changed, 26 insertions(+)
diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c
index 87bf32bbc6..02d226747e 100644
--- a/src/conf/device_conf.c
+++ b/src/conf/device_conf.c
@@ -215,6 +215,7 @@ virPCIDeviceAddressParseXML(xmlNodePtr node,
g_autofree char *slot = virXMLPropString(node, "slot");
g_autofree char *function = virXMLPropString(node, "function");
g_autofree char *multi = virXMLPropString(node, "multifunction");
+ g_autofree char *vga = virXMLPropString(node, "vga");
memset(addr, 0, sizeof(*addr));
@@ -253,6 +254,14 @@ virPCIDeviceAddressParseXML(xmlNodePtr node,
multi);
return -1;
+ }
+ if (vga &&
+ ((addr->vga = virTristateSwitchTypeFromString(vga)) <= 0)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unknown value '%s' for <address> 'vga' attribute"),
+ vga);
+ return -1;
+
}
if (!virPCIDeviceAddressIsEmpty(addr) && !virPCIDeviceAddressIsValid(addr, true))
return -1;
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c003b5c030..048b0f4028 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7587,6 +7587,10 @@ virDomainDeviceInfoFormat(virBufferPtr buf,
virBufferAsprintf(&attrBuf, " multifunction='%s'",
virTristateSwitchTypeToString(info->addr.pci.multi));
}
+ if (info->addr.pci.vga) {
+ virBufferAsprintf(&attrBuf, " vga='%s'",
+ virTristateSwitchTypeToString(info->addr.pci.vga));
+ }
if (virZPCIDeviceAddressIsPresent(&info->addr.pci.zpci)) {
virBufferAsprintf(&childBuf,
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 38b901a6c4..b2864c1e9b 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -600,6 +600,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
/* 380 */
"usb-host.hostdevice",
+ "pci-vga",
);
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 107056ba17..d2d456fc43 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -580,6 +580,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 380 */
QEMU_CAPS_USB_HOST_HOSTDEVICE, /* -device usb-host.hostdevice */
+ X_QEMU_CAPS_PCI_VGA, /* -device x-vga=on|off */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 476cf6972e..b4285425ed 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -350,6 +350,10 @@ qemuBuildDeviceAddressStr(virBufferPtr buf,
virBufferAddLit(buf, ",multifunction=on");
else if (info->addr.pci.multi == VIR_TRISTATE_SWITCH_OFF)
virBufferAddLit(buf, ",multifunction=off");
+ if (info->addr.pci.vga == VIR_TRISTATE_SWITCH_ON)
+ virBufferAddLit(buf, ",x-vga=on");
+ else if (info->addr.pci.vga == VIR_TRISTATE_SWITCH_OFF)
+ virBufferAddLit(buf, ",x-vga=off");
virBufferAsprintf(buf, ",addr=0x%x", info->addr.pci.slot);
if (info->addr.pci.function != 0)
virBufferAsprintf(buf, ".0x%x", info->addr.pci.function);
diff --git a/src/util/virpci.h b/src/util/virpci.h
index b3322ba61b..1ec2e3ba34 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -61,6 +61,7 @@ struct _virPCIDeviceAddress {
unsigned int slot;
unsigned int function;
int multi; /* virTristateSwitch */
+ int vga; /* virTristateSwitch */
int extFlags; /* enum virPCIDeviceAddressExtensionFlags */
virZPCIDeviceAddress zpci;
/* Don't forget to update virPCIDeviceAddressCopy if needed. */
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 8f11393197..587efbdb2a 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -294,6 +294,10 @@ static const vshCmdOptDef opts_attach_disk[] = {
.type = VSH_OT_BOOL,
.help = N_("use multifunction pci under specified address")
},
+ {.name = "vga",
+ .type = VSH_OT_BOOL,
+ .help = N_("enable legacy VGA")
+ },
{.name = "print-xml",
.type = VSH_OT_BOOL,
.help = N_("print XML document rather than attach the disk")
@@ -694,6 +698,8 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
diskAddr.addr.pci.slot, diskAddr.addr.pci.function);
if (vshCommandOptBool(cmd, "multifunction"))
virBufferAddLit(&buf, " multifunction='on'");
+ if (vshCommandOptBool(cmd, "vga"))
+ virBufferAddLit(&buf, " vga='on'");
virBufferAddLit(&buf, "/>\n");
} else if (diskAddr.type == DISK_ADDR_TYPE_CCW) {
virBufferAsprintf(&buf,
--
2.28.0
4 years, 1 month
[PATCH 00/21] virschematest: Improve XML validation
by Peter Krempa
We had quite a few test files which weren't validated yet.
Additionally this will allow us to add schemas for internal testing only
for stuff such as the qemu status XML.
Peter Krempa (21):
util: xml: Add autoptr cleanup for virXMLValidator
virschematest: Rewrite internals to allow increasing XML test coverage
virschematest: Add regex filtering for directory contents
examples: xml: Fix 'pool-netfs.xml' example
examples: xml: Fix 'vol-raw.xml' and 'vol-sparse.xml'
virschematest: Add coverage for 'examples/xml/storage'
virschematest: Add coverage for 'examples/xml/test'
virschematest: Fix testing of 'nwfilter' xmls
domainconfdata/getfilesystem.xml: Remove <init> element
bhyveargv2xmldata: Remove XML files for console2/3/4 test case
bhyve: parse: Set video device model when parsing bhyve commandline
schema: nwfilter: Allow all accepted values for 'ipsetflags'
schema: nwfiter: Allow leading/trailing whitespace in
'variable-name-type'
nwfilterxml2firewall: Fix schema compilance of 'tcp' test case
nwfilterxml2xmltest: Rename cases with XMLs not conforming to schema
schema: domain: Add definition for the 'vmware' private namespace
schema: domain: Allow space in XML schema for bridge source
tests: vmx: Make paths in test files conform with the XML schema
tests: vmx: Add <name> element for all domain XMLs
virschematest: Add directories containing domain XMLs
virschematest: Validate more XMLs
docs/schemas/domaincommon.rng | 17 +-
docs/schemas/nwfilter.rng | 4 +-
examples/xml/storage/pool-netfs.xml | 2 +-
examples/xml/storage/vol-raw.xml | 3 +
examples/xml/storage/vol-sparse.xml | 3 +
src/bhyve/bhyve_parse_command.c | 2 +
src/util/virxml.h | 1 +
.../bhyveargv2xml-console2.xml | 15 -
.../bhyveargv2xml-console3.xml | 27 --
.../bhyveargv2xml-console4.xml | 15 -
.../bhyveargv2xml-vnc-listen.xml | 2 +-
.../bhyveargv2xml-vnc-password.xml | 2 +-
.../bhyveargv2xml-vnc-resolution.xml | 2 +-
.../bhyveargv2xml-vnc-vga-io.xml | 2 +-
.../bhyveargv2xml-vnc-vga-off.xml | 2 +-
.../bhyveargv2xml-vnc-vga-on.xml | 2 +-
tests/bhyveargv2xmldata/bhyveargv2xml-vnc.xml | 2 +-
tests/domainconfdata/getfilesystem.xml | 1 -
tests/nwfilterxml2firewalldata/tcp.xml | 2 +-
...ipv6-test.xml => ah-ipv6-test-invalid.xml} | 0
...pv6-test.xml => all-ipv6-test-invalid.xml} | 0
.../{arp-test.xml => arp-test-invalid.xml} | 0
...est1.xml => chain_prefixtest1-invalid.xml} | 0
...ment-test.xml => comment-test-invalid.xml} | 0
...pv6-test.xml => esp-ipv6-test-invalid.xml} | 0
...ata-test.xml => hex-data-test-invalid.xml} | 0
.../{icmp-test.xml => icmp-test-invalid.xml} | 0
...cmpv6-test.xml => icmpv6-test-invalid.xml} | 0
.../{ip-test.xml => ip-test-invalid.xml} | 0
.../{ipv6-test.xml => ipv6-test-invalid.xml} | 0
.../{mac-test.xml => mac-test-invalid.xml} | 0
.../{rarp-test.xml => rarp-test-invalid.xml} | 0
...v6-test.xml => sctp-ipv6-test-invalid.xml} | 0
.../{sctp-test.xml => sctp-test-invalid.xml} | 0
...pv6-test.xml => tcp-ipv6-test-invalid.xml} | 0
.../{tcp-test.xml => tcp-test-invalid.xml} | 0
...pv6-test.xml => udp-ipv6-test-invalid.xml} | 0
.../{udp-test.xml => udp-test-invalid.xml} | 0
...test.xml => udplite-ipv6-test-invalid.xml} | 0
.../{vlan-test.xml => vlan-test-invalid.xml} | 0
tests/nwfilterxml2xmltest.c | 44 +--
tests/virschematest.c | 362 ++++++++++++------
tests/vmx2xmldata/vmx2xml-annotation.vmx | 1 +
tests/vmx2xmldata/vmx2xml-annotation.xml | 1 +
.../vmx2xml-case-insensitive-1.vmx | 1 +
.../vmx2xml-case-insensitive-1.xml | 2 +-
.../vmx2xml-case-insensitive-2.vmx | 1 +
.../vmx2xml-case-insensitive-2.xml | 2 +-
.../vmx2xmldata/vmx2xml-cdrom-ide-device.vmx | 1 +
.../vmx2xmldata/vmx2xml-cdrom-ide-device.xml | 1 +
.../vmx2xmldata/vmx2xml-cdrom-ide-empty-2.vmx | 1 +
.../vmx2xmldata/vmx2xml-cdrom-ide-empty-2.xml | 1 +
tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.vmx | 1 +
tests/vmx2xmldata/vmx2xml-cdrom-ide-empty.xml | 1 +
tests/vmx2xmldata/vmx2xml-cdrom-ide-file.vmx | 1 +
tests/vmx2xmldata/vmx2xml-cdrom-ide-file.xml | 3 +-
.../vmx2xml-cdrom-ide-raw-auto-detect.vmx | 1 +
.../vmx2xml-cdrom-ide-raw-auto-detect.xml | 1 +
.../vmx2xml-cdrom-ide-raw-device.vmx | 1 +
.../vmx2xml-cdrom-ide-raw-device.xml | 1 +
.../vmx2xmldata/vmx2xml-cdrom-scsi-device.vmx | 1 +
.../vmx2xmldata/vmx2xml-cdrom-scsi-device.xml | 1 +
.../vmx2xmldata/vmx2xml-cdrom-scsi-empty.vmx | 1 +
.../vmx2xmldata/vmx2xml-cdrom-scsi-empty.xml | 1 +
tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.vmx | 1 +
tests/vmx2xmldata/vmx2xml-cdrom-scsi-file.xml | 3 +-
.../vmx2xml-cdrom-scsi-passthru.vmx | 1 +
.../vmx2xml-cdrom-scsi-passthru.xml | 1 +
.../vmx2xml-cdrom-scsi-raw-auto-detect.vmx | 1 +
.../vmx2xml-cdrom-scsi-raw-auto-detect.xml | 1 +
.../vmx2xml-cdrom-scsi-raw-device.vmx | 1 +
.../vmx2xml-cdrom-scsi-raw-device.xml | 1 +
tests/vmx2xmldata/vmx2xml-datacenterpath.vmx | 1 +
tests/vmx2xmldata/vmx2xml-datacenterpath.xml | 1 +
.../vmx2xmldata/vmx2xml-esx-in-the-wild-1.xml | 2 +-
.../vmx2xmldata/vmx2xml-esx-in-the-wild-2.xml | 6 +-
.../vmx2xmldata/vmx2xml-esx-in-the-wild-3.xml | 6 +-
.../vmx2xmldata/vmx2xml-esx-in-the-wild-4.xml | 8 +-
.../vmx2xmldata/vmx2xml-esx-in-the-wild-5.xml | 4 +-
.../vmx2xmldata/vmx2xml-esx-in-the-wild-6.xml | 2 +-
.../vmx2xmldata/vmx2xml-esx-in-the-wild-7.xml | 2 +-
.../vmx2xmldata/vmx2xml-esx-in-the-wild-8.xml | 6 +-
.../vmx2xmldata/vmx2xml-esx-in-the-wild-9.xml | 2 +-
.../vmx2xmldata/vmx2xml-ethernet-bridged.vmx | 1 +
.../vmx2xmldata/vmx2xml-ethernet-bridged.xml | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-custom.vmx | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-custom.xml | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-e1000.vmx | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-e1000.xml | 1 +
.../vmx2xml-ethernet-generated.vmx | 1 +
.../vmx2xml-ethernet-generated.xml | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-nat.vmx | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-nat.xml | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-other.vmx | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-other.xml | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-static.vmx | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-static.xml | 1 +
.../vmx2xmldata/vmx2xml-ethernet-vmxnet2.vmx | 1 +
.../vmx2xmldata/vmx2xml-ethernet-vmxnet2.xml | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-vpx.vmx | 1 +
tests/vmx2xmldata/vmx2xml-ethernet-vpx.xml | 1 +
tests/vmx2xmldata/vmx2xml-firmware-efi.vmx | 1 +
tests/vmx2xmldata/vmx2xml-firmware-efi.xml | 1 +
tests/vmx2xmldata/vmx2xml-floppy-device.vmx | 1 +
tests/vmx2xmldata/vmx2xml-floppy-device.xml | 1 +
tests/vmx2xmldata/vmx2xml-floppy-file.vmx | 1 +
tests/vmx2xmldata/vmx2xml-floppy-file.xml | 5 +-
.../vmx2xml-fusion-in-the-wild-1.xml | 2 +-
tests/vmx2xmldata/vmx2xml-graphics-vnc.vmx | 1 +
tests/vmx2xmldata/vmx2xml-graphics-vnc.xml | 1 +
.../vmx2xmldata/vmx2xml-gsx-in-the-wild-1.xml | 2 +-
.../vmx2xmldata/vmx2xml-gsx-in-the-wild-2.xml | 2 +-
.../vmx2xmldata/vmx2xml-gsx-in-the-wild-3.xml | 2 +-
.../vmx2xmldata/vmx2xml-gsx-in-the-wild-4.xml | 2 +-
.../vmx2xmldata/vmx2xml-harddisk-ide-file.vmx | 1 +
.../vmx2xmldata/vmx2xml-harddisk-ide-file.xml | 3 +-
.../vmx2xml-harddisk-scsi-file.vmx | 1 +
.../vmx2xml-harddisk-scsi-file.xml | 3 +-
.../vmx2xml-harddisk-transient.vmx | 1 +
.../vmx2xml-harddisk-transient.xml | 3 +-
tests/vmx2xmldata/vmx2xml-minimal-64bit.vmx | 1 +
tests/vmx2xmldata/vmx2xml-minimal-64bit.xml | 1 +
tests/vmx2xmldata/vmx2xml-minimal.vmx | 1 +
tests/vmx2xmldata/vmx2xml-minimal.xml | 1 +
tests/vmx2xmldata/vmx2xml-parallel-device.vmx | 1 +
tests/vmx2xmldata/vmx2xml-parallel-device.xml | 1 +
tests/vmx2xmldata/vmx2xml-parallel-file.vmx | 1 +
tests/vmx2xmldata/vmx2xml-parallel-file.xml | 3 +-
tests/vmx2xmldata/vmx2xml-scsi-driver.vmx | 1 +
tests/vmx2xmldata/vmx2xml-scsi-driver.xml | 9 +-
.../vmx2xmldata/vmx2xml-scsi-writethrough.vmx | 1 +
.../vmx2xmldata/vmx2xml-scsi-writethrough.xml | 3 +-
tests/vmx2xmldata/vmx2xml-serial-device.vmx | 1 +
tests/vmx2xmldata/vmx2xml-serial-device.xml | 1 +
tests/vmx2xmldata/vmx2xml-serial-file.vmx | 1 +
tests/vmx2xmldata/vmx2xml-serial-file.xml | 5 +-
.../vmx2xml-serial-network-client.vmx | 1 +
.../vmx2xml-serial-network-client.xml | 1 +
.../vmx2xml-serial-network-server.vmx | 1 +
.../vmx2xml-serial-network-server.xml | 1 +
.../vmx2xml-serial-pipe-client-app.vmx | 1 +
.../vmx2xml-serial-pipe-client-vm.vmx | 1 +
.../vmx2xml-serial-pipe-server-app.vmx | 1 +
.../vmx2xml-serial-pipe-server-vm.vmx | 1 +
tests/vmx2xmldata/vmx2xml-serial-pipe.xml | 1 +
tests/vmx2xmldata/vmx2xml-sharedfolder.vmx | 1 +
tests/vmx2xmldata/vmx2xml-sharedfolder.xml | 1 +
tests/vmx2xmldata/vmx2xml-smbios.vmx | 1 +
tests/vmx2xmldata/vmx2xml-smbios.xml | 1 +
tests/vmx2xmldata/vmx2xml-svga.vmx | 1 +
tests/vmx2xmldata/vmx2xml-svga.xml | 1 +
tests/vmx2xmltest.c | 4 +-
tests/xml2vmxdata/xml2vmx-cdrom-ide-file.xml | 2 +-
tests/xml2vmxdata/xml2vmx-cdrom-scsi-file.xml | 2 +-
.../xml2vmxdata/xml2vmx-esx-in-the-wild-1.xml | 2 +-
.../xml2vmxdata/xml2vmx-esx-in-the-wild-2.xml | 6 +-
.../xml2vmxdata/xml2vmx-esx-in-the-wild-3.xml | 6 +-
.../xml2vmxdata/xml2vmx-esx-in-the-wild-4.xml | 8 +-
.../xml2vmxdata/xml2vmx-esx-in-the-wild-5.xml | 4 +-
.../xml2vmxdata/xml2vmx-esx-in-the-wild-6.xml | 2 +-
.../xml2vmxdata/xml2vmx-esx-in-the-wild-7.xml | 2 +-
.../xml2vmxdata/xml2vmx-esx-in-the-wild-9.xml | 2 +-
tests/xml2vmxdata/xml2vmx-floppy-file.xml | 4 +-
.../xml2vmx-fusion-in-the-wild-1.xml | 2 +-
.../xml2vmxdata/xml2vmx-gsx-in-the-wild-1.xml | 2 +-
.../xml2vmxdata/xml2vmx-gsx-in-the-wild-2.xml | 2 +-
.../xml2vmxdata/xml2vmx-gsx-in-the-wild-3.xml | 2 +-
.../xml2vmxdata/xml2vmx-gsx-in-the-wild-4.xml | 2 +-
.../xml2vmxdata/xml2vmx-harddisk-ide-file.xml | 2 +-
.../xml2vmx-harddisk-scsi-file.xml | 2 +-
tests/xml2vmxdata/xml2vmx-parallel-file.xml | 2 +-
tests/xml2vmxdata/xml2vmx-scsi-driver.xml | 8 +-
.../xml2vmxdata/xml2vmx-scsi-writethrough.xml | 2 +-
tests/xml2vmxdata/xml2vmx-serial-file.xml | 2 +-
tests/xml2vmxtest.c | 4 +-
175 files changed, 473 insertions(+), 290 deletions(-)
delete mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console2.xml
delete mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console3.xml
delete mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-console4.xml
rename tests/nwfilterxml2xmlin/{ah-ipv6-test.xml => ah-ipv6-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{all-ipv6-test.xml => all-ipv6-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{arp-test.xml => arp-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{chain_prefixtest1.xml => chain_prefixtest1-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{comment-test.xml => comment-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{esp-ipv6-test.xml => esp-ipv6-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{hex-data-test.xml => hex-data-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{icmp-test.xml => icmp-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{icmpv6-test.xml => icmpv6-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{ip-test.xml => ip-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{ipv6-test.xml => ipv6-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{mac-test.xml => mac-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{rarp-test.xml => rarp-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{sctp-ipv6-test.xml => sctp-ipv6-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{sctp-test.xml => sctp-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{tcp-ipv6-test.xml => tcp-ipv6-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{tcp-test.xml => tcp-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{udp-ipv6-test.xml => udp-ipv6-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{udp-test.xml => udp-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{udplite-ipv6-test.xml => udplite-ipv6-test-invalid.xml} (100%)
rename tests/nwfilterxml2xmlin/{vlan-test.xml => vlan-test-invalid.xml} (100%)
--
2.26.2
4 years, 1 month
[PATCH v2] tests: commandhelper: Accept POLLNVAL on macOS
by Roman Bolshakov
commandhelper hangs indefinitely in poll() on macOS on commandtest test2
and later because POLLNVAL is returned on revents for input file
descriptor opened from /dev/null, i.e this hangs:
$ tests/commandhelper < /dev/null
BEGIN STDOUT
BEGIN STDERR
^C
But it works fine with regular stdin:
$ tests/commandhelper <<< test
BEGIN STDOUT
BEGIN STDERR
test
test
END STDOUT
END STDERR
The issue is mentioned in poll(2):
BUGS
The poll() system call currently does not support devices.
With the change all 28 cases in commandtest pass.
Signed-off-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
---
Chnges since v1:
- Extract expected events into a variable (Andrea)
- Provide upstream issue # and fix a typo (Ján)
tests/commandhelper.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index 7c260c4e13..ba5681b715 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -190,7 +190,17 @@ int main(int argc, char **argv) {
}
for (i = 0; i < numpollfds; i++) {
- if (fds[i].revents & (POLLIN | POLLHUP | POLLERR)) {
+ short revents = POLLIN | POLLHUP | POLLERR;
+
+# ifdef __APPLE__
+ /*
+ * poll() on /dev/null will return POLLNVAL
+ * Apple-Feedback: FB8785208
+ */
+ revents |= POLLNVAL;
+# endif
+
+ if (fds[i].revents & revents) {
fds[i].revents = 0;
got = read(fds[i].fd, buf, sizeof(buf));
--
2.28.0
4 years, 1 month
[libvirt PATCH] spec: Rework comment to avoid macro expansion
by Andrea Bolognani
Without this, rpmbuild fails with
warning: Macro expanded in comment on line 402: %firewalld_reload macro
error: line 402: Unknown tag: test -f /usr/bin/firewall-cmd && firewall-cmd --reload --quiet || :
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
libvirt.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index c0d84c0e75..29f34f673a 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -399,7 +399,7 @@ BuildRequires: rpcgen
BuildRequires: libtirpc-devel
-# Needed for the %firewalld_reload macro
+# Needed for the firewalld_reload macro
%if %{with_firewalld_zone}
BuildRequires: firewalld-filesystem
%endif
--
2.26.2
4 years, 1 month
[PATCH] qemu: Don't generate '-machine memory-backend' and '-numa memdev'
by Michal Privoznik
In 88957116c9 I've switched to -machine memory-backend=ID and
-object memory-backend-* because QEMU is obsoleting -mem-path
and -mem-prealloc. However, what I did not foresee was that using
-machine memory-backend in combination with -numa is not allowed
in QEMU. This was reported upstream and fortunately not released
yet.
The solution is to generate -machine memory-backend=ID iff there
are no guest NUMA nodes, and require use of -numa memdev= for new
enough QEMUs.
Reported-by: Masayoshi Mizuma <msys.mizuma(a)gmail.com>
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 11 +++++++++--
.../hugepages-nvdimm.x86_64-latest.args | 6 +-----
.../memfd-memory-default-hugepage.x86_64-latest.args | 5 +----
.../memfd-memory-numa.x86_64-latest.args | 5 +----
.../memory-hotplug-nvdimm-access.x86_64-latest.args | 4 +---
.../memory-hotplug-nvdimm-align.x86_64-latest.args | 4 +---
.../memory-hotplug-nvdimm-label.x86_64-latest.args | 4 +---
.../memory-hotplug-nvdimm-pmem.x86_64-latest.args | 4 +---
.../memory-hotplug-nvdimm-readonly.x86_64-latest.args | 4 +---
.../memory-hotplug-nvdimm.x86_64-latest.args | 4 +---
.../qemuxml2argvdata/numatune-hmat.x86_64-latest.args | 4 +---
.../vhost-user-fs-fd-memory.x86_64-latest.args | 4 +---
.../vhost-user-fs-hugepages.x86_64-latest.args | 5 +----
.../vhost-user-gpu-secondary.x86_64-latest.args | 3 +--
.../vhost-user-vga.x86_64-latest.args | 3 +--
15 files changed, 23 insertions(+), 47 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 476cf6972e..def79d2f20 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7049,7 +7049,8 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
defaultRAMid = virQEMUCapsGetMachineDefaultRAMid(qemuCaps,
def->virtType,
def->os.machine);
- if (defaultRAMid)
+ if (defaultRAMid &&
+ !virDomainNumaGetNodeCount(def->numa))
virBufferAsprintf(&buf, ",memory-backend=%s", defaultRAMid);
virCommandAddArgBuffer(cmd, &buf);
@@ -7216,7 +7217,8 @@ qemuBuildMemCommandLine(virCommandPtr cmd,
def->os.machine);
if (defaultRAMid) {
- qemuBuildMemCommandLineMemoryDefaultBackend(cmd, def, priv, defaultRAMid);
+ if (!virDomainNumaGetNodeCount(def->numa))
+ qemuBuildMemCommandLineMemoryDefaultBackend(cmd, def, priv, defaultRAMid);
} else {
if (def->mem.allocation == VIR_DOMAIN_MEMORY_ALLOCATION_IMMEDIATE) {
virCommandAddArgList(cmd, "-mem-prealloc", NULL);
@@ -7428,6 +7430,11 @@ qemuBuildNumaCommandLine(virQEMUDriverConfigPtr cfg,
hmat = true;
}
+ if (virQEMUCapsGetMachineDefaultRAMid(qemuCaps,
+ def->virtType,
+ def->os.machine))
+ needBackend = true;
+
nodeBackends = g_new0(virBuffer, ncells);
/* using of -numa memdev= cannot be combined with -numa mem=, thus we
diff --git a/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args b/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
index 192b033e9e..969bb713b5 100644
--- a/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
@@ -12,13 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on,\
-memory-backend=pc.ram \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
-cpu qemu64 \
-m size=1048576k,slots=16,maxmem=1099511627776k \
--object memory-backend-file,id=pc.ram,\
-mem-path=/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1,share=yes,prealloc=yes,\
-size=1073741824 \
-overcommit mem-lock=off \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-file,id=ram-node0,\
diff --git a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args
index b43e7d9c3c..ef15e2e97e 100644
--- a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args
@@ -12,12 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-instance-00000092/master-key.aes \
--machine pc-i440fx-2.3,accel=kvm,usb=off,dump-guest-core=off,\
-memory-backend=pc.ram \
+-machine pc-i440fx-2.3,accel=kvm,usb=off,dump-guest-core=off \
-cpu qemu64 \
-m 14336 \
--object memory-backend-memfd,id=pc.ram,hugetlb=yes,hugetlbsize=2097152,\
-share=yes,prealloc=yes,size=15032385536 \
-overcommit mem-lock=off \
-smp 8,sockets=1,dies=1,cores=8,threads=1 \
-object memory-backend-memfd,id=ram-node0,hugetlb=yes,hugetlbsize=2097152,\
diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
index b43e7d9c3c..ef15e2e97e 100644
--- a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
@@ -12,12 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-instance-00000092/master-key.aes \
--machine pc-i440fx-2.3,accel=kvm,usb=off,dump-guest-core=off,\
-memory-backend=pc.ram \
+-machine pc-i440fx-2.3,accel=kvm,usb=off,dump-guest-core=off \
-cpu qemu64 \
-m 14336 \
--object memory-backend-memfd,id=pc.ram,hugetlb=yes,hugetlbsize=2097152,\
-share=yes,prealloc=yes,size=15032385536 \
-overcommit mem-lock=off \
-smp 8,sockets=1,dies=1,cores=8,threads=1 \
-object memory-backend-memfd,id=ram-node0,hugetlb=yes,hugetlbsize=2097152,\
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
index c5c5befdd5..8d3fa2e867 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
@@ -12,11 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on,\
-memory-backend=pc.ram \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
-cpu qemu64 \
-m size=219136k,slots=16,maxmem=1099511627776k \
--object memory-backend-ram,id=pc.ram,size=224395264 \
-overcommit mem-lock=off \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=224395264 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
index 418bf1158d..4f22f78277 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
@@ -12,11 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on,\
-memory-backend=pc.ram \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
-cpu qemu64 \
-m size=219136k,slots=16,maxmem=1099511627776k \
--object memory-backend-ram,id=pc.ram,size=224395264 \
-overcommit mem-lock=off \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=224395264 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
index 66477a2b09..53dda234a2 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
@@ -12,11 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on,\
-memory-backend=pc.ram \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
-cpu qemu64 \
-m size=219136k,slots=16,maxmem=1099511627776k \
--object memory-backend-ram,id=pc.ram,size=224395264 \
-overcommit mem-lock=off \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=224395264 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
index 759d749c2e..cac02a6f6d 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
@@ -12,11 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on,\
-memory-backend=pc.ram \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
-cpu qemu64 \
-m size=219136k,slots=16,maxmem=1099511627776k \
--object memory-backend-ram,id=pc.ram,size=224395264 \
-overcommit mem-lock=off \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=224395264 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
index b195b8625c..5e44496e39 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
@@ -12,11 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on,\
-memory-backend=pc.ram \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
-cpu qemu64 \
-m size=219136k,slots=16,maxmem=1099511627776k \
--object memory-backend-ram,id=pc.ram,size=224395264 \
-overcommit mem-lock=off \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=224395264 \
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
index ae416d7c7f..94f8444d95 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
@@ -12,11 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on,\
-memory-backend=pc.ram \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,nvdimm=on \
-cpu qemu64 \
-m size=1048576k,slots=16,maxmem=1099511627776k \
--object memory-backend-ram,id=pc.ram,size=1073741824 \
-overcommit mem-lock=off \
-smp 2,sockets=2,dies=1,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=1073741824 \
diff --git a/tests/qemuxml2argvdata/numatune-hmat.x86_64-latest.args b/tests/qemuxml2argvdata/numatune-hmat.x86_64-latest.args
index be4a9ed871..c52015caa8 100644
--- a/tests/qemuxml2argvdata/numatune-hmat.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/numatune-hmat.x86_64-latest.args
@@ -12,11 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-QEMUGuest/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off,hmat=on,\
-memory-backend=pc.ram \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off,hmat=on \
-cpu qemu64 \
-m 12288 \
--object memory-backend-ram,id=pc.ram,size=12884901888 \
-overcommit mem-lock=off \
-smp 12,sockets=12,cores=1,threads=1 \
-object memory-backend-ram,id=ram-node0,size=2147483648 \
diff --git a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
index 13359c91fe..dd5f68abc5 100644
--- a/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
@@ -12,11 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-guest/master-key.aes \
--machine pc,accel=kvm,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-machine pc,accel=kvm,usb=off,dump-guest-core=off \
-cpu qemu64 \
-m 14336 \
--object memory-backend-file,id=pc.ram,\
-mem-path=/var/lib/libvirt/qemu/ram/-1-guest/pc.ram,share=yes,size=15032385536 \
-overcommit mem-lock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-object memory-backend-file,id=ram-node0,\
diff --git a/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args b/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args
index 59f45d466b..e4f5db7a63 100644
--- a/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args
@@ -12,12 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-guest/master-key.aes \
--machine q35,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-machine q35,accel=tcg,usb=off,dump-guest-core=off \
-cpu qemu64 \
-m 2048 \
--object memory-backend-file,id=pc.ram,\
-mem-path=/dev/hugepages2M/libvirt/qemu/-1-guest,share=yes,prealloc=yes,\
-size=2147483648 \
-overcommit mem-lock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-object memory-backend-file,id=ram-node0,\
diff --git a/tests/qemuxml2argvdata/vhost-user-gpu-secondary.x86_64-latest.args b/tests/qemuxml2argvdata/vhost-user-gpu-secondary.x86_64-latest.args
index e7d3315b8f..e99a5342dc 100644
--- a/tests/qemuxml2argvdata/vhost-user-gpu-secondary.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/vhost-user-gpu-secondary.x86_64-latest.args
@@ -12,10 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
-cpu qemu64 \
-m 214 \
--object memory-backend-memfd,id=pc.ram,share=yes,size=224395264 \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-object memory-backend-memfd,id=ram-node0,share=yes,size=224395264 \
diff --git a/tests/qemuxml2argvdata/vhost-user-vga.x86_64-latest.args b/tests/qemuxml2argvdata/vhost-user-vga.x86_64-latest.args
index df5b1b481d..277bf8c646 100644
--- a/tests/qemuxml2argvdata/vhost-user-vga.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/vhost-user-vga.x86_64-latest.args
@@ -12,10 +12,9 @@ QEMU_AUDIO_DRV=none \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
-cpu qemu64 \
-m 214 \
--object memory-backend-memfd,id=pc.ram,share=yes,size=224395264 \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-object memory-backend-memfd,id=ram-node0,share=yes,size=224395264 \
--
2.26.2
4 years, 1 month
[PATCH] virschematest: Validate schema in tests/cputestdata
by Peter Krempa
We now have a schema file for the 'cpu' elements. Use it to validate
files in 'tests/cputestdata'
Unfortunately the files in the directory are too disorganised and not
easy to split up to do something more straightforward.
The -baseline- input files are tested by the test internally and the
rest of the files are internal data feeding the tests so they don't
need validation.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
This applies on top of my previous series refactoring the virschematest.
tests/virschematest.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tests/virschematest.c b/tests/virschematest.c
index 6ce09d4737..0e587c3ff0 100644
--- a/tests/virschematest.c
+++ b/tests/virschematest.c
@@ -323,6 +323,14 @@ static const struct testSchemaEntry schemaStorageVol[] = {
{ .file = "examples/xml/test/testvol.xml" },
};
+static const struct testSchemaEntry schemaCpu[] = {
+ { . dir = "tests/cputestdata",
+ . dirRegex = "^[^-]+-cpuid-.*(-host|-guest|-json)\\.xml$" },
+ { . dir = "tests/cputestdata",
+ . dirRegex = "^[^-]+-baseline-.*-result\\.xml$" },
+ { . dir = "tests/cputestdata",
+ . dirRegex = "^[^-]+-(?!cpuid|baseline).*$" },
+};
static int
mymain(void)
@@ -349,6 +357,7 @@ mymain(void)
DO_TEST("docs/schemas/storagepoolcaps.rng", schemaStoragepoolcaps);
DO_TEST("docs/schemas/storagepool.rng", schemaStoragePool);
DO_TEST("docs/schemas/storagevol.rng", schemaStorageVol);
+ DO_TEST("docs/schemas/cpu.rng", schemaCpu);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
2.26.2
4 years, 1 month
[libvirt PATCH] spec: Explain the BuildRequires on firewalld-filesystem
by Andrea Bolognani
It's not immediately obvious why it is needed.
Suggested-by: Pavel Hrdina <phrdina(a)redhat.com>
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
libvirt.spec.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 6d4eef86ad..c0d84c0e75 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -399,6 +399,7 @@ BuildRequires: rpcgen
BuildRequires: libtirpc-devel
+# Needed for the %firewalld_reload macro
%if %{with_firewalld_zone}
BuildRequires: firewalld-filesystem
%endif
--
2.26.2
4 years, 1 month
[PATCH] tests: commandhelper: Accept POLLNVAL on macOS
by Roman Bolshakov
commandhelper hangs indefinetely in poll() on macOS on commandtest test2
and later because POLLNVAL is returned on revents for input file
descriptor opened from /dev/null, i.e this hangs:
$ tests/commandhelper < /dev/null
BEGIN STDOUT
BEGIN STDERR
^C
But it works fine with regular stdin:
$ tests/commandhelper <<< test
BEGIN STDOUT
BEGIN STDERR
test
test
END STDOUT
END STDERR
The issue is mentioned in poll(2):
BUGS
The poll() system call currently does not support devices.
With the change all 28 cases in commandtest pass.
Signed-off-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
---
tests/commandhelper.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index 7c260c4e13..676ef55e9f 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -190,7 +190,15 @@ int main(int argc, char **argv) {
}
for (i = 0; i < numpollfds; i++) {
- if (fds[i].revents & (POLLIN | POLLHUP | POLLERR)) {
+ if (fds[i].revents & (POLLIN | POLLHUP | POLLERR |
+# ifdef __APPLE__
+ /*
+ * poll() on /dev/null will return POLLNVAL
+ */
+ POLLNVAL)) {
+# else
+ 0)) {
+# endif
fds[i].revents = 0;
got = read(fds[i].fd, buf, sizeof(buf));
--
2.28.0
4 years, 1 month
[libvirt PATCH v4 0/5] Make unknown XML elements fail CPU comparison
by Tim Wiederhake
We currently ignore unknown elements in the CPU XML description, e.g.
with virsh cpu-compare and hypervisor-cpu-compare. This makes
'<cpu><faeture name=3D"..."/></cpu>' (note the typo in "faeture")
semantically identic to '<cpu/>'. No error is reported.
This series adds checks for unrecognized attributes and elements in
the "<cpu>" element, catching this kind of mistake.
V1: https://www.redhat.com/archives/libvir-list/2020-September/msg00933.html
V2: https://www.redhat.com/archives/libvir-list/2020-September/msg01073.html
V3: https://www.redhat.com/archives/libvir-list/2020-September/msg01555.html
Changed:
* Some patches from V3 are merged
* Changes to commit messages
* Perform testing by means of virschematest
Tim Wiederhake (5):
schema: Make element "topology" in host CPU definition optional
cpu: Wire in XML validation
tests: Rename some test files in cputestdata
tests: Enable CPU XML validation in the tests.
virsh: Add "validate" argument to [hypervisor-]cpu-compare
docs/manpages/virsh.rst | 9 ++--
docs/schemas/cpu_test.rng | 48 +++++++++++++++++++
docs/schemas/cputypes.rng | 24 +++++-----
docs/schemas/meson.build | 1 +
include/libvirt/libvirt-host.h | 2 +
src/bhyve/bhyve_driver.c | 7 ++-
src/conf/cpu_conf.c | 25 ++++++++--
src/conf/cpu_conf.h | 6 ++-
src/conf/domain_conf.c | 3 +-
src/cpu/cpu.c | 5 +-
src/cpu/cpu.h | 3 +-
src/libxl/libxl_driver.c | 7 ++-
src/qemu/qemu_domain.c | 5 +-
src/qemu/qemu_driver.c | 18 +++++--
src/qemu/qemu_migration_cookie.c | 3 +-
tests/cputest.c | 15 +++---
...invalid.xml =3D> ppc64-guest-compat-bad.xml} | 0
...invalid.xml =3D> ppc64-guest-legacy-bad.xml} | 0
...id.xml =3D> ppc64-host+guest-compat-bad.xml} | 0
...id.xml =3D> ppc64-host+guest-legacy-bad.xml} | 0
tests/virschematest.c | 1 +
tools/virsh-host.c | 14 ++++++
22 files changed, 153 insertions(+), 43 deletions(-)
create mode 100644 docs/schemas/cpu_test.rng
rename tests/cputestdata/{ppc64-guest-compat-invalid.xml =3D> ppc64-guest-co=
mpat-bad.xml} (100%)
rename tests/cputestdata/{ppc64-guest-legacy-invalid.xml =3D> ppc64-guest-le=
gacy-bad.xml} (100%)
rename tests/cputestdata/{ppc64-host+guest-compat-invalid.xml =3D> ppc64-hos=
t+guest-compat-bad.xml} (100%)
rename tests/cputestdata/{ppc64-host+guest-legacy-invalid.xml =3D> ppc64-hos=
t+guest-legacy-bad.xml} (100%)
--=20
2.26.2
4 years, 1 month
[libvirt PATCH 00/13] conf: use g_new0 (glib chronicles)
by Ján Tomko
*** BLURB HERE ***
*** BLURB THERE ***
*** BLURB EVEYWHERE ***
Ján Tomko (13):
conf: domain: use g_new0
conf: capabilities: use g_new0
conf: network: use g_new0
conf: node_device: use g_new0
conf: domain_addr: use g_new0
conf: interface: use g_new0
conf: numa: use g_new0
conf: storage: use g_new0
conf: virsecretobj: use g_new0
conf: nwfilter_params: use g_new0
conf: cpu: use g_new0
conf: use g_new0
conf: virDomainUSBAddressHubNew: refactor
src/conf/capabilities.c | 39 +--
src/conf/checkpoint_conf.c | 4 +-
src/conf/cpu_conf.c | 15 +-
src/conf/domain_addr.c | 37 +--
src/conf/domain_capabilities.c | 7 +-
src/conf/domain_conf.c | 347 ++++++++++----------------
src/conf/domain_event.c | 3 +-
src/conf/domain_nwfilter.c | 3 +-
src/conf/interface_conf.c | 29 +--
src/conf/netdev_bandwidth_conf.c | 9 +-
src/conf/netdev_vlan_conf.c | 4 +-
src/conf/netdev_vport_profile_conf.c | 3 +-
src/conf/network_conf.c | 37 +--
src/conf/networkcommon_conf.c | 3 +-
src/conf/node_device_conf.c | 37 +--
src/conf/numa_conf.c | 23 +-
src/conf/nwfilter_conf.c | 12 +-
src/conf/nwfilter_params.c | 21 +-
src/conf/object_event.c | 11 +-
src/conf/secret_conf.c | 3 +-
src/conf/snapshot_conf.c | 4 +-
src/conf/storage_conf.c | 21 +-
src/conf/virchrdev.c | 10 +-
src/conf/virdomaincheckpointobjlist.c | 10 +-
src/conf/virdomainmomentobjlist.c | 6 +-
src/conf/virdomainobjlist.c | 8 +-
src/conf/virdomainsnapshotobjlist.c | 9 +-
src/conf/virinterfaceobj.c | 5 +-
src/conf/virnetworkobj.c | 7 +-
src/conf/virnetworkportdef.c | 4 +-
src/conf/virnodedeviceobj.c | 7 +-
src/conf/virnwfilterbindingdef.c | 6 +-
src/conf/virnwfilterbindingobjlist.c | 8 +-
src/conf/virnwfilterobj.c | 9 +-
src/conf/virsecretobj.c | 21 +-
35 files changed, 271 insertions(+), 511 deletions(-)
--
2.26.2
4 years, 1 month