From: Dawid Zamirski <dzamirski(a)datto.com>
The optional values are 'piix3', 'piix4' or 'ich6'. Those will be
needed to allow setting IDE controller model in VirtualBox driver.
---
docs/schemas/domaincommon.rng | 18 ++++++++++++++++--
src/conf/domain_conf.c | 9 +++++++++
src/conf/domain_conf.h | 9 +++++++++
src/libvirt_private.syms | 2 ++
4 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 4dbda6932..c3f1557f0 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1927,12 +1927,11 @@
<ref name="address"/>
</optional>
<choice>
- <!-- fdc/ide/sata/ccid have only the common attributes -->
+ <!-- fdc/sata/ccid have only the common attributes -->
<group>
<attribute name="type">
<choice>
<value>fdc</value>
- <value>ide</value>
<value>sata</value>
<value>ccid</value>
</choice>
@@ -1993,6 +1992,21 @@
</attribute>
</optional>
</group>
+ <!-- ide has an optional attribute "model" -->
+ <group>
+ <attribute name="type">
+ <value>ide</value>
+ </attribute>
+ <optional>
+ <attribute name="model">
+ <choice>
+ <value>piix3</value>
+ <value>piix4</value>
+ <value>ich6</value>
+ </choice>
+ </attribute>
+ </optional>
+ </group>
<!-- pci has an optional attribute "model" -->
<group>
<attribute name="type">
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 54be9028d..493bf83ff 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -378,6 +378,11 @@ VIR_ENUM_IMPL(virDomainControllerModelUSB,
VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST,
"qemu-xhci",
"none")
+VIR_ENUM_IMPL(virDomainControllerModelIDE, VIR_DOMAIN_CONTROLLER_MODEL_IDE_LAST,
+ "piix3",
+ "piix4",
+ "ich6")
+
VIR_ENUM_IMPL(virDomainFS, VIR_DOMAIN_FS_TYPE_LAST,
"mount",
"block",
@@ -9467,6 +9472,8 @@ virDomainControllerModelTypeFromString(const virDomainControllerDef
*def,
return virDomainControllerModelUSBTypeFromString(model);
else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI)
return virDomainControllerModelPCITypeFromString(model);
+ else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE)
+ return virDomainControllerModelIDETypeFromString(model);
return -1;
}
@@ -9482,6 +9489,8 @@ virDomainControllerModelTypeToString(virDomainControllerDefPtr def,
return virDomainControllerModelUSBTypeToString(model);
else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI)
return virDomainControllerModelPCITypeToString(model);
+ else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE)
+ return virDomainControllerModelIDETypeToString(model);
return NULL;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a42efcfa6..d7f4c3f1e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -748,6 +748,14 @@ typedef enum {
VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST
} virDomainControllerModelUSB;
+typedef enum {
+ VIR_DOMAIN_CONTROLLER_MODEL_IDE_PIIX3,
+ VIR_DOMAIN_CONTROLLER_MODEL_IDE_PIIX4,
+ VIR_DOMAIN_CONTROLLER_MODEL_IDE_ICH6,
+
+ VIR_DOMAIN_CONTROLLER_MODEL_IDE_LAST
+} virDomainControllerModelIDE;
+
# define IS_USB2_CONTROLLER(ctrl) \
(((ctrl)->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) && \
((ctrl)->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1 || \
@@ -3231,6 +3239,7 @@ VIR_ENUM_DECL(virDomainControllerModelPCI)
VIR_ENUM_DECL(virDomainControllerPCIModelName)
VIR_ENUM_DECL(virDomainControllerModelSCSI)
VIR_ENUM_DECL(virDomainControllerModelUSB)
+VIR_ENUM_DECL(virDomainControllerModelIDE)
VIR_ENUM_DECL(virDomainFS)
VIR_ENUM_DECL(virDomainFSDriver)
VIR_ENUM_DECL(virDomainFSAccessMode)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 9243c5591..616b14f82 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -231,6 +231,8 @@ virDomainControllerFindUnusedIndex;
virDomainControllerInsert;
virDomainControllerInsertPreAlloced;
virDomainControllerIsPSeriesPHB;
+virDomainControllerModelIDETypeFromString;
+virDomainControllerModelIDETypeToString;
virDomainControllerModelPCITypeToString;
virDomainControllerModelSCSITypeFromString;
virDomainControllerModelSCSITypeToString;
--
2.14.2