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

[libvirt] [PATCH 2/3] conf: put hostdev pci address in a struct



There will soon be other items related to pci hostdevs that need to be
in the same part of the hostdevsubsys union as the pci address (which
is currently a single member called "pci". This patch replaces the
single member named pci with a struct named pci that contains a single
member named "addr".
---
 src/conf/domain_audit.c          |  8 ++++----
 src/conf/domain_conf.c           | 12 ++++++------
 src/conf/domain_conf.h           |  4 +++-
 src/network/bridge_driver.c      | 24 +++++++++++------------
 src/qemu/qemu_command.c          | 34 ++++++++++++++++----------------
 src/qemu/qemu_hostdev.c          | 42 ++++++++++++++++++++--------------------
 src/qemu/qemu_hotplug.c          | 14 +++++++-------
 src/security/security_apparmor.c |  8 ++++----
 src/security/security_dac.c      | 16 +++++++--------
 src/security/security_selinux.c  | 16 +++++++--------
 src/security/virt-aa-helper.c    | 10 +++++-----
 src/xen/xend_internal.c          | 10 +++++-----
 src/xenxs/xen_sxpr.c             | 16 +++++++--------
 src/xenxs/xen_xm.c               | 16 +++++++--------
 14 files changed, 116 insertions(+), 114 deletions(-)

diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index 6d0ae48..d81744c 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -382,10 +382,10 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
         switch (hostdev->source.subsys.type) {
         case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
             if (virAsprintf(&address, "%.4x:%.2x:%.2x.%.1x",
-                            hostdev->source.subsys.u.pci.domain,
-                            hostdev->source.subsys.u.pci.bus,
-                            hostdev->source.subsys.u.pci.slot,
-                            hostdev->source.subsys.u.pci.function) < 0) {
+                            hostdev->source.subsys.u.pci.addr.domain,
+                            hostdev->source.subsys.u.pci.addr.bus,
+                            hostdev->source.subsys.u.pci.addr.slot,
+                            hostdev->source.subsys.u.pci.addr.function) < 0) {
                 VIR_WARN("OOM while encoding audit message");
                 goto cleanup;
             }
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index dc0ecaa..b7fea36 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3552,7 +3552,7 @@ virDomainHostdevSubsysPciDefParseXML(const xmlNodePtr node,
         if (cur->type == XML_ELEMENT_NODE) {
             if (xmlStrEqual(cur->name, BAD_CAST "address")) {
                 virDevicePCIAddressPtr addr =
-                    &def->source.subsys.u.pci;
+                    &def->source.subsys.u.pci.addr;
 
                 if (virDevicePCIAddressParseXML(cur, addr) < 0)
                     goto out;
@@ -8990,10 +8990,10 @@ static int
 virDomainHostdevMatchSubsysPCI(virDomainHostdevDefPtr a,
                                virDomainHostdevDefPtr b)
 {
-    if (a->source.subsys.u.pci.domain == b->source.subsys.u.pci.domain &&
-        a->source.subsys.u.pci.bus == b->source.subsys.u.pci.bus &&
-        a->source.subsys.u.pci.slot == b->source.subsys.u.pci.slot &&
-        a->source.subsys.u.pci.function == b->source.subsys.u.pci.function)
+    if (a->source.subsys.u.pci.addr.domain == b->source.subsys.u.pci.addr.domain &&
+        a->source.subsys.u.pci.addr.bus == b->source.subsys.u.pci.addr.bus &&
+        a->source.subsys.u.pci.addr.slot == b->source.subsys.u.pci.addr.slot &&
+        a->source.subsys.u.pci.addr.function == b->source.subsys.u.pci.addr.function)
         return 1;
     return 0;
 }
@@ -13701,7 +13701,7 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf,
         break;
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
         if (virDevicePCIAddressFormat(buf,
-                                      def->source.subsys.u.pci,
+                                      def->source.subsys.u.pci.addr,
                                       includeTypeInAddr) != 0)
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("PCI address Formatting failed"));
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index f1f01fa..a9f86c0 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -399,7 +399,9 @@ struct _virDomainHostdevSubsys {
             unsigned vendor;
             unsigned product;
         } usb;
-        virDevicePCIAddress pci; /* host address */
+        struct {
+            virDevicePCIAddress addr; /* host address */
+        } pci;
     } u;
 };
 
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 27dd230..510b4f3 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3891,7 +3891,7 @@ networkAllocateActualDevice(virDomainNetDefPtr iface)
         iface->data.network.actual->data.hostdev.def.mode = VIR_DOMAIN_HOSTDEV_MODE_SUBSYS;
         iface->data.network.actual->data.hostdev.def.managed = netdef->forward.managed ? 1 : 0;
         iface->data.network.actual->data.hostdev.def.source.subsys.type = dev->type;
-        iface->data.network.actual->data.hostdev.def.source.subsys.u.pci = dev->device.pci;
+        iface->data.network.actual->data.hostdev.def.source.subsys.u.pci.addr = dev->device.pci;
 
         /* merge virtualports from interface, network, and portgroup to
          * arrive at actual virtualport to use
@@ -4222,7 +4222,7 @@ networkNotifyActualDevice(virDomainNetDefPtr iface)
         for (ii = 0; ii < netdef->forward.nifs; ii++) {
             if (netdef->forward.ifs[ii].type
                 == VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_PCI &&
-                virDevicePCIAddressEqual(&hostdev->source.subsys.u.pci,
+                virDevicePCIAddressEqual(&hostdev->source.subsys.u.pci.addr,
                                          &netdef->forward.ifs[ii].device.pci)) {
                 dev = &netdef->forward.ifs[ii];
                 break;
@@ -4234,10 +4234,10 @@ networkNotifyActualDevice(virDomainNetDefPtr iface)
                            _("network '%s' doesn't have "
                              "PCI device %04x:%02x:%02x.%x in use by domain"),
                            netdef->name,
-                           hostdev->source.subsys.u.pci.domain,
-                           hostdev->source.subsys.u.pci.bus,
-                           hostdev->source.subsys.u.pci.slot,
-                           hostdev->source.subsys.u.pci.function);
+                           hostdev->source.subsys.u.pci.addr.domain,
+                           hostdev->source.subsys.u.pci.addr.bus,
+                           hostdev->source.subsys.u.pci.addr.slot,
+                           hostdev->source.subsys.u.pci.addr.function);
                 goto error;
         }
 
@@ -4380,8 +4380,8 @@ networkReleaseActualDevice(virDomainNetDefPtr iface)
         for (ii = 0; ii < netdef->forward.nifs; ii++) {
             if (netdef->forward.ifs[ii].type
                 == VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_PCI &&
-                virDevicePCIAddressEqual(&hostdev->source.subsys.u.pci,
-                                          &netdef->forward.ifs[ii].device.pci)) {
+                virDevicePCIAddressEqual(&hostdev->source.subsys.u.pci.addr,
+                                         &netdef->forward.ifs[ii].device.pci)) {
                 dev = &netdef->forward.ifs[ii];
                 break;
             }
@@ -4392,10 +4392,10 @@ networkReleaseActualDevice(virDomainNetDefPtr iface)
                            _("network '%s' doesn't have "
                              "PCI device %04x:%02x:%02x.%x in use by domain"),
                            netdef->name,
-                           hostdev->source.subsys.u.pci.domain,
-                           hostdev->source.subsys.u.pci.bus,
-                           hostdev->source.subsys.u.pci.slot,
-                           hostdev->source.subsys.u.pci.function);
+                           hostdev->source.subsys.u.pci.addr.domain,
+                           hostdev->source.subsys.u.pci.addr.bus,
+                           hostdev->source.subsys.u.pci.addr.slot,
+                           hostdev->source.subsys.u.pci.addr.function);
                 goto error;
         }
 
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 05c12b2..9e7c1d5 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4109,10 +4109,10 @@ qemuOpenPCIConfig(virDomainHostdevDefPtr dev)
     int configfd = -1;
 
     if (virAsprintf(&path, "/sys/bus/pci/devices/%04x:%02x:%02x.%01x/config",
-                    dev->source.subsys.u.pci.domain,
-                    dev->source.subsys.u.pci.bus,
-                    dev->source.subsys.u.pci.slot,
-                    dev->source.subsys.u.pci.function) < 0) {
+                    dev->source.subsys.u.pci.addr.domain,
+                    dev->source.subsys.u.pci.addr.bus,
+                    dev->source.subsys.u.pci.addr.slot,
+                    dev->source.subsys.u.pci.addr.function) < 0) {
         virReportOOMError();
         return -1;
     }
@@ -4135,9 +4135,9 @@ qemuBuildPCIHostdevDevStr(virDomainHostdevDefPtr dev, const char *configfd,
 
     virBufferAddLit(&buf, "pci-assign");
     virBufferAsprintf(&buf, ",host=%.2x:%.2x.%.1x",
-                      dev->source.subsys.u.pci.bus,
-                      dev->source.subsys.u.pci.slot,
-                      dev->source.subsys.u.pci.function);
+                      dev->source.subsys.u.pci.addr.bus,
+                      dev->source.subsys.u.pci.addr.slot,
+                      dev->source.subsys.u.pci.addr.function);
     virBufferAsprintf(&buf, ",id=%s", dev->info->alias);
     if (configfd && *configfd)
         virBufferAsprintf(&buf, ",configfd=%s", configfd);
@@ -4167,9 +4167,9 @@ qemuBuildPCIHostdevPCIDevStr(virDomainHostdevDefPtr dev)
     char *ret = NULL;
 
     if (virAsprintf(&ret, "host=%.2x:%.2x.%.1x",
-                    dev->source.subsys.u.pci.bus,
-                    dev->source.subsys.u.pci.slot,
-                    dev->source.subsys.u.pci.function) < 0)
+                    dev->source.subsys.u.pci.addr.bus,
+                    dev->source.subsys.u.pci.addr.slot,
+                    dev->source.subsys.u.pci.addr.function) < 0)
         virReportOOMError();
 
     return ret;
@@ -6766,10 +6766,10 @@ qemuBuildCommandLine(virConnectPtr conn,
                                        _("PCI device %04x:%02x:%02x.%x "
                                          "allocated from network %s is already "
                                          "in use by domain %s"),
-                                       hostdev->source.subsys.u.pci.domain,
-                                       hostdev->source.subsys.u.pci.bus,
-                                       hostdev->source.subsys.u.pci.slot,
-                                       hostdev->source.subsys.u.pci.function,
+                                       hostdev->source.subsys.u.pci.addr.domain,
+                                       hostdev->source.subsys.u.pci.addr.bus,
+                                       hostdev->source.subsys.u.pci.addr.slot,
+                                       hostdev->source.subsys.u.pci.addr.function,
                                        net->data.network.name,
                                        def->name);
                         goto error;
@@ -8629,9 +8629,9 @@ qemuParseCommandLinePCI(const char *val)
     def->mode = VIR_DOMAIN_HOSTDEV_MODE_SUBSYS;
     def->managed = true;
     def->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI;
-    def->source.subsys.u.pci.bus = bus;
-    def->source.subsys.u.pci.slot = slot;
-    def->source.subsys.u.pci.function = func;
+    def->source.subsys.u.pci.addr.bus = bus;
+    def->source.subsys.u.pci.addr.slot = slot;
+    def->source.subsys.u.pci.addr.function = func;
     return def;
 
  error:
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 0db9ddd..308fdcd 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -1,7 +1,7 @@
 /*
  * qemu_hostdev.c: QEMU hostdev management
  *
- * Copyright (C) 2006-2007, 2009-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2007, 2009-2013 Red Hat, Inc.
  * Copyright (C) 2006 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -51,10 +51,10 @@ qemuGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
         if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
             continue;
 
-        dev = virPCIDeviceNew(hostdev->source.subsys.u.pci.domain,
-                              hostdev->source.subsys.u.pci.bus,
-                              hostdev->source.subsys.u.pci.slot,
-                              hostdev->source.subsys.u.pci.function);
+        dev = virPCIDeviceNew(hostdev->source.subsys.u.pci.addr.domain,
+                              hostdev->source.subsys.u.pci.addr.bus,
+                              hostdev->source.subsys.u.pci.addr.slot,
+                              hostdev->source.subsys.u.pci.addr.function);
         if (!dev) {
             virObjectUnref(list);
             return NULL;
@@ -96,10 +96,10 @@ qemuGetActivePciHostDeviceList(virQEMUDriverPtr driver,
         if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
             continue;
 
-        dev = virPCIDeviceNew(hostdev->source.subsys.u.pci.domain,
-                              hostdev->source.subsys.u.pci.bus,
-                              hostdev->source.subsys.u.pci.slot,
-                              hostdev->source.subsys.u.pci.function);
+        dev = virPCIDeviceNew(hostdev->source.subsys.u.pci.addr.domain,
+                              hostdev->source.subsys.u.pci.addr.bus,
+                              hostdev->source.subsys.u.pci.addr.slot,
+                              hostdev->source.subsys.u.pci.addr.function);
         if (!dev) {
             virObjectUnref(list);
             return NULL;
@@ -141,10 +141,10 @@ int qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
         if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
             continue;
 
-        dev = virPCIDeviceNew(hostdev->source.subsys.u.pci.domain,
-                              hostdev->source.subsys.u.pci.bus,
-                              hostdev->source.subsys.u.pci.slot,
-                              hostdev->source.subsys.u.pci.function);
+        dev = virPCIDeviceNew(hostdev->source.subsys.u.pci.addr.domain,
+                              hostdev->source.subsys.u.pci.addr.bus,
+                              hostdev->source.subsys.u.pci.addr.slot,
+                              hostdev->source.subsys.u.pci.addr.function);
 
         if (!dev)
             goto cleanup;
@@ -219,10 +219,10 @@ qemuDomainHostdevPciSysfsPath(virDomainHostdevDefPtr hostdev, char **sysfs_path)
 {
     virPCIDeviceAddress config_address;
 
-    config_address.domain = hostdev->source.subsys.u.pci.domain;
-    config_address.bus = hostdev->source.subsys.u.pci.bus;
-    config_address.slot = hostdev->source.subsys.u.pci.slot;
-    config_address.function = hostdev->source.subsys.u.pci.function;
+    config_address.domain = hostdev->source.subsys.u.pci.addr.domain;
+    config_address.bus = hostdev->source.subsys.u.pci.addr.bus;
+    config_address.slot = hostdev->source.subsys.u.pci.addr.slot;
+    config_address.function = hostdev->source.subsys.u.pci.addr.function;
 
     return virPCIDeviceAddressGetSysfsFile(&config_address, sysfs_path);
 }
@@ -544,10 +544,10 @@ int qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
         if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
             continue;
 
-        dev = virPCIDeviceNew(hostdev->source.subsys.u.pci.domain,
-                              hostdev->source.subsys.u.pci.bus,
-                              hostdev->source.subsys.u.pci.slot,
-                              hostdev->source.subsys.u.pci.function);
+        dev = virPCIDeviceNew(hostdev->source.subsys.u.pci.addr.domain,
+                              hostdev->source.subsys.u.pci.addr.bus,
+                              hostdev->source.subsys.u.pci.addr.slot,
+                              hostdev->source.subsys.u.pci.addr.function);
 
         /* original states "unbind_from_stub", "remove_slot",
          * "reprobe" were already set by pciDettachDevice in
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 238d0d7..f6b2fc8 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1035,7 +1035,7 @@ int qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
 
         qemuDomainObjEnterMonitor(driver, vm);
         ret = qemuMonitorAddPCIHostDevice(priv->mon,
-                                          &hostdev->source.subsys.u.pci,
+                                          &hostdev->source.subsys.u.pci.addr,
                                           &guestAddr);
         qemuDomainObjExitMonitor(driver, vm);
 
@@ -2343,8 +2343,8 @@ qemuDomainDetachHostPciDevice(virQEMUDriverPtr driver,
     if (qemuIsMultiFunctionDevice(vm->def, detach->info)) {
         virReportError(VIR_ERR_OPERATION_FAILED,
                        _("cannot hot unplug multifunction PCI device: %.4x:%.2x:%.2x.%.1x"),
-                       subsys->u.pci.domain, subsys->u.pci.bus,
-                       subsys->u.pci.slot,   subsys->u.pci.function);
+                       subsys->u.pci.addr.domain, subsys->u.pci.addr.bus,
+                       subsys->u.pci.addr.slot,   subsys->u.pci.addr.function);
         goto cleanup;
     }
 
@@ -2375,8 +2375,8 @@ qemuDomainDetachHostPciDevice(virQEMUDriverPtr driver,
 
     virObjectLock(driver->activePciHostdevs);
     virObjectLock(driver->inactivePciHostdevs);
-    pci = virPCIDeviceNew(subsys->u.pci.domain, subsys->u.pci.bus,
-                          subsys->u.pci.slot,   subsys->u.pci.function);
+    pci = virPCIDeviceNew(subsys->u.pci.addr.domain, subsys->u.pci.addr.bus,
+                          subsys->u.pci.addr.slot,   subsys->u.pci.addr.function);
     if (pci) {
         activePci = virPCIDeviceListSteal(driver->activePciHostdevs, pci);
         if (activePci &&
@@ -2518,8 +2518,8 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
         case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
             virReportError(VIR_ERR_OPERATION_FAILED,
                            _("host pci device %.4x:%.2x:%.2x.%.1x not found"),
-                           subsys->u.pci.domain, subsys->u.pci.bus,
-                           subsys->u.pci.slot, subsys->u.pci.function);
+                           subsys->u.pci.addr.domain, subsys->u.pci.addr.bus,
+                           subsys->u.pci.addr.slot, subsys->u.pci.addr.function);
             break;
         case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
             if (subsys->u.usb.bus && subsys->u.usb.device) {
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 9dd8d74..122edd4 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -823,10 +823,10 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
 
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: {
         virPCIDevicePtr pci =
-            virPCIDeviceNew(dev->source.subsys.u.pci.domain,
-                            dev->source.subsys.u.pci.bus,
-                            dev->source.subsys.u.pci.slot,
-                            dev->source.subsys.u.pci.function);
+            virPCIDeviceNew(dev->source.subsys.u.pci.addr.domain,
+                            dev->source.subsys.u.pci.addr.bus,
+                            dev->source.subsys.u.pci.addr.slot,
+                            dev->source.subsys.u.pci.addr.function);
 
         if (!pci)
             goto done;
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 38f7ba0..8576081 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -508,10 +508,10 @@ virSecurityDACSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
 
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: {
         virPCIDevicePtr pci =
-            virPCIDeviceNew(dev->source.subsys.u.pci.domain,
-                            dev->source.subsys.u.pci.bus,
-                            dev->source.subsys.u.pci.slot,
-                            dev->source.subsys.u.pci.function);
+            virPCIDeviceNew(dev->source.subsys.u.pci.addr.domain,
+                            dev->source.subsys.u.pci.addr.bus,
+                            dev->source.subsys.u.pci.addr.slot,
+                            dev->source.subsys.u.pci.addr.function);
 
         if (!pci)
             goto done;
@@ -588,10 +588,10 @@ virSecurityDACRestoreSecurityHostdevLabel(virSecurityManagerPtr mgr,
 
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: {
         virPCIDevicePtr pci =
-            virPCIDeviceNew(dev->source.subsys.u.pci.domain,
-                            dev->source.subsys.u.pci.bus,
-                            dev->source.subsys.u.pci.slot,
-                            dev->source.subsys.u.pci.function);
+            virPCIDeviceNew(dev->source.subsys.u.pci.addr.domain,
+                            dev->source.subsys.u.pci.addr.bus,
+                            dev->source.subsys.u.pci.addr.slot,
+                            dev->source.subsys.u.pci.addr.function);
 
         if (!pci)
             goto done;
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index c620a2e..98e9183 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -1340,10 +1340,10 @@ virSecuritySELinuxSetSecurityHostdevSubsysLabel(virDomainDefPtr def,
 
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: {
         virPCIDevicePtr pci =
-            virPCIDeviceNew(dev->source.subsys.u.pci.domain,
-                            dev->source.subsys.u.pci.bus,
-                            dev->source.subsys.u.pci.slot,
-                            dev->source.subsys.u.pci.function);
+            virPCIDeviceNew(dev->source.subsys.u.pci.addr.domain,
+                            dev->source.subsys.u.pci.addr.bus,
+                            dev->source.subsys.u.pci.addr.slot,
+                            dev->source.subsys.u.pci.addr.function);
 
         if (!pci)
             goto done;
@@ -1502,10 +1502,10 @@ virSecuritySELinuxRestoreSecurityHostdevSubsysLabel(virSecurityManagerPtr mgr,
 
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: {
         virPCIDevicePtr pci =
-            virPCIDeviceNew(dev->source.subsys.u.pci.domain,
-                            dev->source.subsys.u.pci.bus,
-                            dev->source.subsys.u.pci.slot,
-                            dev->source.subsys.u.pci.function);
+            virPCIDeviceNew(dev->source.subsys.u.pci.addr.domain,
+                            dev->source.subsys.u.pci.addr.bus,
+                            dev->source.subsys.u.pci.addr.slot,
+                            dev->source.subsys.u.pci.addr.function);
 
         if (!pci)
             goto done;
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 3d3b772..3c9515f 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -2,7 +2,7 @@
 /*
  * virt-aa-helper: wrapper program used by AppArmor security driver.
  *
- * Copyright (C) 2010-2012 Red Hat, Inc.
+ * Copyright (C) 2010-2013 Red Hat, Inc.
  * Copyright (C) 2009-2011 Canonical Ltd.
  *
  * This library is free software; you can redistribute it and/or
@@ -1029,10 +1029,10 @@ get_files(vahControl * ctl)
 
             case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: {
                 virPCIDevicePtr pci = virPCIDeviceNew(
-                           dev->source.subsys.u.pci.domain,
-                           dev->source.subsys.u.pci.bus,
-                           dev->source.subsys.u.pci.slot,
-                           dev->source.subsys.u.pci.function);
+                           dev->source.subsys.u.pci.addr.domain,
+                           dev->source.subsys.u.pci.addr.bus,
+                           dev->source.subsys.u.pci.addr.slot,
+                           dev->source.subsys.u.pci.addr.function);
 
                 if (pci == NULL)
                     continue;
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 83d6d39..860bf11 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -2565,7 +2565,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain,
 
             virDevicePCIAddress PCIAddr;
 
-            PCIAddr = dev->data.hostdev->source.subsys.u.pci;
+            PCIAddr = dev->data.hostdev->source.subsys.u.pci.addr;
             if (virAsprintf(&target, "PCI device: %.4x:%.2x:%.2x",
                             PCIAddr.domain, PCIAddr.bus, PCIAddr.slot) < 0) {
                 virReportOOMError();
@@ -3753,10 +3753,10 @@ virDomainXMLDevID(virDomainPtr domain,
         virDomainHostdevDefPtr def = dev->data.hostdev;
 
         if (virAsprintf(&bdf, "%04x:%02x:%02x.%0x",
-                        def->source.subsys.u.pci.domain,
-                        def->source.subsys.u.pci.bus,
-                        def->source.subsys.u.pci.slot,
-                        def->source.subsys.u.pci.function) < 0) {
+                        def->source.subsys.u.pci.addr.domain,
+                        def->source.subsys.u.pci.addr.bus,
+                        def->source.subsys.u.pci.addr.slot,
+                        def->source.subsys.u.pci.addr.function) < 0) {
             virReportOOMError();
             return -1;
         }
diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c
index f2c345b..76e57ee 100644
--- a/src/xenxs/xen_sxpr.c
+++ b/src/xenxs/xen_sxpr.c
@@ -1089,10 +1089,10 @@ xenParseSxprPCI(virDomainDefPtr def,
         dev->mode = VIR_DOMAIN_HOSTDEV_MODE_SUBSYS;
         dev->managed = false;
         dev->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI;
-        dev->source.subsys.u.pci.domain = domainID;
-        dev->source.subsys.u.pci.bus = busID;
-        dev->source.subsys.u.pci.slot = slotID;
-        dev->source.subsys.u.pci.function = funcID;
+        dev->source.subsys.u.pci.addr.domain = domainID;
+        dev->source.subsys.u.pci.addr.bus = busID;
+        dev->source.subsys.u.pci.addr.slot = slotID;
+        dev->source.subsys.u.pci.addr.function = funcID;
 
         if (VIR_REALLOC_N(def->hostdevs, def->nhostdevs+1) < 0) {
             virDomainHostdevDefFree(dev);
@@ -2044,10 +2044,10 @@ xenFormatSxprPCI(virDomainHostdevDefPtr def,
                  virBufferPtr buf)
 {
     virBufferAsprintf(buf, "(dev (domain 0x%04x)(bus 0x%02x)(slot 0x%02x)(func 0x%x))",
-                      def->source.subsys.u.pci.domain,
-                      def->source.subsys.u.pci.bus,
-                      def->source.subsys.u.pci.slot,
-                      def->source.subsys.u.pci.function);
+                      def->source.subsys.u.pci.addr.domain,
+                      def->source.subsys.u.pci.addr.bus,
+                      def->source.subsys.u.pci.addr.slot,
+                      def->source.subsys.u.pci.addr.function);
 }
 
 
diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c
index 0e9f8d2..275e6ed 100644
--- a/src/xenxs/xen_xm.c
+++ b/src/xenxs/xen_xm.c
@@ -877,10 +877,10 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
 
             hostdev->managed = false;
             hostdev->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI;
-            hostdev->source.subsys.u.pci.domain = domainID;
-            hostdev->source.subsys.u.pci.bus = busID;
-            hostdev->source.subsys.u.pci.slot = slotID;
-            hostdev->source.subsys.u.pci.function = funcID;
+            hostdev->source.subsys.u.pci.addr.domain = domainID;
+            hostdev->source.subsys.u.pci.addr.bus = busID;
+            hostdev->source.subsys.u.pci.addr.slot = slotID;
+            hostdev->source.subsys.u.pci.addr.function = funcID;
 
             if (VIR_REALLOC_N(def->hostdevs, def->nhostdevs+1) < 0) {
                 virDomainHostdevDefFree(hostdev);
@@ -1470,10 +1470,10 @@ xenFormatXMPCI(virConfPtr conf,
             char *buf;
 
             if (virAsprintf(&buf, "%04x:%02x:%02x.%x",
-                            def->hostdevs[i]->source.subsys.u.pci.domain,
-                            def->hostdevs[i]->source.subsys.u.pci.bus,
-                            def->hostdevs[i]->source.subsys.u.pci.slot,
-                            def->hostdevs[i]->source.subsys.u.pci.function) < 0) {
+                            def->hostdevs[i]->source.subsys.u.pci.addr.domain,
+                            def->hostdevs[i]->source.subsys.u.pci.addr.bus,
+                            def->hostdevs[i]->source.subsys.u.pci.addr.slot,
+                            def->hostdevs[i]->source.subsys.u.pci.addr.function) < 0) {
                 virReportOOMError();
                 goto error;
             }
-- 
1.7.11.7


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