[PATCH v2 09/15] domain: Allow 'model' attribute for ide controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The optional values are 'piix3', 'piix4' or 'ich6'. Those will be
needed to allow setting IDE controller model in VirtualBox driver.
---
 docs/formatdomain.html.in     |  4 ++++
 docs/schemas/domaincommon.rng | 18 ++++++++++++++++--
 src/conf/domain_conf.c        |  9 +++++++++
 src/conf/domain_conf.h        |  9 +++++++++
 src/libvirt_private.syms      |  2 ++
 5 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 4609e2ec2..8dff685ad 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3648,6 +3648,10 @@
          <span class="since">Since 1.3.5</span>, USB controllers accept a
          <code>ports</code> attribute to configure how many devices can be
          connected to the controller.</dd>
+        <dt><code>ide</code></dt>
+        <dd><span class="since">Since 3.9.0</span> for the vbox driver, the
+        <code>ide</code> controller has an optional attribute
+        <code>model</code>, which is one of "piix3", "piix4" or "ich6".</dd>
       </dl>
 
     <p>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 710b3af7f..9cec1a063 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1975,12 +1975,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>
@@ -2041,6 +2040,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 77c20c697..57f291624 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -377,6 +377,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",
@@ -9785,6 +9790,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;
 }
@@ -9800,6 +9807,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 38de70b15..0def905b2 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 || \
@@ -3219,6 +3227,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 448d962b2..2e67366b7 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -234,6 +234,8 @@ virDomainControllerFindUnusedIndex;
 virDomainControllerInsert;
 virDomainControllerInsertPreAlloced;
 virDomainControllerIsPSeriesPHB;
+virDomainControllerModelIDETypeFromString;
+virDomainControllerModelIDETypeToString;
 virDomainControllerModelPCITypeToString;
 virDomainControllerModelSCSITypeFromString;
 virDomainControllerModelSCSITypeToString;
-- 
2.14.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux