[libvirt] [PATCH 0/9] Set the SCSI controller model during post parse
by John Ferlan
Fallout or a pile yak shavings from the series to move the controller
validation from command line building into domain xml validation:
https://www.redhat.com/archives/libvir-list/2018-January/msg00188.html
This series grabs the first patch from the other series that was
essentially already ACK'd, but instead of heading down the path of
"working around" the fact that SCSI controller model may not be
set after domain post processing, this series builds up a series
of changes to implement altering the SCSI controller model during
device post processing rather than waiting for the validation phase
to "cheat" and alter a local model value temporarily.
The first 4 patches are relatively straightforward and don't change
any of the outputs. Starting with patch 5, things get a bit more
interesting. Patch 6 is where the conversion to set the default
model for SCSI controllers starts... Patch 7 is where things got
a bit tricky w/r/t the implicit controller... Patches 8 and 9 just
perform cleanup from that setting.
If this is accepted - I'll go back to the other series to adjust
and repost; otherwise, we can determine whether the other series
is necessary or if we're just happy with the way things are.
John Ferlan (9):
qemu: Split qemuDomainSetSCSIControllerModel
conf: Rework and rename virDomainDeviceFindControllerModel
qemu: Introduce qemuDomainFindSCSIControllerModel
qemu: Introduce qemuDomainGetSCSIControllerModel
qemu: Fetch/save the default SCSI controller model during hotplug
qemu: Introduce qemuDomainSetSCSIControllerModel
conf: Allow configuration of implicit controller model
qemu: Reduce need to call qemuDomainGetSCSIControllerModel
qemu: Update qemuDomainFindSCSIControllerModel return
src/conf/domain_conf.c | 41 ++++--
src/conf/domain_conf.h | 6 +-
src/libvirt_private.syms | 2 +-
src/qemu/qemu_alias.c | 14 +-
src/qemu/qemu_alias.h | 3 +-
src/qemu/qemu_command.c | 88 +++++++++---
src/qemu/qemu_command.h | 3 +-
src/qemu/qemu_domain.c | 8 +-
src/qemu/qemu_domain_address.c | 149 +++++++++++----------
src/qemu/qemu_domain_address.h | 11 +-
src/qemu/qemu_hotplug.c | 14 +-
src/vbox/vbox_common.c | 8 +-
tests/qemuargv2xmldata/nomachine-ppc64.xml | 2 +-
tests/qemuargv2xmldata/pseries-disk.xml | 2 +-
.../qemuhotplug-base-with-scsi-controller-live.xml | 8 +-
...se-without-scsi-controller-live+disk-scsi-2.xml | 8 +-
tests/qemuxml2xmloutdata/disk-scsi-device-auto.xml | 2 +-
.../hostdev-scsi-lsi-iscsi-auth.xml | 2 +-
.../qemuxml2xmloutdata/hostdev-scsi-lsi-iscsi.xml | 2 +-
tests/qemuxml2xmloutdata/hostdev-scsi-lsi.xml | 2 +-
20 files changed, 229 insertions(+), 146 deletions(-)
--
2.13.6
6 years, 10 months
[libvirt] [PATCH] virUSBDeviceNew: Construct vroot path properly
by Michal Privoznik
When starting an LXC container, the /dev entries are created
under temp root (/var/run/libvirt/lxc/$name.dev), relabelled and
then the root is pivoted. However, when it comes to USB devices
which keep path to the device in the structure we need a way to
override the default /dev/usb/... path because we want to work
with the one under temp root. That's what @vroot argument is for
in virUSBDeviceNew. However, what is being passed there is:
vroot = /var/run/libvirt/lxc/lxc_0.dev/bus/usb
Therefore, constructed path is wrong:
dev->path = //var/run/libvirt/lxc/lxc_0.dev/bus/usb//dev/bus/usb/002/002
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/util/virusb.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/util/virusb.c b/src/util/virusb.c
index 6359235ff..f06639eec 100644
--- a/src/util/virusb.c
+++ b/src/util/virusb.c
@@ -343,9 +343,13 @@ virUSBDeviceNew(unsigned int bus,
virUSBDeviceFree(dev);
return NULL;
}
- if (virAsprintf(&dev->path, "%s" USB_DEVFS "%03d/%03d",
- vroot ? vroot : "",
- dev->bus, dev->dev) < 0) {
+
+ if ((vroot &&
+ virAsprintf(&dev->path, "%s/%03d/%03d",
+ vroot, dev->bus, dev->dev) < 0) ||
+ (!vroot &&
+ virAsprintf(&dev->path, USB_DEVFS "%03d/%03d",
+ dev->bus, dev->dev) < 0)) {
virUSBDeviceFree(dev);
return NULL;
}
--
2.13.6
6 years, 10 months
[libvirt] [PATCH] blockjob: Fix a error checking of blockjob status in some case
by Jie Wang
offset and len can also be equal to 0 on failed if blockjob return
status:"BLOCK_JOB_COMPLETED" with error:"File descriptor in bad
state", this bug can be reproduced easily if you perform a async
block job on read only filesystem, so it's very worthwhile for us to
check 'error' in this case.
---
src/qemu/qemu_monitor_json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 5ddd855..442b218 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -889,7 +889,7 @@ qemuMonitorJSONHandleBlockJobImpl(qemuMonitorPtr mon,
case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
error = virJSONValueObjectGetString(data, "error");
/* Make sure the whole device has been processed */
- if (offset != len)
+ if (offset != len || error)
event = VIR_DOMAIN_BLOCK_JOB_FAILED;
break;
case VIR_DOMAIN_BLOCK_JOB_CANCELED:
--
1.8.3.1
6 years, 10 months
[libvirt] [PATCH 0/3] tools: Actually enable bash-completion
by Michal Privoznik
Due to some naming convention the bash script for inactive
virsh/virt-admin wasn't loaded. Fix this.
At the same time, fix two small nits raised in the other patch set for
bash completion.
Michal Privoznik (3):
virshDomainNameCompleter: Prune accepted flags
virsh: Offer only persistent domains for autostart
tools: Make symlinks to vsh bash-completion script
libvirt.spec.in | 24 +++++++++++++++++++++++-
tools/Makefile.am | 7 ++++++-
tools/virsh-completer.c | 13 +++----------
tools/virsh-domain.c | 2 +-
4 files changed, 33 insertions(+), 13 deletions(-)
--
2.13.6
6 years, 10 months
[libvirt] [PATCH] resctl: stub out functions with Linux-only APIs used
by Daniel P. Berrangé
The flock() function and d_type field in struct dirent are not portable
to the mingw platform.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
* Pushed as CI build fix
src/util/virresctrl.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
index e252aefe31..754820ee46 100644
--- a/src/util/virresctrl.c
+++ b/src/util/virresctrl.c
@@ -295,6 +295,7 @@ virResctrlAllocNew(void)
/* Common functions */
+#ifdef __linux__
static int
virResctrlLockInternal(int op)
{
@@ -321,6 +322,20 @@ virResctrlLockWrite(void)
return virResctrlLockInternal(LOCK_EX);
}
+#else
+
+static inline int
+virResctrlLockWrite(void)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("resctrlfs not supported on this platform"));
+ return -1;
+}
+
+#endif
+
+
+
static int
virResctrlUnlock(int fd)
@@ -328,6 +343,7 @@ virResctrlUnlock(int fd)
if (fd == -1)
return 0;
+#ifdef __linux__
/* The lock gets unlocked by closing the fd, which we need to do anyway in
* order to clean up properly */
if (VIR_CLOSE(fd) < 0) {
@@ -338,6 +354,7 @@ virResctrlUnlock(int fd)
virReportSystemError(errno, "%s", _("Cannot unlock resctrlfs"));
return -1;
}
+#endif /* ! __linux__ */
return 0;
}
@@ -369,6 +386,8 @@ virResctrlInfoIsEmpty(virResctrlInfoPtr resctrl)
}
+#ifdef __linux__
+
int
virResctrlGetInfo(virResctrlInfoPtr resctrl)
{
@@ -495,6 +514,18 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl)
return ret;
}
+#else /* ! __linux__ */
+
+int
+virResctrlGetInfo(virResctrlInfoPtr resctrl ATTRIBUTE_UNUSED)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("Cache tune not supported on this platform"));
+ return -1;
+}
+
+#endif /* ! __linux__ */
+
int
virResctrlInfoGetCache(virResctrlInfoPtr resctrl,
@@ -632,6 +663,8 @@ virResctrlAllocGetType(virResctrlAllocPtr resctrl,
}
+#ifdef __linux__
+
static int
virResctrlAllocUpdateMask(virResctrlAllocPtr resctrl,
unsigned int level,
@@ -659,6 +692,8 @@ virResctrlAllocUpdateMask(virResctrlAllocPtr resctrl,
return virBitmapCopy(a_type->masks[cache], mask);
}
+#endif
+
static int
virResctrlAllocUpdateSize(virResctrlAllocPtr resctrl,
@@ -878,6 +913,8 @@ virResctrlAllocFormat(virResctrlAllocPtr resctrl)
}
+#ifdef __linux__
+
static int
virResctrlAllocParseProcessCache(virResctrlInfoPtr resctrl,
virResctrlAllocPtr alloc,
@@ -1180,7 +1217,17 @@ virResctrlAllocGetUnused(virResctrlInfoPtr resctrl)
goto cleanup;
}
+#else /* ! __linux__ */
+
+virResctrlAllocPtr
+virResctrlAllocGetUnused(virResctrlInfoPtr resctrl ATTRIBUTE_UNUSED)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("Cache tune not supported on this platform"));
+ return NULL;
+}
+#endif /* ! __linux__ */
static int
virResctrlAllocSetMask(virResctrlAllocPerTypePtr a_type,
--
2.14.3
6 years, 10 months
[libvirt] [PATCH 0/7] Last CAT fixups
by Martin Kletzander
Few finishing touches for the Cache Allocation Technology. This series
copies the default group's mask to newly created groups, fixes a
possible wrong memory access, cleans up after domains even if daemon
was restarted, and then reorders the functions in virresctrl.c so that
it's nice to find the non-Linux stubs and Linux-only functions. And the
last thing is just one variable rename that was forgotten before.
Martin Kletzander (8):
util: Add helpers for getting resctrl group allocs
util: Use default group's mask for unspecified resctrl allocations
util: Don't overwrite mask in virResctrlAllocFindUnused
qemu: Restore machinename even without cgroups
util: Extract path formatting into virResctrlAllocDeterminePath
qemu: Restore resctrl alloc data after restart
util: Reorder functions in virresctrl to minimize stubs
util: Rename resctrl to alloc in virResctrlAllocUpdateMask to be
consistent
src/libvirt_linux.syms | 3 +
src/libvirt_private.syms | 2 +-
src/qemu/qemu_cgroup.c | 4 -
src/qemu/qemu_process.c | 11 +
src/util/virresctrl.c | 1620 +++++++++++++++++++++++-----------------------
src/util/virresctrl.h | 4 +
6 files changed, 843 insertions(+), 801 deletions(-)
--
2.16.1
6 years, 10 months
[libvirt] [PATCH go-xml] Add reconnect support for vhost-user interfaces
by Andrea Bolognani
Introduced in libvirt commit 614be3b88276.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Does this look like Go to you? Because I have no idea what I'm doing.
domain.go | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/domain.go b/domain.go
index 429e61b..4f7725a 100644
--- a/domain.go
+++ b/domain.go
@@ -392,9 +392,10 @@ type DomainInterfaceSourceEthernet struct {
}
type DomainInterfaceSourceVHostUser struct {
- Type string `xml:"type,attr"`
- Path string `xml:"path,attr,omitempty"`
- Mode string `xml:"mode,attr,omitempty"`
+ Type string `xml:"type,attr"`
+ Path string `xml:"path,attr,omitempty"`
+ Mode string `xml:"mode,attr,omitempty"`
+ Reconnect *DomainInterfaceSourceReconnect `xml:"reconnect"`
}
type DomainInterfaceSourceServer struct {
@@ -449,6 +450,11 @@ type DomainInterfaceSourceLocal struct {
Port uint `xml:"port,attr,omitempty"`
}
+type DomainInterfaceSourceReconnect struct {
+ Enabled string `xml:"enabled,attr"`
+ Timeout *uint `xml:"timeout,attr"`
+}
+
type DomainInterfaceTarget struct {
Dev string `xml:"dev,attr"`
}
--
2.14.3
6 years, 10 months
[libvirt] [PATCH v2] vbox: fix SEGV during dumpxml of a serial port
by Laine Stump
commit 77a12987a48 changed the "virDomainChrSourceDef source" inside
virDomainChrDef to "virDomainChrSourceDefPtr source", and started
allocating source inside virDomainChrDefNew(), but vboxDumpSerial()
was allocating a virDomainChrDef with a simple VIR_ALLOC() (i.e. never
calling virDomainChrDefNew()), so source was never initialized,
leading to a SEGV any time a serial port was present. The same problem
was created in vboxDumpParallel().
This patch changes vboxDumpSerial() and vboxDumpParallel() to use
virDomainChrDefNew() instead of VIR_ALLOC(), and changes both of those
functions to return an error if virDomainChrDef() (or any other
allocation) fails.
This resolves: https://bugzilla.redhat.com/1536649
---
Change from V1:
Due to reviews of V1 whining about the patch calling out the lack of
returning failure on OOM in a comment rather than fixing it, V2
changes both functions to return 0/-1, and their caller to abort the
dumpxml if they return -1. (If I'd taken the extra 30 seconds to look
one level up the call chain before posting V1, I would have done that
to begin with - there's really nothing complicated about the change,
so I'm just as comfortable posting this V2 patch without being able to
test as I was with V1).
src/vbox/vbox_common.c | 43 +++++++++++++++++++++++++++++++------------
1 file changed, 31 insertions(+), 12 deletions(-)
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 33aefabe5..e8381ac95 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -3862,7 +3862,7 @@ vboxDumpAudio(virDomainDefPtr def, vboxDriverPtr data ATTRIBUTE_UNUSED,
}
}
-static void
+static int
vboxDumpSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUint32 serialPortCount)
{
PRUint32 serialPortIncCount = 0;
@@ -3886,9 +3886,15 @@ vboxDumpSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUin
}
/* Allocate memory for the serial ports which are enabled */
- if ((def->nserials > 0) && (VIR_ALLOC_N(def->serials, def->nserials) >= 0)) {
- for (i = 0; i < def->nserials; i++)
- ignore_value(VIR_ALLOC(def->serials[i]));
+ if (def->nserials > 0) {
+ if (VIR_ALLOC_N(def->serials, def->nserials) < 0)
+ return -1;
+
+ for (i = 0; i < def->nserials; i++) {
+ def->serials[i] = virDomainChrDefNew(NULL);
+ if (!def->serials[i])
+ return -1;
+ }
}
/* Now get the details about the serial ports here */
@@ -3936,7 +3942,8 @@ vboxDumpSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUin
if (pathUtf16) {
VBOX_UTF16_TO_UTF8(pathUtf16, &path);
- ignore_value(VIR_STRDUP(def->serials[serialPortIncCount]->source->data.file.path, path));
+ if (VIR_STRDUP(def->serials[serialPortIncCount]->source->data.file.path, path) < 0)
+ return -1;
}
serialPortIncCount++;
@@ -3948,9 +3955,10 @@ vboxDumpSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUin
VBOX_RELEASE(serialPort);
}
}
+ return 0;
}
-static void
+static int
vboxDumpParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUint32 parallelPortCount)
{
PRUint32 parallelPortIncCount = 0;
@@ -3974,9 +3982,15 @@ vboxDumpParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRU
}
/* Allocate memory for the parallel ports which are enabled */
- if ((def->nparallels > 0) && (VIR_ALLOC_N(def->parallels, def->nparallels) >= 0)) {
- for (i = 0; i < def->nparallels; i++)
- ignore_value(VIR_ALLOC(def->parallels[i]));
+ if (def->nparallels > 0) {
+ if (VIR_ALLOC_N(def->parallels, def->nparallels) < 0)
+ return -1;
+
+ for (i = 0; i < def->nparallels; i++) {
+ def->parallels[i] = virDomainChrDefNew(NULL);
+ if (!def->parallels[i])
+ return -1;
+ }
}
/* Now get the details about the parallel ports here */
@@ -4011,7 +4025,8 @@ vboxDumpParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRU
gVBoxAPI.UIParallelPort.GetPath(parallelPort, &pathUtf16);
VBOX_UTF16_TO_UTF8(pathUtf16, &path);
- ignore_value(VIR_STRDUP(def->parallels[parallelPortIncCount]->source->data.file.path, path));
+ if (VIR_STRDUP(def->parallels[parallelPortIncCount]->source->data.file.path, path) < 0)
+ return -1;
parallelPortIncCount++;
@@ -4022,6 +4037,7 @@ vboxDumpParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRU
VBOX_RELEASE(parallelPort);
}
}
+ return 0;
}
static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
@@ -4162,8 +4178,11 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
vboxDumpSharedFolders(def, data, machine);
vboxDumpNetwork(def, data, machine, networkAdapterCount);
vboxDumpAudio(def, data, machine);
- vboxDumpSerial(def, data, machine, serialPortCount);
- vboxDumpParallel(def, data, machine, parallelPortCount);
+
+ if (vboxDumpSerial(def, data, machine, serialPortCount) < 0)
+ goto cleanup;
+ if (vboxDumpParallel(def, data, machine, parallelPortCount) < 0)
+ goto cleanup;
/* dump USB devices/filters if active */
vboxHostDeviceGetXMLDesc(data, def, machine);
--
2.14.3
6 years, 10 months
[libvirt] [PATCH 0/2] Fix parsing of iSCSI LUN from JSON backing store strings
by Peter Krempa
Peter Krempa (2):
util: json: Add helper to return string or number properties as string
util: storage: Parse 'lun' for iSCSI protocol from JSON as string or
number
src/util/virjson.c | 27 +++++++++++++++++++++++++++
src/util/virjson.h | 1 +
src/util/virstoragefile.c | 13 +++++--------
tests/virstoragetest.c | 2 +-
4 files changed, 34 insertions(+), 9 deletions(-)
--
2.15.0
6 years, 10 months
[libvirt] [PATCH] tests: Remove caps from DO_TEST_PARSE_ERROR() calls
by Andrea Bolognani
The lack of certain capabilities is going to cause errors pretty
much exclusively when building the QEMU command line, because we
purposefully leave such checks to the very last moments before
starting a guest; so it doesn't make much sense to pass QEMU
capabilities to DO_TEST_PARSE_ERROR() call which are supposed,
as the name implies, to result in much earlier error.
The only exception is the "cpu-hotplug-granularity" test, due
to the fact that the checks we want to fail are skipped entirely
if the relevant QEMU feature is not available.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
tests/qemuxml2argvtest.c | 184 +++++++++++++----------------------------------
1 file changed, 51 insertions(+), 133 deletions(-)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index c8739909d..2df778853 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -743,9 +743,7 @@ mymain(void)
DO_TEST("boot-menu-disable-drive-bootindex",
QEMU_CAPS_BOOT_MENU,
QEMU_CAPS_BOOTINDEX);
- DO_TEST_PARSE_ERROR("boot-dev+order",
- QEMU_CAPS_BOOTINDEX,
- QEMU_CAPS_VIRTIO_BLK_SCSI);
+ DO_TEST_PARSE_ERROR("boot-dev+order", NONE);
DO_TEST("boot-order",
QEMU_CAPS_BOOTINDEX,
QEMU_CAPS_VIRTIO_BLK_SCSI);
@@ -959,8 +957,7 @@ mymain(void)
VIR_FREE(driver.config->vxhsTLSx509certdir);
DO_TEST("disk-drive-no-boot",
QEMU_CAPS_BOOTINDEX);
- DO_TEST_PARSE_ERROR("disk-device-lun-type-invalid",
- QEMU_CAPS_VIRTIO_SCSI);
+ DO_TEST_PARSE_ERROR("disk-device-lun-type-invalid", NONE);
DO_TEST_FAILURE("disk-usb-nosupport", NONE);
DO_TEST("disk-usb-device",
QEMU_CAPS_DEVICE_USB_STORAGE,
@@ -1037,17 +1034,10 @@ mymain(void)
QEMU_CAPS_DRIVE_DISCARD,
QEMU_CAPS_DRIVE_DETECT_ZEROES);
DO_TEST("disk-snapshot", NONE);
- DO_TEST_PARSE_ERROR("disk-same-targets",
- QEMU_CAPS_SCSI_LSI,
- QEMU_CAPS_DEVICE_USB_STORAGE, QEMU_CAPS_NODEFCONFIG);
- DO_TEST_PARSE_ERROR("disk-drive-address-conflict",
- QEMU_CAPS_ICH9_AHCI);
- DO_TEST_PARSE_ERROR("disk-hostdev-scsi-address-conflict",
- QEMU_CAPS_VIRTIO_SCSI,
- QEMU_CAPS_DEVICE_SCSI_GENERIC);
- DO_TEST_PARSE_ERROR("hostdevs-drive-address-conflict",
- QEMU_CAPS_VIRTIO_SCSI,
- QEMU_CAPS_DEVICE_SCSI_GENERIC);
+ DO_TEST_PARSE_ERROR("disk-same-targets", NONE);
+ DO_TEST_PARSE_ERROR("disk-drive-address-conflict", NONE);
+ DO_TEST_PARSE_ERROR("disk-hostdev-scsi-address-conflict", NONE);
+ DO_TEST_PARSE_ERROR("hostdevs-drive-address-conflict", NONE);
DO_TEST("event_idx",
QEMU_CAPS_VIRTIO_BLK_EVENT_IDX,
QEMU_CAPS_VIRTIO_NET_EVENT_IDX,
@@ -1060,14 +1050,10 @@ mymain(void)
DO_TEST("disk-serial",
QEMU_CAPS_KVM,
QEMU_CAPS_DRIVE_SERIAL);
- DO_TEST_PARSE_ERROR("disk-fdc-incompatible-address",
- NONE);
- DO_TEST_PARSE_ERROR("disk-ide-incompatible-address",
- NONE);
- DO_TEST_PARSE_ERROR("disk-sata-incompatible-address",
- QEMU_CAPS_ICH9_AHCI);
- DO_TEST_PARSE_ERROR("disk-scsi-incompatible-address",
- QEMU_CAPS_VIRTIO_SCSI);
+ DO_TEST_PARSE_ERROR("disk-fdc-incompatible-address", NONE);
+ DO_TEST_PARSE_ERROR("disk-ide-incompatible-address", NONE);
+ DO_TEST_PARSE_ERROR("disk-sata-incompatible-address", NONE);
+ DO_TEST_PARSE_ERROR("disk-scsi-incompatible-address", NONE);
DO_TEST("graphics-vnc", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA);
DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC, QEMU_CAPS_DEVICE_CIRRUS_VGA);
@@ -1396,12 +1382,8 @@ mymain(void)
QEMU_CAPS_DEVICE_VIRTIO_RNG,
QEMU_CAPS_OBJECT_RNG_EGD,
QEMU_CAPS_CCID_PASSTHRU);
- DO_TEST_PARSE_ERROR("chardev-reconnect-invalid-timeout",
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_CHARDEV_RECONNECT);
- DO_TEST_PARSE_ERROR("chardev-reconnect-generated-path",
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_CHARDEV_RECONNECT);
+ DO_TEST_PARSE_ERROR("chardev-reconnect-invalid-timeout", NONE);
+ DO_TEST_PARSE_ERROR("chardev-reconnect-generated-path", NONE);
DO_TEST("usb-controller",
QEMU_CAPS_NODEFCONFIG);
@@ -1419,10 +1401,7 @@ mymain(void)
QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_PCI_MULTIFUNCTION,
QEMU_CAPS_ICH9_USB_EHCI1);
- DO_TEST_PARSE_ERROR("usb-ich9-no-companion",
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_PCI_MULTIFUNCTION,
- QEMU_CAPS_ICH9_USB_EHCI1);
+ DO_TEST_PARSE_ERROR("usb-ich9-no-companion", NONE);
DO_TEST("usb-ich9-autoassign",
QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_PCI_MULTIFUNCTION,
@@ -1437,12 +1416,8 @@ mymain(void)
DO_TEST("usb-hub-autoadd-deluxe",
QEMU_CAPS_USB_HUB,
QEMU_CAPS_NODEFCONFIG);
- DO_TEST_PARSE_ERROR("usb-hub-conflict",
- QEMU_CAPS_USB_HUB,
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST_PARSE_ERROR("usb-hub-nonexistent",
- QEMU_CAPS_USB_HUB,
- QEMU_CAPS_NODEFCONFIG);
+ DO_TEST_PARSE_ERROR("usb-hub-conflict", NONE);
+ DO_TEST_PARSE_ERROR("usb-hub-nonexistent", NONE);
DO_TEST("usb-port-missing",
QEMU_CAPS_USB_HUB,
QEMU_CAPS_NODEFCONFIG);
@@ -1452,9 +1427,7 @@ mymain(void)
DO_TEST("usb-ports",
QEMU_CAPS_USB_HUB,
QEMU_CAPS_NODEFCONFIG);
- DO_TEST_PARSE_ERROR("usb-ports-out-of-range",
- QEMU_CAPS_USB_HUB,
- QEMU_CAPS_NODEFCONFIG);
+ DO_TEST_PARSE_ERROR("usb-ports-out-of-range", NONE);
DO_TEST("usb-port-autoassign",
QEMU_CAPS_USB_HUB,
QEMU_CAPS_NODEFCONFIG);
@@ -1499,13 +1472,9 @@ mymain(void)
QEMU_CAPS_ICH9_USB_EHCI1);
DO_TEST("usb-none",
QEMU_CAPS_NODEFCONFIG);
- DO_TEST_PARSE_ERROR("usb-none-other",
- QEMU_CAPS_NODEFCONFIG);
- DO_TEST_PARSE_ERROR("usb-none-hub",
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_USB_HUB);
- DO_TEST_PARSE_ERROR("usb-none-usbtablet",
- QEMU_CAPS_NODEFCONFIG);
+ DO_TEST_PARSE_ERROR("usb-none-other", NONE);
+ DO_TEST_PARSE_ERROR("usb-none-hub", NONE);
+ DO_TEST_PARSE_ERROR("usb-none-usbtablet", NONE);
DO_TEST("usb-controller-default-q35",
QEMU_CAPS_DEVICE_IOH3420,
QEMU_CAPS_PCI_OHCI,
@@ -1535,19 +1504,14 @@ mymain(void)
QEMU_CAPS_NEC_USB_XHCI,
QEMU_CAPS_NEC_USB_XHCI_PORTS,
QEMU_CAPS_USB_HUB);
- DO_TEST_PARSE_ERROR("usb-controller-xhci-limit",
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_PIIX3_USB_UHCI,
- QEMU_CAPS_NEC_USB_XHCI,
- QEMU_CAPS_NEC_USB_XHCI_PORTS);
+ DO_TEST_PARSE_ERROR("usb-controller-xhci-limit", NONE);
DO_TEST("usb-controller-qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI);
DO_TEST_FAILURE("usb-controller-qemu-xhci-unavailable", NONE);
- DO_TEST_PARSE_ERROR("usb-controller-qemu-xhci-limit",
- QEMU_CAPS_DEVICE_QEMU_XHCI);
+ DO_TEST_PARSE_ERROR("usb-controller-qemu-xhci-limit", NONE);
DO_TEST("smbios", QEMU_CAPS_SMBIOS_TYPE);
- DO_TEST_PARSE_ERROR("smbios-date", QEMU_CAPS_SMBIOS_TYPE);
- DO_TEST_PARSE_ERROR("smbios-uuid-match", QEMU_CAPS_SMBIOS_TYPE);
+ DO_TEST_PARSE_ERROR("smbios-date", NONE);
+ DO_TEST_PARSE_ERROR("smbios-uuid-match", NONE);
DO_TEST("watchdog", NONE);
DO_TEST("watchdog-device", QEMU_CAPS_NODEFCONFIG);
@@ -1601,12 +1565,8 @@ mymain(void)
DO_TEST("hostdev-mdev-precreated",
QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_DEVICE_VFIO_PCI);
- DO_TEST_PARSE_ERROR("hostdev-mdev-src-address-invalid",
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_DEVICE_VFIO_PCI);
- DO_TEST_PARSE_ERROR("hostdev-mdev-invalid-target-address",
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_DEVICE_VFIO_PCI);
+ DO_TEST_PARSE_ERROR("hostdev-mdev-src-address-invalid", NONE);
+ DO_TEST_PARSE_ERROR("hostdev-mdev-invalid-target-address", NONE);
DO_TEST_FAILURE("hostdev-vfio-multidomain",
QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VFIO_PCI);
DO_TEST("pci-rom",
@@ -1695,7 +1655,7 @@ mymain(void)
DO_TEST_FAILURE("luks-disks", QEMU_CAPS_OBJECT_SECRET);
# endif
DO_TEST_PARSE_ERROR("luks-disk-invalid", NONE);
- DO_TEST_PARSE_ERROR("luks-disks-source-both", QEMU_CAPS_OBJECT_SECRET);
+ DO_TEST_PARSE_ERROR("luks-disks-source-both", NONE);
DO_TEST("memtune", NONE);
DO_TEST("memtune-unlimited", NONE);
@@ -1799,8 +1759,7 @@ mymain(void)
DO_TEST("pseries-vio-user-assigned",
QEMU_CAPS_DEVICE_SPAPR_VTY,
QEMU_CAPS_NODEFCONFIG);
- DO_TEST_PARSE_ERROR("pseries-vio-address-clash",
- QEMU_CAPS_NODEFCONFIG);
+ DO_TEST_PARSE_ERROR("pseries-vio-address-clash", NONE);
DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_NVRAM);
DO_TEST("pseries-usb-kbd", QEMU_CAPS_PCI_OHCI,
QEMU_CAPS_DEVICE_USB_KBD,
@@ -1809,8 +1768,7 @@ mymain(void)
DO_TEST("pseries-cpu-exact",
QEMU_CAPS_DEVICE_SPAPR_VTY,
QEMU_CAPS_NODEFCONFIG);
- DO_TEST_PARSE_ERROR("pseries-no-parallel",
- QEMU_CAPS_NODEFCONFIG);
+ DO_TEST_PARSE_ERROR("pseries-no-parallel", NONE);
qemuTestSetHostArch(driver.caps, VIR_ARCH_PPC64);
DO_TEST("pseries-cpu-compat", QEMU_CAPS_KVM,
@@ -1898,10 +1856,7 @@ mymain(void)
DO_TEST_FAILURE("pseries-hpt-resizing",
QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_MACHINE_OPT);
- DO_TEST_PARSE_ERROR("pseries-hpt-resizing-invalid-machine",
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_MACHINE_OPT,
- QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
+ DO_TEST_PARSE_ERROR("pseries-hpt-resizing-invalid-machine", NONE);
DO_TEST("pseries-serial-native",
QEMU_CAPS_NODEFCONFIG,
@@ -2041,9 +1996,7 @@ mymain(void)
QEMU_CAPS_DEVICE_VIRTIO_RNG,
QEMU_CAPS_OBJECT_RNG_EGD,
QEMU_CAPS_OBJECT_RNG_RANDOM);
- DO_TEST_PARSE_ERROR("virtio-rng-egd-crash",
- QEMU_CAPS_DEVICE_VIRTIO_RNG,
- QEMU_CAPS_OBJECT_RNG_EGD);
+ DO_TEST_PARSE_ERROR("virtio-rng-egd-crash", NONE);
DO_TEST("virtio-rng-ccw",
QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_BOOTINDEX,
@@ -2077,10 +2030,7 @@ mymain(void)
QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_VIRTIO_CCW,
QEMU_CAPS_VIRTIO_S390);
- DO_TEST_PARSE_ERROR("s390-no-parallel",
- QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_VIRTIO_CCW,
- QEMU_CAPS_VIRTIO_S390);
+ DO_TEST_PARSE_ERROR("s390-no-parallel", NONE);
DO_TEST("s390-serial",
QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_VIRTIO_CCW,
@@ -2106,8 +2056,7 @@ mymain(void)
DO_TEST("tpm-passthrough",
QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_TIS);
- DO_TEST_PARSE_ERROR("tpm-no-backend-invalid",
- QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_TIS);
+ DO_TEST_PARSE_ERROR("tpm-no-backend-invalid", NONE);
DO_TEST_PARSE_ERROR("pci-domain-invalid", NONE);
@@ -2144,14 +2093,8 @@ mymain(void)
QEMU_CAPS_ICH9_USB_EHCI1,
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
QEMU_CAPS_DEVICE_QXL);
- DO_TEST_PARSE_ERROR("q35-dmi-bad-address1",
- QEMU_CAPS_DEVICE_PCI_BRIDGE,
- QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
- QEMU_CAPS_DEVICE_IOH3420);
- DO_TEST_PARSE_ERROR("q35-dmi-bad-address2",
- QEMU_CAPS_DEVICE_PCI_BRIDGE,
- QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
- QEMU_CAPS_DEVICE_IOH3420);
+ DO_TEST_PARSE_ERROR("q35-dmi-bad-address1", NONE);
+ DO_TEST_PARSE_ERROR("q35-dmi-bad-address2", NONE);
DO_TEST("q35-pm-disable",
QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_IOH3420,
@@ -2382,21 +2325,11 @@ mymain(void)
QEMU_CAPS_DEVICE_IOH3420,
QEMU_CAPS_HDA_DUPLEX);
- DO_TEST_PARSE_ERROR("q35-wrong-root",
- QEMU_CAPS_DEVICE_IOH3420,
- QEMU_CAPS_ICH9_AHCI,
- QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_ICH9_USB_EHCI1,
- QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
- QEMU_CAPS_DEVICE_QXL);
+ DO_TEST_PARSE_ERROR("q35-wrong-root", NONE);
DO_TEST_PARSE_ERROR("440fx-wrong-root", NONE);
DO_TEST_PARSE_ERROR("440fx-ide-address-conflict", NONE);
- DO_TEST_PARSE_ERROR("pcie-root-port-too-many",
- QEMU_CAPS_DEVICE_IOH3420,
- QEMU_CAPS_ICH9_AHCI,
- QEMU_CAPS_PCI_MULTIFUNCTION,
- QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
- QEMU_CAPS_DEVICE_QXL);
+ DO_TEST_PARSE_ERROR("pcie-root-port-too-many", NONE);
DO_TEST("pcie-switch-upstream-port",
QEMU_CAPS_DEVICE_IOH3420,
@@ -2415,26 +2348,17 @@ mymain(void)
DO_TEST("pci-expander-bus",
QEMU_CAPS_DEVICE_PXB);
- DO_TEST_PARSE_ERROR("pci-expander-bus-bad-node",
- QEMU_CAPS_DEVICE_PXB);
- DO_TEST_PARSE_ERROR("pci-expander-bus-bad-machine",
- QEMU_CAPS_DEVICE_PXB);
- DO_TEST_PARSE_ERROR("pci-expander-bus-bad-bus",
- QEMU_CAPS_DEVICE_PXB);
+ DO_TEST_PARSE_ERROR("pci-expander-bus-bad-node", NONE);
+ DO_TEST_PARSE_ERROR("pci-expander-bus-bad-machine", NONE);
+ DO_TEST_PARSE_ERROR("pci-expander-bus-bad-bus", NONE);
DO_TEST("pcie-expander-bus",
QEMU_CAPS_DEVICE_IOH3420,
QEMU_CAPS_DEVICE_X3130_UPSTREAM,
QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM,
QEMU_CAPS_DEVICE_PXB_PCIE);
- DO_TEST_PARSE_ERROR("pcie-expander-bus-bad-machine",
- QEMU_CAPS_DEVICE_IOH3420,
- QEMU_CAPS_DEVICE_X3130_UPSTREAM,
- QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM,
- QEMU_CAPS_DEVICE_PXB_PCIE);
- DO_TEST_PARSE_ERROR("pcie-expander-bus-bad-bus",
- QEMU_CAPS_DEVICE_IOH3420,
- QEMU_CAPS_DEVICE_PXB_PCIE);
+ DO_TEST_PARSE_ERROR("pcie-expander-bus-bad-machine", NONE);
+ DO_TEST_PARSE_ERROR("pcie-expander-bus-bad-bus", NONE);
DO_TEST("hostdev-scsi-lsi",
QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_LSI,
@@ -2653,9 +2577,7 @@ mymain(void)
DO_TEST_GIC("aarch64-gic-host", GIC_BOTH,
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT,
QEMU_CAPS_MACH_VIRT_GIC_VERSION);
- DO_TEST_PARSE_ERROR("aarch64-gic-invalid",
- QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT,
- QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+ DO_TEST_PARSE_ERROR("aarch64-gic-invalid", NONE);
DO_TEST_FAILURE("aarch64-gic-not-virt",
QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT,
QEMU_CAPS_MACH_VIRT_GIC_VERSION);
@@ -2822,14 +2744,8 @@ mymain(void)
QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_VIRTIO_CCW,
QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_BOOTINDEX,
QEMU_CAPS_LOADPARM);
- DO_TEST_PARSE_ERROR("machine-loadparm-s390-char-invalid",
- QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_VIRTIO_CCW,
- QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_BOOTINDEX,
- QEMU_CAPS_LOADPARM);
- DO_TEST_PARSE_ERROR("machine-loadparm-s390-len-invalid",
- QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_VIRTIO_CCW,
- QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_BOOTINDEX,
- QEMU_CAPS_LOADPARM);
+ DO_TEST_PARSE_ERROR("machine-loadparm-s390-char-invalid", NONE);
+ DO_TEST_PARSE_ERROR("machine-loadparm-s390-len-invalid", NONE);
DO_TEST("qemu-ns-domain-ns0", NONE);
DO_TEST("qemu-ns-domain-commandline", NONE);
@@ -2877,8 +2793,7 @@ mymain(void)
DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);
DO_TEST("usb-long-port-path", QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_USB_HUB);
- DO_TEST_PARSE_ERROR("usb-too-long-port-path-invalid",
- QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_USB_HUB);
+ DO_TEST_PARSE_ERROR("usb-too-long-port-path-invalid", NONE);
DO_TEST("acpi-table", NONE);
DO_TEST("intel-iommu",
@@ -2915,6 +2830,9 @@ mymain(void)
QEMU_CAPS_DEVICE_INTEL_IOMMU);
DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
+ /* The _QUERY_HOTPLUGGABLE_CPUS capability is needed here because, if
+ * not present, libvirt will not perform the vCPU hotplug granularity
+ * validation and the test will pass rather than failing */
DO_TEST_PARSE_ERROR("cpu-hotplug-granularity",
QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS);
@@ -2954,9 +2872,9 @@ mymain(void)
DO_TEST("cpu-cache-passthrough", QEMU_CAPS_KVM, QEMU_CAPS_CPU_CACHE);
DO_TEST("cpu-cache-passthrough2", QEMU_CAPS_KVM);
DO_TEST("cpu-cache-emulate-l3", QEMU_CAPS_KVM, QEMU_CAPS_CPU_CACHE);
- DO_TEST_PARSE_ERROR("cpu-cache-emulate-l2", QEMU_CAPS_KVM);
- DO_TEST_PARSE_ERROR("cpu-cache-passthrough3", QEMU_CAPS_KVM);
- DO_TEST_PARSE_ERROR("cpu-cache-passthrough-l3", QEMU_CAPS_KVM);
+ DO_TEST_PARSE_ERROR("cpu-cache-emulate-l2", NONE);
+ DO_TEST_PARSE_ERROR("cpu-cache-passthrough3", NONE);
+ DO_TEST_PARSE_ERROR("cpu-cache-passthrough-l3", NONE);
DO_TEST("vmcoreinfo", QEMU_CAPS_DEVICE_VMCOREINFO);
DO_TEST("user-aliases", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_CIRRUS_VGA,
--
2.14.3
6 years, 10 months