[PATCH v3] conf: add 'isa' controller type
by Roman Bogorodskiy
Decided to revive this patch to address
https://gitlab.com/libvirt/libvirt/-/issues/45.
Changes from v2:
- Rebased to master,
- Added bhyveDomainDeviceDefValidate() to disallow ISA
controllers idx other than 0 because we don't support
more than one ISA controller.
----
Introduce 'isa' controller type. The only supported model
now is 'isa-bridge'. In domain XML it looks this way:
...
<controller type='isa' index='1' model='isa-bridge'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x0'/>
</controller>
...
Currently, this is needed for the bhyve driver to allow choosing a
specific PCI address for that. In bhyve, this controller is used to
attach serial ports and a boot ROM.
bhyve: support 'isa' controller for LPC
Support modeling of the 'isa' controller for bhyve. When controller is
not present in the domain XML, but domain requires it to be there (e.g.
because bootrom is used), implicitly add addition of this controller to
the command line arguments, and bind it to PCI slot 1.
PCI slot 1 is always reserved still. User can manually define any PCI
slot for the 'isa' controller, including PCI slot 1, but other devices
are not allowed to use this address.
bhyve: automatically add 'isa' controller
When domain configuration requires the 'isa' controller to be present,
automatically add it on domain post-parse stage.
Now, as this controller is always available when needed, it's not
necessary to implicitly add it to the bhyve command line, so remove
bhyveBuildLPCArgStr().
Also, make bhyveDomainDefNeedsISAController() static as it's no longer
used outside of bhyve_domain.c.
bhyve: validate that ISA controller always has index 0
More than one ISA controller is not supported by bhyve,
and multiple controllers with the same index are forbidden,
so forbid ISA controllers with non-zero index for bhyve.
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
docs/schemas/domaincommon.rng | 6 ++++
src/bhyve/bhyve_command.c | 27 +++++++-------
src/bhyve/bhyve_device.c | 23 +++++++++---
src/bhyve/bhyve_domain.c | 25 +++++++++++--
src/bhyve/bhyve_domain.h | 2 --
src/conf/domain_conf.c | 9 +++++
src/conf/domain_conf.h | 8 +++++
src/qemu/qemu_command.c | 1 +
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain_address.c | 1 +
src/qemu/qemu_validate.c | 1 +
src/vbox/vbox_common.c | 1 +
...ml2argv-addr-isa-controller-on-slot-1.args | 10 ++++++
...2argv-addr-isa-controller-on-slot-1.ldargs | 3 ++
...xml2argv-addr-isa-controller-on-slot-1.xml | 26 ++++++++++++++
...l2argv-addr-isa-controller-on-slot-31.args | 10 ++++++
...argv-addr-isa-controller-on-slot-31.ldargs | 3 ++
...ml2argv-addr-isa-controller-on-slot-31.xml | 26 ++++++++++++++
...argv-addr-non-isa-controller-on-slot-1.xml | 23 ++++++++++++
.../bhyvexml2argv-console.args | 2 +-
.../bhyvexml2argv-isa-controller.args | 10 ++++++
.../bhyvexml2argv-isa-controller.ldargs | 3 ++
.../bhyvexml2argv-isa-controller.xml | 24 +++++++++++++
...bhyvexml2argv-isa-multiple-controllers.xml | 25 +++++++++++++
.../bhyvexml2argv-serial-grub-nocons.args | 2 +-
.../bhyvexml2argv-serial-grub.args | 2 +-
.../bhyvexml2argv-serial.args | 2 +-
.../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +--
.../bhyvexml2argv-vnc-autoport.args | 4 +--
.../bhyvexml2argv-vnc-vgaconf-io.args | 4 +--
.../bhyvexml2argv-vnc-vgaconf-off.args | 4 +--
.../bhyvexml2argv-vnc-vgaconf-on.args | 4 +--
.../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +--
tests/bhyvexml2argvtest.c | 5 +++
...l2xmlout-addr-isa-controller-on-slot-1.xml | 36 +++++++++++++++++++
...2xmlout-addr-isa-controller-on-slot-31.xml | 36 +++++++++++++++++++
.../bhyvexml2xmlout-console.xml | 3 ++
.../bhyvexml2xmlout-isa-controller.xml | 36 +++++++++++++++++++
.../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++
.../bhyvexml2xmlout-serial-grub.xml | 3 ++
.../bhyvexml2xmlout-serial.xml | 3 ++
.../bhyvexml2xmlout-vnc-autoport.xml | 3 ++
.../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++
.../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++
.../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++
.../bhyvexml2xmlout-vnc.xml | 3 ++
tests/bhyvexml2xmltest.c | 3 ++
47 files changed, 406 insertions(+), 37 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 4b4aa60c66..7bed99b161 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2416,6 +2416,12 @@
</attribute>
</optional>
</group>
+ <!-- isa -->
+ <group>
+ <attribute name="type">
+ <value>isa</value>
+ </attribute>
+ </group>
<!-- pci has an optional attribute "model" -->
<group>
<attribute name="type">
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index 22d0b24ec4..2a3e10d649 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -329,7 +329,8 @@ bhyveBuildControllerArgStr(const virDomainDef *def,
virDomainControllerDefPtr controller,
bhyveConnPtr driver,
virCommandPtr cmd,
- unsigned *nusbcontrollers)
+ unsigned *nusbcontrollers,
+ unsigned *nisacontrollers)
{
switch (controller->type) {
case VIR_DOMAIN_CONTROLLER_TYPE_PCI:
@@ -354,18 +355,20 @@ bhyveBuildControllerArgStr(const virDomainDef *def,
if (bhyveBuildUSBControllerArgStr(def, controller, cmd) < 0)
return -1;
break;
+ case VIR_DOMAIN_CONTROLLER_TYPE_ISA:
+ if (++*nisacontrollers > 1) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("only single ISA controller is supported"));
+ return -1;
+ }
+ virCommandAddArg(cmd, "-s");
+ virCommandAddArgFormat(cmd, "%d:0,lpc",
+ controller->info.addr.pci.slot);
+ break;
}
return 0;
}
-static int
-bhyveBuildLPCArgStr(const virDomainDef *def G_GNUC_UNUSED,
- virCommandPtr cmd)
-{
- virCommandAddArgList(cmd, "-s", "1,lpc", NULL);
- return 0;
-}
-
static int
bhyveBuildGraphicsArgStr(const virDomainDef *def,
virDomainGraphicsDefPtr graphics,
@@ -490,6 +493,7 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def,
virCommandPtr cmd = virCommandNew(BHYVE);
size_t i;
unsigned nusbcontrollers = 0;
+ unsigned nisacontrollers = 0;
unsigned nvcpus = virDomainDefGetVcpus(def);
/* CPUs */
@@ -595,7 +599,7 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def,
/* Devices */
for (i = 0; i < def->ncontrollers; i++) {
if (bhyveBuildControllerArgStr(def, def->controllers[i], driver, cmd,
- &nusbcontrollers) < 0)
+ &nusbcontrollers, &nisacontrollers) < 0)
goto error;
}
for (i = 0; i < def->nnets; i++) {
@@ -619,9 +623,6 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def,
}
}
- if (bhyveDomainDefNeedsISAController(def))
- bhyveBuildLPCArgStr(def, cmd);
-
if (bhyveBuildConsoleArgStr(def, cmd) < 0)
goto error;
diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c
index fc52280361..52a055f205 100644
--- a/src/bhyve/bhyve_device.c
+++ b/src/bhyve/bhyve_device.c
@@ -46,10 +46,16 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED,
if (addr->slot == 0) {
return 0;
} else if (addr->slot == 1) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("PCI bus 0 slot 1 is reserved for the implicit "
- "LPC PCI-ISA bridge"));
- return -1;
+ if (!(device->type == VIR_DOMAIN_DEVICE_CONTROLLER &&
+ device->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("PCI bus 0 slot 1 is reserved for the implicit "
+ "LPC PCI-ISA bridge"));
+ return -1;
+ } else {
+ /* We reserve slot 1 for LPC in bhyveAssignDevicePCISlots(), so exit early */
+ return 0;
+ }
}
}
@@ -101,6 +107,15 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def,
return -1;
}
+ for (i = 0; i < def->ncontrollers; i++) {
+ if ((def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA) &&
+ virDeviceInfoPCIAddressIsWanted(&def->controllers[i]->info)) {
+ def->controllers[i]->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
+ def->controllers[i]->info.addr.pci = lpc_addr;
+ break;
+ }
+ }
+
for (i = 0; i < def->ncontrollers; i++) {
if ((def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) ||
(def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) ||
diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c
index 95d6ffd31c..91994c3da5 100644
--- a/src/bhyve/bhyve_domain.c
+++ b/src/bhyve/bhyve_domain.c
@@ -59,13 +59,13 @@ virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks = {
.free = bhyveDomainObjPrivateFree,
};
-bool
+static bool
bhyveDomainDefNeedsISAController(virDomainDefPtr def)
{
if (def->os.bootloader == NULL && def->os.loader)
return true;
- if (def->nserials)
+ if (def->nserials || def->nconsoles)
return true;
if (def->ngraphics && def->nvideos)
@@ -95,6 +95,11 @@ bhyveDomainDefPostParse(virDomainDefPtr def,
VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) < 0)
return -1;
+ if (bhyveDomainDefNeedsISAController(def))
+ if (virDomainDefMaybeAddController(def, VIR_DOMAIN_CONTROLLER_TYPE_ISA, 0,
+ VIR_DOMAIN_CONTROLLER_MODEL_ISA_DEFAULT) < 0)
+ return -1;
+
return 0;
}
@@ -191,10 +196,26 @@ virBhyveDriverCreateXMLConf(bhyveConnPtr driver)
NULL, NULL);
}
+
+static int
+bhyveDomainDeviceDefValidate(const virDomainDeviceDef *dev,
+ const virDomainDef *def G_GNUC_UNUSED,
+ void *opaque G_GNUC_UNUSED)
+{
+ if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER &&
+ dev->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA &&
+ dev->data.controller->idx != 0) {
+ return -1;
+ }
+
+ return 0;
+}
+
virDomainDefParserConfig virBhyveDriverDomainDefParserConfig = {
.devicesPostParseCallback = bhyveDomainDeviceDefPostParse,
.domainPostParseCallback = bhyveDomainDefPostParse,
.assignAddressesCallback = bhyveDomainDefAssignAddresses,
+ .deviceValidateCallback = bhyveDomainDeviceDefValidate,
};
static void
diff --git a/src/bhyve/bhyve_domain.h b/src/bhyve/bhyve_domain.h
index e985278041..4e2b11b8de 100644
--- a/src/bhyve/bhyve_domain.h
+++ b/src/bhyve/bhyve_domain.h
@@ -39,5 +39,3 @@ virDomainXMLOptionPtr virBhyveDriverCreateXMLConf(bhyveConnPtr);
extern virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks;
extern virDomainDefParserConfig virBhyveDriverDomainDefParserConfig;
extern virXMLNamespace virBhyveDriverDomainXMLNamespace;
-
-bool bhyveDomainDefNeedsISAController(virDomainDefPtr def);
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d14485f18d..6befe4bbd8 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -399,6 +399,7 @@ VIR_ENUM_IMPL(virDomainController,
"usb",
"pci",
"xenbus",
+ "isa",
);
VIR_ENUM_IMPL(virDomainControllerModelPCI,
@@ -444,6 +445,9 @@ VIR_ENUM_IMPL(virDomainControllerModelSCSI,
"virtio-non-transitional",
);
+VIR_ENUM_IMPL(virDomainControllerModelISA, VIR_DOMAIN_CONTROLLER_MODEL_ISA_LAST,
+);
+
VIR_ENUM_IMPL(virDomainControllerModelUSB,
VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST,
"piix3-uhci",
@@ -2312,6 +2316,7 @@ virDomainControllerDefNew(virDomainControllerType type)
case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
case VIR_DOMAIN_CONTROLLER_TYPE_SATA:
case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
+ case VIR_DOMAIN_CONTROLLER_TYPE_ISA:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
break;
}
@@ -10975,6 +10980,8 @@ virDomainControllerModelTypeFromString(const virDomainControllerDef *def,
return virDomainControllerModelIDETypeFromString(model);
else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL)
return virDomainControllerModelVirtioSerialTypeFromString(model);
+ else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)
+ return virDomainControllerModelISATypeFromString(model);
return -1;
}
@@ -10994,6 +11001,8 @@ virDomainControllerModelTypeToString(virDomainControllerDefPtr def,
return virDomainControllerModelIDETypeToString(model);
else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL)
return virDomainControllerModelVirtioSerialTypeToString(model);
+ else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_ISA)
+ return virDomainControllerModelISATypeToString(model);
return NULL;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 6a737591e2..188385cc6b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -595,6 +595,7 @@ typedef enum {
VIR_DOMAIN_CONTROLLER_TYPE_USB,
VIR_DOMAIN_CONTROLLER_TYPE_PCI,
VIR_DOMAIN_CONTROLLER_TYPE_XENBUS,
+ VIR_DOMAIN_CONTROLLER_TYPE_ISA,
VIR_DOMAIN_CONTROLLER_TYPE_LAST
} virDomainControllerType;
@@ -686,6 +687,12 @@ typedef enum {
VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_LAST
} virDomainControllerModelVirtioSerial;
+typedef enum {
+ VIR_DOMAIN_CONTROLLER_MODEL_ISA_DEFAULT = -1,
+
+ VIR_DOMAIN_CONTROLLER_MODEL_ISA_LAST
+} virDomainControllerModelISA;
+
#define IS_USB2_CONTROLLER(ctrl) \
(((ctrl)->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) && \
((ctrl)->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1 || \
@@ -3547,6 +3554,7 @@ VIR_ENUM_DECL(virDomainControllerModelSCSI);
VIR_ENUM_DECL(virDomainControllerModelUSB);
VIR_ENUM_DECL(virDomainControllerModelIDE);
VIR_ENUM_DECL(virDomainControllerModelVirtioSerial);
+VIR_ENUM_DECL(virDomainControllerModelISA);
VIR_ENUM_DECL(virDomainFS);
VIR_ENUM_DECL(virDomainFSDriver);
VIR_ENUM_DECL(virDomainFSAccessMode);
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 24e99e13b8..d4e190a1ae 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2699,6 +2699,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
+ case VIR_DOMAIN_CONTROLLER_TYPE_ISA:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported controller type: %s"),
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 2d9d8226d6..f5dbadb323 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5054,6 +5054,7 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont,
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
+ case VIR_DOMAIN_CONTROLLER_TYPE_ISA:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
break;
}
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 058cbda2a2..4e548d2f43 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -677,6 +677,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
+ case VIR_DOMAIN_CONTROLLER_TYPE_ISA:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
return 0;
}
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index bd7590a00a..b5f9ab7ed4 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -3220,6 +3220,7 @@ qemuValidateDomainDeviceDefController(const virDomainControllerDef *controller,
case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
case VIR_DOMAIN_CONTROLLER_TYPE_USB:
case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
+ case VIR_DOMAIN_CONTROLLER_TYPE_ISA:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
break;
}
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 15f8eb074a..9b38963e2a 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -397,6 +397,7 @@ vboxSetStorageController(virDomainControllerDefPtr controller,
case VIR_DOMAIN_CONTROLLER_TYPE_USB:
case VIR_DOMAIN_CONTROLLER_TYPE_PCI:
case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
+ case VIR_DOMAIN_CONTROLLER_TYPE_ISA:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("The vbox driver does not support %s controller type"),
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args
new file mode 100644
index 0000000000..910d1bbcfa
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args
@@ -0,0 +1,10 @@
+/usr/sbin/bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 1:0,lpc \
+-s 2:0,ahci,hd:/tmp/freebsd.img \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs
new file mode 100644
index 0000000000..32538b558e
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs
@@ -0,0 +1,3 @@
+/usr/sbin/bhyveload \
+-m 214 \
+-d /tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml
new file mode 100644
index 0000000000..4a72ca65a1
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml
@@ -0,0 +1,26 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args
new file mode 100644
index 0000000000..ee833eb460
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args
@@ -0,0 +1,10 @@
+/usr/sbin/bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 31:0,lpc \
+-s 2:0,ahci,hd:/tmp/freebsd.img \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs
new file mode 100644
index 0000000000..32538b558e
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs
@@ -0,0 +1,3 @@
+/usr/sbin/bhyveload \
+-m 214 \
+-d /tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml
new file mode 100644
index 0000000000..3b8e8a3664
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml
@@ -0,0 +1,26 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x0'/>
+ </controller>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml
new file mode 100644
index 0000000000..88ad9aebb7
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml
@@ -0,0 +1,23 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-console.args b/tests/bhyvexml2argvdata/bhyvexml2argv-console.args
index 6ab91ae7e4..25fbd4727e 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-console.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-console.args
@@ -5,7 +5,7 @@
-H \
-P \
-s 0:0,hostbridge \
+-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:b1:42:eb \
--s 1,lpc \
-l com1,/dev/nmdm0A bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args
new file mode 100644
index 0000000000..910d1bbcfa
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args
@@ -0,0 +1,10 @@
+/usr/sbin/bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 1:0,lpc \
+-s 2:0,ahci,hd:/tmp/freebsd.img \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs
new file mode 100644
index 0000000000..32538b558e
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs
@@ -0,0 +1,3 @@
+/usr/sbin/bhyveload \
+-m 214 \
+-d /tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml
new file mode 100644
index 0000000000..279ac6669a
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml
@@ -0,0 +1,24 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <controller type='isa' index='0'/>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml
new file mode 100644
index 0000000000..d087d5fb4c
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml
@@ -0,0 +1,25 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <controller type='isa' index='1'/>
+ <controller type='isa' index='2'/>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args
index 42a278208d..02846cb893 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args
@@ -5,7 +5,7 @@
-H \
-P \
-s 0:0,hostbridge \
+-s 1:0,lpc \
-s 2:0,ahci-hd,/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:a7:cd:5b \
--s 1,lpc \
-l com1,/dev/nmdm0A bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args
index 313724dc90..e4712b448c 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args
@@ -5,7 +5,7 @@
-H \
-P \
-s 0:0,hostbridge \
+-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:f0:72:11 \
--s 1,lpc \
-l com1,/dev/nmdm0A bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args
index 059e457072..f45a190137 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args
@@ -5,7 +5,7 @@
-H \
-P \
-s 0:0,hostbridge \
+-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:4f:f3:5b \
--s 1,lpc \
-l com1,/dev/nmdm0A bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args b/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args
index 8ff8673ed4..937b066e8c 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args
@@ -6,6 +6,6 @@
-P \
-s 0:0,hostbridge \
-l bootrom,/path/to/test.fd \
+-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
--s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
--s 1,lpc bhyve
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-autoport.args b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-autoport.args
index 039526ff35..551469dabe 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-autoport.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-autoport.args
@@ -6,7 +6,7 @@
-P \
-s 0:0,hostbridge \
-l bootrom,/path/to/test.fd \
+-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
--s 4:0,fbuf,tcp=127.0.0.1:5900 \
--s 1,lpc bhyve
+-s 4:0,fbuf,tcp=127.0.0.1:5900 bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-io.args b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-io.args
index da37971009..47022e84cf 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-io.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-io.args
@@ -6,7 +6,7 @@
-P \
-s 0:0,hostbridge \
-l bootrom,/path/to/test.fd \
+-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
--s 4:0,fbuf,tcp=127.0.0.1:5904,vga=io \
--s 1,lpc bhyve
+-s 4:0,fbuf,tcp=127.0.0.1:5904,vga=io bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-off.args b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-off.args
index 70347ee0b6..923098f3db 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-off.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-off.args
@@ -6,7 +6,7 @@
-P \
-s 0:0,hostbridge \
-l bootrom,/path/to/test.fd \
+-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
--s 4:0,fbuf,tcp=127.0.0.1:5904,vga=off \
--s 1,lpc bhyve
+-s 4:0,fbuf,tcp=127.0.0.1:5904,vga=off bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-on.args b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-on.args
index d0e1d81e2a..9225f5d133 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-on.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf-on.args
@@ -6,7 +6,7 @@
-P \
-s 0:0,hostbridge \
-l bootrom,/path/to/test.fd \
+-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
--s 4:0,fbuf,tcp=127.0.0.1:5904,vga=on \
--s 1,lpc bhyve
+-s 4:0,fbuf,tcp=127.0.0.1:5904,vga=on bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args
index 90889b8f39..cd7a543265 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args
@@ -6,7 +6,7 @@
-P \
-s 0:0,hostbridge \
-l bootrom,/path/to/test.fd \
+-s 1:0,lpc \
-s 2:0,ahci,hd:/tmp/freebsd.img \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
--s 4:0,fbuf,tcp=127.0.0.1:5904 \
--s 1,lpc bhyve
+-s 4:0,fbuf,tcp=127.0.0.1:5904 bhyve
diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
index 9e7eb218b8..6e8b62dc9b 100644
--- a/tests/bhyvexml2argvtest.c
+++ b/tests/bhyvexml2argvtest.c
@@ -210,6 +210,8 @@ mymain(void)
DO_TEST_FAILURE("cputopology-nvcpu-mismatch");
DO_TEST("commandline");
DO_TEST("msrs");
+ DO_TEST("isa-controller");
+ DO_TEST_FAILURE("isa-multiple-controllers");
/* Address allocation tests */
DO_TEST("addr-single-sata-disk");
@@ -217,6 +219,9 @@ mymain(void)
DO_TEST("addr-more-than-32-sata-disks");
DO_TEST("addr-single-virtio-disk");
DO_TEST("addr-multiple-virtio-disks");
+ DO_TEST("addr-isa-controller-on-slot-1");
+ DO_TEST("addr-isa-controller-on-slot-31");
+ DO_TEST_FAILURE("addr-non-isa-controller-on-slot-1");
/* The same without 32 devs per controller support */
driver.bhyvecaps ^= BHYVE_CAP_AHCI32SLOT;
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml
new file mode 100644
index 0000000000..c1424a65e6
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml
@@ -0,0 +1,36 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </controller>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <source bridge='virbr0'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml
new file mode 100644
index 0000000000..f99c5b6431
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml
@@ -0,0 +1,36 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </controller>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <source bridge='virbr0'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml
index 78d4d30016..5309bdc7cf 100644
--- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml
@@ -20,6 +20,9 @@
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
</disk>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml
new file mode 100644
index 0000000000..c1424a65e6
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml
@@ -0,0 +1,36 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </controller>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <source bridge='virbr0'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml
index 845cb09e9f..f89d678abd 100644
--- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml
@@ -20,6 +20,9 @@
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
</disk>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml
index 6c8fda32af..29a36499f5 100644
--- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml
@@ -20,6 +20,9 @@
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
</disk>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml
index eb50cc05ad..ec03da2bfe 100644
--- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml
@@ -20,6 +20,9 @@
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
</disk>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-autoport.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-autoport.xml
index d6cfe76b70..041ab4e319 100644
--- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-autoport.xml
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-autoport.xml
@@ -21,6 +21,9 @@
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
</disk>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-io.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-io.xml
index 9e470e432e..58e71282e7 100644
--- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-io.xml
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-io.xml
@@ -21,6 +21,9 @@
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
</disk>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-off.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-off.xml
index 89c4ceac57..2c37762edb 100644
--- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-off.xml
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-off.xml
@@ -21,6 +21,9 @@
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
</disk>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-on.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-on.xml
index 86d8939364..a9f37dca66 100644
--- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-on.xml
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf-on.xml
@@ -21,6 +21,9 @@
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
</disk>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc.xml
index 9e470e432e..58e71282e7 100644
--- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc.xml
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc.xml
@@ -21,6 +21,9 @@
<address type='drive' controller='0' bus='0' target='2' unit='0'/>
</disk>
<controller type='pci' index='0' model='pci-root'/>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c
index a0c20a14c1..cc04f8e3ce 100644
--- a/tests/bhyvexml2xmltest.c
+++ b/tests/bhyvexml2xmltest.c
@@ -110,6 +110,7 @@ mymain(void)
DO_TEST_DIFFERENT("vnc-autoport");
DO_TEST_DIFFERENT("commandline");
DO_TEST_DIFFERENT("msrs");
+ DO_TEST_DIFFERENT("isa-controller");
/* Address allocation tests */
DO_TEST_DIFFERENT("addr-single-sata-disk");
@@ -117,6 +118,8 @@ mymain(void)
DO_TEST_DIFFERENT("addr-more-than-32-sata-disks");
DO_TEST_DIFFERENT("addr-single-virtio-disk");
DO_TEST_DIFFERENT("addr-multiple-virtio-disks");
+ DO_TEST_DIFFERENT("addr-isa-controller-on-slot-1");
+ DO_TEST_DIFFERENT("addr-isa-controller-on-slot-31");
/* The same without 32 devs per controller support */
driver.bhyvecaps ^= BHYVE_CAP_AHCI32SLOT;
--
2.27.0
4 years, 10 months
[RFC PATCH 0/5] docs: formatdomain: Convert to rst
by Peter Krempa
The conversion was done using following steps:
https://gitlab.com/pipo.sk/libvirt/-/commit/3d7e23948564502ff01160a73abd3...
Output version is browsable at:
https://pipo.sk.gitlab.io/-/libvirt/-/jobs/638030149/artifacts/website/fo...
Note that this keeps existing anchors in place to prevent breaking
links.
Peter Krempa (5):
docs: css: Make definition list 'code' entries bold when converted
from rst
docs: Makefile: Distribute rst files meant for inclusion
docs: formatdomain: Convert to rst
docs: formatdomain: Split out <devices> section
docs: formatdomain-devices: Split out split <disk>
docs/Makefile.am | 3 +
docs/formatdomain-devices-disk.rst.in | 821 +++
docs/formatdomain-devices.rst.in | 4231 +++++++++++
docs/formatdomain.html.in | 9846 -------------------------
docs/formatdomain.rst | 2390 ++++++
docs/generic.css | 2 +-
6 files changed, 7446 insertions(+), 9847 deletions(-)
create mode 100644 docs/formatdomain-devices-disk.rst.in
create mode 100644 docs/formatdomain-devices.rst.in
delete mode 100644 docs/formatdomain.html.in
create mode 100644 docs/formatdomain.rst
--
2.26.2
4 years, 10 months
[libvirt PATCH 0/5] docs: platforms: Convert and simplify
by Andrea Bolognani
This makes our platform support policy easier to grasp, and also
explicitly allows us to drop Debian 9, which is EOL as of last week.
Andrea Bolognani (5):
docs: platforms: Add brief outline
docs: platforms: Convert to reStructuredText
docs: platforms: Simplify support policy
docs: platforms: Clarify stance on third-party LTS efforts
docs: platforms: Mention Windows API target
docs/platforms.html.in | 115 -----------------------------------------
docs/platforms.rst | 85 ++++++++++++++++++++++++++++++
2 files changed, 85 insertions(+), 115 deletions(-)
delete mode 100644 docs/platforms.html.in
create mode 100644 docs/platforms.rst
--
2.25.4
4 years, 10 months
[libvirt PATCH 0/2] ci: Refresh Dockerfiles
by Andrea Bolognani
Pushed under the "Dockerfile refresh" rule.
Andrea Bolognani (2):
ci: Exclude macOS when generating Dockerfiles
ci: Refresh Dockerfiles
ci/containers/libvirt-centos-7.Dockerfile | 2 ++
ci/containers/libvirt-centos-8.Dockerfile | 2 ++
ci/containers/libvirt-centos-stream.Dockerfile | 2 ++
ci/containers/libvirt-debian-10-cross-aarch64.Dockerfile | 2 ++
ci/containers/libvirt-debian-10-cross-armv6l.Dockerfile | 2 ++
ci/containers/libvirt-debian-10-cross-armv7l.Dockerfile | 2 ++
ci/containers/libvirt-debian-10-cross-i686.Dockerfile | 2 ++
ci/containers/libvirt-debian-10-cross-mips.Dockerfile | 2 ++
ci/containers/libvirt-debian-10-cross-mips64el.Dockerfile | 2 ++
ci/containers/libvirt-debian-10-cross-mipsel.Dockerfile | 2 ++
ci/containers/libvirt-debian-10-cross-ppc64le.Dockerfile | 2 ++
ci/containers/libvirt-debian-10-cross-s390x.Dockerfile | 2 ++
ci/containers/libvirt-debian-10.Dockerfile | 2 ++
ci/containers/libvirt-debian-9-cross-aarch64.Dockerfile | 2 ++
ci/containers/libvirt-debian-9-cross-armv6l.Dockerfile | 2 ++
ci/containers/libvirt-debian-9-cross-armv7l.Dockerfile | 2 ++
ci/containers/libvirt-debian-9-cross-mips.Dockerfile | 2 ++
ci/containers/libvirt-debian-9-cross-mips64el.Dockerfile | 2 ++
ci/containers/libvirt-debian-9-cross-mipsel.Dockerfile | 2 ++
ci/containers/libvirt-debian-9-cross-ppc64le.Dockerfile | 2 ++
ci/containers/libvirt-debian-9-cross-s390x.Dockerfile | 2 ++
ci/containers/libvirt-debian-9.Dockerfile | 2 ++
ci/containers/libvirt-debian-sid-cross-aarch64.Dockerfile | 2 ++
ci/containers/libvirt-debian-sid-cross-armv6l.Dockerfile | 2 ++
ci/containers/libvirt-debian-sid-cross-armv7l.Dockerfile | 2 ++
ci/containers/libvirt-debian-sid-cross-i686.Dockerfile | 2 ++
ci/containers/libvirt-debian-sid-cross-mips64el.Dockerfile | 2 ++
ci/containers/libvirt-debian-sid-cross-mipsel.Dockerfile | 2 ++
ci/containers/libvirt-debian-sid-cross-ppc64le.Dockerfile | 2 ++
ci/containers/libvirt-debian-sid-cross-s390x.Dockerfile | 2 ++
ci/containers/libvirt-debian-sid.Dockerfile | 2 ++
ci/containers/libvirt-fedora-31.Dockerfile | 2 ++
ci/containers/libvirt-fedora-32.Dockerfile | 2 ++
ci/containers/libvirt-fedora-rawhide-cross-mingw32.Dockerfile | 2 ++
ci/containers/libvirt-fedora-rawhide-cross-mingw64.Dockerfile | 2 ++
ci/containers/libvirt-fedora-rawhide.Dockerfile | 2 ++
ci/containers/libvirt-opensuse-151.Dockerfile | 4 +++-
ci/containers/libvirt-ubuntu-1804.Dockerfile | 2 ++
ci/containers/libvirt-ubuntu-2004.Dockerfile | 2 ++
ci/containers/refresh | 2 +-
40 files changed, 80 insertions(+), 2 deletions(-)
--
2.25.4
4 years, 10 months
[PATCH] storage: find vstorage-mount binary in runtime
by Nikolay Shirokovskiy
This allows us to use CI for vstorage driver without installing Virtuozzo
Storage packages. This way we can leave aside license considerations.
By the way we need to change configure defaults from 'check' to 'no' otherwise
vstorage driver will be build on any system with umount binary which is not
expected I guess.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
m4/virt-storage-vstorage.m4 | 17 +----------------
src/storage/storage_backend_vstorage.c | 9 ++++++++-
2 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/m4/virt-storage-vstorage.m4 b/m4/virt-storage-vstorage.m4
index e3b3bb4..cf0a543 100644
--- a/m4/virt-storage-vstorage.m4
+++ b/m4/virt-storage-vstorage.m4
@@ -21,30 +21,19 @@ dnl
AC_DEFUN([LIBVIRT_STORAGE_ARG_VSTORAGE], [
LIBVIRT_ARG_WITH_FEATURE([STORAGE_VSTORAGE],
[Virtuozzo Storage backend for the storage driver],
- [check])
+ [no])
])
AC_DEFUN([LIBVIRT_STORAGE_CHECK_VSTORAGE], [
if test "$with_storage_vstorage" = "yes" ||
test "$with_storage_vstorage" = "check"; then
- AC_PATH_PROG([VSTORAGE], [vstorage], [], [$LIBVIRT_SBIN_PATH])
- AC_PATH_PROG([VSTORAGE_MOUNT], [vstorage-mount], [], [$LIBVIRT_SBIN_PATH])
AC_PATH_PROG([UMOUNT], [umount], [], [$LIBVIRT_SBIN_PATH])
if test "$with_storage_vstorage" = "yes"; then
- if test -z "$VSTORAGE" || test -z "$VSTORAGE_MOUNT"; then
- AC_MSG_ERROR([We need vstorage and vstorage-mount tool for Vstorage storage driver]);
- fi
if test -z "$UMOUNT" ; then
AC_MSG_ERROR([We need umount for Vstorage storage driver]);
fi
else
- if test -z "$VSTORAGE" ; then
- with_storage_vstorage=no
- fi
- if test -z "$VSTORAGE_MOUNT" ; then
- with_storage_vstorage=no
- fi
if test -z "$UMOUNT" ; then
with_storage_vstorage=no
fi
@@ -57,10 +46,6 @@ AC_DEFUN([LIBVIRT_STORAGE_CHECK_VSTORAGE], [
if test "$with_storage_vstorage" = "yes" ; then
AC_DEFINE_UNQUOTED([WITH_STORAGE_VSTORAGE], 1,
[whether Vstorage backend for storage driver is enabled])
- AC_DEFINE_UNQUOTED([VSTORAGE], ["$VSTORAGE"],
- [Location or name of the vstorage client tool])
- AC_DEFINE_UNQUOTED([VSTORAGE_MOUNT], ["$VSTORAGE_MOUNT"],
- [Location or name of the vstorage mount tool])
AC_DEFINE_UNQUOTED([UMOUNT], ["$UMOUNT"],
[Location or name of the umount programm])
fi
diff --git a/src/storage/storage_backend_vstorage.c b/src/storage/storage_backend_vstorage.c
index 6cff9f1..ea3bfaa 100644
--- a/src/storage/storage_backend_vstorage.c
+++ b/src/storage/storage_backend_vstorage.c
@@ -44,9 +44,16 @@ virStorageBackendVzPoolStart(virStoragePoolObjPtr pool)
g_autofree char *grp_name = NULL;
g_autofree char *usr_name = NULL;
g_autofree char *mode = NULL;
+ g_autofree char *mount_bin = NULL;
g_autoptr(virCommand) cmd = NULL;
int ret;
+ if (!(mount_bin = virFindFileInPath("vstorage-mount"))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("unable to find vstorage-mount"));
+ return -1;
+ }
+
/* Check the permissions */
if (def->target.perms.mode == (mode_t)-1)
def->target.perms.mode = VIR_STORAGE_DEFAULT_POOL_PERM_MODE;
@@ -65,7 +72,7 @@ virStorageBackendVzPoolStart(virStoragePoolObjPtr pool)
mode = g_strdup_printf("%o", def->target.perms.mode);
- cmd = virCommandNewArgList(VSTORAGE_MOUNT,
+ cmd = virCommandNewArgList(mount_bin,
"-c", def->source.name,
def->target.path,
"-m", mode,
--
1.8.3.1
4 years, 10 months
libvirt-6.5.0 breaks host passthrough migration
by Mark Mielke
Hi all:
With 6.4.0, live migration was working fine with Qemu 5.0. After trying out
6.5.0, migration broke with the following error:
libvirt.libvirtError: internal error: unable to execute QEMU command
'migrate': State blocked by non-migratable CPU device (invtsc flag)
I believe I traced the error back to this commit:
commit 201bd5db639c063862b0c1b1abfab9a9a7c92591
Author: Jiri Denemark <jdenemar(a)redhat.com>
Date: Tue Jun 2 15:34:07 2020 +0200
qemu: Fill default value in //cpu/@migratable attribute
Before QEMU introduced migratable CPU property, "-cpu host" included all
features that could be enabled on the host, even those which would block
migration. In other words, the default was equivalent to migratable=off.
When the migratable property was introduced, the default changed to
migratable=on. Let's record the default in domain XML.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
Before this change, qemu was still being launched with "-cpu host", which
for any somewhat modern version of qemu, defaults to migratable=on. The
above comment acknowledges this, however, the implementation chooses the
pessimistic and ancient (and no longer applicable!) value of migratable=off:
+ if (qemuCaps &&
+ def->cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH &&
+ !def->cpu->migratable) {
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_MIGRATABLE))
+ def->cpu->migratable = VIR_TRISTATE_SWITCH_ON;
*+ else if (ARCH_IS_X86(def->os.arch))+
def->cpu->migratable = VIR_TRISTATE_SWITCH_OFF;*
+ }
Consequently, after live migration qemu is started with "-cpu
host,migratable=off" and this enables invtsc, which then prevents migration
as when invtsc is enabled it activates a migration blocker.
I think this patch should be reverted. If the migratable state cannot be
determined, then it should not be guessed. It should be left as "absent",
just as it has been working fine prior to libvirt-6.5.0. Qemu still knows
what flags are enabled, so Qemu remains the authority on what can be safely
migrated, and what cannot be. I reverted this patch and re-built, and this
seems to clear the migration problems. If the user chooses to explicitly
specify migratable=yes or migratable=no, then this value should be
preserved and passed through to the Qemu "-cpu host,XXX" option.
I think it is not a requirement for "migratable=XXX" to be explicit in
libvirt. However, if there is some reason I am unaware of, and it is
important for libvirt to know, then I think it is important for libvirt to
find out the authoritative state rather than guessing.
Please start by reverting this patch, so that other people do not get
broken in the same way, and I don't need to carry my revert patch.
Personally, I think this is important enough to build a 6.5.1. However,
since I have a local revert patch in place, I am not waiting for this.
Thanks!
--
Mark Mielke <mark.mielke(a)gmail.com>
4 years, 10 months
[PATCH] qemu: use a fixed directory for saving qmp capabilities process
by Bihong Yu
>From c7ee36417b88df7dcfe5e18d1eb72b6d7c175268 Mon Sep 17 00:00:00 2001
From: Bihong Yu <yubihong(a)huawei.com>
Date: Tue, 14 Jul 2020 11:17:46 +0800
Subject: [PATCH] qemu: use a fixed directory for saving qmp capabilities
process
In some case, the qmp capabilities process possible residues. So we need to
cleanup the residual process during start libvirt. For this reason, we
should use a fixed directory for saving qmp capabilities process.
Change-Id: I6a74a046e192eee169a0e2677ce3aed9ded5e0ed
Signed-off-by:Bihong Yu <yubihong(a)huawei.com>
---
src/qemu/qemu_process.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 70fc24b..eba14ed 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8450,21 +8450,24 @@ static int
qemuProcessQMPInit(qemuProcessQMPPtr proc)
{
g_autofree char *template = NULL;
+ virErrorPtr orig_err;
VIR_DEBUG("proc=%p, emulator=%s", proc, proc->binary);
- template = g_strdup_printf("%s/qmp-XXXXXX", proc->libDir);
+ template = g_strdup_printf("%s/qmp-capabilities", proc->libDir);
- if (!(proc->uniqDir = g_mkdtemp(template))) {
+ if (g_mkdir_with_parents(template, 0700) < 0) {
virReportSystemError(errno,
_("Failed to create unique directory with "
"template '%s' for probing QEMU"),
template);
return -1;
}
- /* if g_mkdtemp succeeds, proc->uniqDir is now the owner of
- * the string. Set template to NULL to avoid freeing
- * the memory in this case */
+ /*
+ * if g_mkdir_with_parents succeeds, assign the template to proc->uniqDir.
+ * Then set template to NULL to avoid freeing the memory in this case.
+ */
+ proc->uniqDir = template;
template = NULL;
if (qemuProcessQEMULabelUniqPath(proc) < 0)
@@ -8481,6 +8484,10 @@ qemuProcessQMPInit(qemuProcessQMPPtr proc)
*/
proc->pidfile = g_strdup_printf("%s/%s", proc->uniqDir, "qmp.pid");
+ virErrorPreserveLast(&orig_err);
+ if (virPidFileForceCleanupPath(proc->pidfile) < 0)
+ VIR_WARN("Unable to kill qemu QMP process");
+ virErrorRestore(&orig_err);
return 0;
}
--
1.8.3.1
4 years, 10 months
[PATCH] storage: fix vstorage backend build
by Nikolay Shirokovskiy
Add headers with declarations of geteuid/getegid
and virGetUserName/virGetGroupName.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/storage/storage_backend_vstorage.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/storage/storage_backend_vstorage.c b/src/storage/storage_backend_vstorage.c
index 85ab832..6cff9f1 100644
--- a/src/storage/storage_backend_vstorage.c
+++ b/src/storage/storage_backend_vstorage.c
@@ -6,10 +6,12 @@
#include "storage_backend_vstorage.h"
#include "virlog.h"
#include "virstring.h"
+#include "virutil.h"
#include <mntent.h>
#include <paths.h>
#include <pwd.h>
#include <grp.h>
+#include <unistd.h>
#include "storage_util.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
--
1.8.3.1
4 years, 10 months
[PATCH] qemu: fix memleaks in qemuDomainAttachDeviceLive()
by Jin Yan
From e46e168f9767b8b291f23217fc7a62163c82eaf8 Mon Sep 17 00:00:00 2001
From: Jin Yan <jinyan12(a)huawei.com>
Date: Tue, 7 Jul 2020 21:58:52 +0800
Subject: [PATCH] qemu: fix memleaks in qemuDomainAttachDeviceLive()
During disk hotplugging, qemuDomainAttachDeviceLive() add the new
disk to the device list of the VM object. However, hotplugging
cdroms and floppies only updates the src variable of the original
disk device, so the newly generated disk object needs to be released.
Signed-off-by: Jin Yan <jinyan12(a)huawei.com>
---
src/qemu/qemu_hotplug.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 3954ad1109..40092b499d 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1115,6 +1115,7 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr
driver,
return -1;
disk->src = NULL;
+ virDomainDiskDefFree(disk);
return 0;
}
--
4 years, 10 months
[PATCHv2 0/2] Add a type attribute on the mac address element
by Bastien Orivel
Changed:
- Split the commit in two to separate the documentation from the
code changes.
- Change the attribute name from check (tri state bool) to type
(static/generated).
This time with the patches too...
Bastien Orivel (2):
Add a type attribute on the mac address element
Document the `type` attribute for mac addresses
NEWS.rst | 6 ++++
docs/drvesx.html.in | 7 +++++
docs/schemas/domaincommon.rng | 8 +++++
src/conf/domain_conf.c | 26 ++++++++++++++++-
src/conf/domain_conf.h | 11 +++++++
src/vmx/vmx.c | 8 +++--
.../network-interface-mac-type.xml | 29 +++++++++++++++++++
tests/genericxml2xmltest.c | 2 ++
8 files changed, 93 insertions(+), 4 deletions(-)
create mode 100644 tests/genericxml2xmlindata/network-interface-mac-type.xml
--
2.20.1
4 years, 10 months