[PATCH 2/2] conf: remove extraneous _TYPE from driver backend enums

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

 



This isn't strictly speaking a bugfix, but I realized I'd gotten a bit
too verbose when I chose the names for
VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_*. This shortens them all a bit.
---
 src/conf/domain_conf.c           | 6 +++---
 src/conf/domain_conf.h           | 6 +++---
 src/network/bridge_driver.c      | 6 +++---
 src/qemu/qemu_command.c          | 8 ++++----
 src/qemu/qemu_hostdev.c          | 4 ++--
 src/qemu/qemu_hotplug.c          | 4 ++--
 src/security/security_apparmor.c | 2 +-
 src/security/security_dac.c      | 4 ++--
 src/security/security_selinux.c  | 4 ++--
 9 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3c6d260..28ae7c3 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3744,10 +3744,10 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
         if (virDomainHostdevSubsysPciDefParseXML(sourcenode, def, flags) < 0)
             goto error;
 
-        backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_DEFAULT;
+        backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT;
         if ((backendStr = virXPathString("string(./driver/@name)", ctxt)) &&
             (((backend = virDomainHostdevSubsysPciBackendTypeFromString(backendStr)) < 0) ||
-             backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_DEFAULT)) {
+             backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT)) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Unknown PCI device <driver name='%s'/> "
                              "has been specified"), backendStr);
@@ -13846,7 +13846,7 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf,
                                 bool includeTypeInAddr)
 {
     if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
-        def->source.subsys.u.pci.backend != VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_DEFAULT) {
+        def->source.subsys.u.pci.backend != VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT) {
         const char *backend = virDomainHostdevSubsysPciBackendTypeToString(def->source.subsys.u.pci.backend);
 
         if (!backend) {
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index b2f2815..3a0f23a 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -391,9 +391,9 @@ enum virDomainHostdevSubsysType {
 
 /* the backend driver used for PCI hostdev devices */
 typedef enum {
-    VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_DEFAULT, /* currently kvm, could change */
-    VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_KVM,    /* force legacy kvm style */
-    VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO,   /* force vfio */
+    VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT, /* currently kvm, could change */
+    VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM,    /* force legacy kvm style */
+    VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO,   /* force vfio */
 
     VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST
 } virDomainHostdevSubsysPciBackendType;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 0c0b356..1a81ae3 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3898,13 +3898,13 @@ networkAllocateActualDevice(virDomainNetDefPtr iface)
         switch (netdef->forward.driverName)
         {
         case VIR_NETWORK_FORWARD_DRIVER_NAME_DEFAULT:
-            backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_DEFAULT;
+            backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT;
             break;
         case VIR_NETWORK_FORWARD_DRIVER_NAME_KVM:
-            backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_KVM;
+            backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM;
             break;
         case VIR_NETWORK_FORWARD_DRIVER_NAME_VFIO:
-            backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO;
+            backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO;
             break;
         default:
             virReportError(VIR_ERR_INTERNAL_ERROR,
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2ce0672..6390e16 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4346,7 +4346,7 @@ qemuBuildPCIHostdevDevStr(virDomainHostdevDefPtr dev, const char *configfd,
     virBuffer buf = VIR_BUFFER_INITIALIZER;
 
     if (dev->source.subsys.u.pci.backend
-        == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+        == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
         virBufferAddLit(&buf, "vfio-pci");
     } else {
         virBufferAddLit(&buf, "pci-assign");
@@ -7857,7 +7857,7 @@ qemuBuildCommandLine(virConnectPtr conn,
             } else {
                 if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
                     if (hostdev->source.subsys.u.pci.backend
-                        == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+                        == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
                         if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_PCI_BOOTINDEX)) {
                             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                            _("booting from PCI devices assigned with VFIO "
@@ -7907,7 +7907,7 @@ qemuBuildCommandLine(virConnectPtr conn,
             hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
 
             if (hostdev->source.subsys.u.pci.backend
-                == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+                == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
                 unsigned long long memKB;
 
                 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
@@ -7929,7 +7929,7 @@ qemuBuildCommandLine(virConnectPtr conn,
             if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
                 char *configfd_name = NULL;
                 if ((hostdev->source.subsys.u.pci.backend
-                     != VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) &&
+                     != VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) &&
                     virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_CONFIGFD)) {
                     int configfd = qemuOpenPCIConfig(hostdev);
 
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 036e922..4d1f39d 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -68,7 +68,7 @@ qemuGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
 
         virPCIDeviceSetManaged(dev, hostdev->managed);
         if (hostdev->source.subsys.u.pci.backend
-            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
             virPCIDeviceSetStubDriver(dev, "vfio-pci");
         } else {
             virPCIDeviceSetStubDriver(dev, "pci-stub");
@@ -157,7 +157,7 @@ int qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
 
         virPCIDeviceSetManaged(dev, hostdev->managed);
         if (hostdev->source.subsys.u.pci.backend
-            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
             virPCIDeviceSetStubDriver(dev, "vfio-pci");
         } else {
             virPCIDeviceSetStubDriver(dev, "pci-stub");
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 15cca08..91c03ce 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1001,7 +1001,7 @@ int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
         return -1;
 
     if (hostdev->source.subsys.u.pci.backend
-        == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+        == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
         unsigned long long memKB;
 
         if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
@@ -1028,7 +1028,7 @@ int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
             goto error;
         releaseaddr = true;
         if ((hostdev->source.subsys.u.pci.backend
-             != VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) &&
+             != VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) &&
             virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PCI_CONFIGFD)) {
             configfd = qemuOpenPCIConfig(hostdev);
             if (configfd >= 0) {
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 0aff794..4fa0384 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -832,7 +832,7 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
             goto done;
 
         if (dev->source.subsys.u.pci.backend
-            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
             char *vfioGroupDev = virPCIDeviceGetVFIOGroupDev(pci);
 
             if (!vfioGroupDev)
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 5e00112..0366c17 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -517,7 +517,7 @@ virSecurityDACSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
             goto done;
 
         if (dev->source.subsys.u.pci.backend
-            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
             char *vfioGroupDev = virPCIDeviceGetVFIOGroupDev(pci);
 
             if (!vfioGroupDev)
@@ -608,7 +608,7 @@ virSecurityDACRestoreSecurityHostdevLabel(virSecurityManagerPtr mgr,
             goto done;
 
         if (dev->source.subsys.u.pci.backend
-            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
             char *vfioGroupDev = virPCIDeviceGetVFIOGroupDev(pci);
 
             if (!vfioGroupDev)
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index a5b54cb..87a09c7 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -1343,7 +1343,7 @@ virSecuritySELinuxSetSecurityHostdevSubsysLabel(virDomainDefPtr def,
             goto done;
 
         if (dev->source.subsys.u.pci.backend
-            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
             char *vfioGroupDev = virPCIDeviceGetVFIOGroupDev(pci);
 
             if (!vfioGroupDev)
@@ -1515,7 +1515,7 @@ virSecuritySELinuxRestoreSecurityHostdevSubsysLabel(virSecurityManagerPtr mgr,
             goto done;
 
         if (dev->source.subsys.u.pci.backend
-            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_VFIO) {
+            == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) {
             char *vfioGroupDev = virPCIDeviceGetVFIOGroupDev(pci);
 
             if (!vfioGroupDev)
-- 
1.7.11.7

--
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]