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

[PATCH v5 1/2] conf: add 'isa' controller type



Introduce 'isa' controller type. In domain XML it looks this way:

    ...
    <controller type='isa' index='0'>
      <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.

Signed-off-by: Roman Bogorodskiy <bogorodskiy gmail com>
---
 docs/formatdomain.html.in      | 6 +++---
 docs/schemas/domaincommon.rng  | 6 ++++++
 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 +
 9 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 6b67a09bb3..f70e5abab8 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -4706,9 +4706,9 @@
 
     <p>
       Each controller has a mandatory attribute <code>type</code>,
-      which must be one of 'ide', 'fdc', 'scsi', 'sata', 'usb',
-      'ccid', 'virtio-serial' or 'pci', and a mandatory
-      attribute <code>index</code> which is the decimal integer
+      which must be one of 'ide', 'fdc', 'scsi', 'sata', 'usb', 'ccid', 'virtio-serial',
+      'xenbus', 'pci', or 'isa' (<span class="since">since 6.7.0</span>),
+      and a mandatory attribute <code>index</code> which is the decimal integer
       describing in which order the bus controller is encountered (for
       use in <code>controller</code> attributes of
       <code>&lt;address&gt;</code> elements).
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 8cbbd7e6e9..11793a5ef5 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/conf/domain_conf.c b/src/conf/domain_conf.c
index 386b04b5b8..44b7a524ec 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",
@@ -2318,6 +2322,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;
     }
@@ -10994,6 +10999,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;
 }
@@ -11013,6 +11020,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 6e9da298b4..e193cf9c5f 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 || \
@@ -3558,6 +3565,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 839c93bfb4..391b3ea892 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2679,6 +2679,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 2058290870..733141d9e4 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4891,6 +4891,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 488f258d00..5434c9e4c7 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"),
-- 
2.27.0


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