]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: make virPCIDeviceAddressFormat void
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 19 Dec 2018 11:58:42 +0000 (11:58 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 19 Feb 2019 15:59:38 +0000 (15:59 +0000)
Only one of the three callers of virPCIDeviceAddressFormat correctly
handles an error return status. Fortunately it can't fail so can be
made void.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/conf/device_conf.c
src/conf/device_conf.h
src/conf/domain_conf.c
src/conf/network_conf.c
src/conf/storage_adapter_conf.c

index 32628c644804142e26ad626accf53451ce21b9fb..cd994057c5232129fe104450bd14056c1b042c3b 100644 (file)
@@ -308,7 +308,7 @@ virPCIDeviceAddressParseXML(xmlNodePtr node,
     return ret;
 }
 
-int
+void
 virPCIDeviceAddressFormat(virBufferPtr buf,
                           virPCIDeviceAddress addr,
                           bool includeTypeInAddr)
@@ -320,7 +320,6 @@ virPCIDeviceAddressFormat(virBufferPtr buf,
                       addr.bus,
                       addr.slot,
                       addr.function);
-    return 0;
 }
 
 bool
index 56745707d9b645b3cfb3b4d99cb00f3bc3dcc66f..7a3455f99f602ffb0dfe9b668ad2bb56ca9edbd5 100644 (file)
@@ -202,9 +202,9 @@ bool virDeviceInfoPCIAddressExtensionIsPresent(const virDomainDeviceInfo *info);
 int virPCIDeviceAddressParseXML(xmlNodePtr node,
                                 virPCIDeviceAddressPtr addr);
 
-int virPCIDeviceAddressFormat(virBufferPtr buf,
-                              virPCIDeviceAddress addr,
-                              bool includeTypeInAddr);
+void virPCIDeviceAddressFormat(virBufferPtr buf,
+                               virPCIDeviceAddress addr,
+                               bool includeTypeInAddr);
 
 bool virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddressPtr addr);
 int virDomainDeviceCCWAddressParseXML(xmlNodePtr node,
index 661c9f710af03ed4555fa4ca83ae4528030a5a5c..51eea46b4e1a21b40d46aaa9432ecee94a400b87 100644 (file)
@@ -25136,10 +25136,8 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf,
         }
         break;
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
-        if (virPCIDeviceAddressFormat(buf, pcisrc->addr,
-                                      includeTypeInAddr) != 0)
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("PCI address Formatting failed"));
+        virPCIDeviceAddressFormat(buf, pcisrc->addr,
+                                  includeTypeInAddr);
 
         if ((flags & VIR_DOMAIN_DEF_FORMAT_PCI_ORIG_STATES) &&
             (def->origstates.states.pci.unbind_from_stub ||
index ac0069cbec7d4351519920529545be79f04350cf..87bf158049c84cc9d13ce42cbda90fc8a3ebfd18 100644 (file)
@@ -2485,10 +2485,9 @@ virNetworkDefFormatBuf(virBufferPtr buf,
                     virBufferAddLit(buf, "/>\n");
                 } else {
                     if (def->forward.ifs[i].type ==  VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_PCI) {
-                        if (virPCIDeviceAddressFormat(buf,
-                                                      def->forward.ifs[i].device.pci,
-                                                      true) < 0)
-                            goto error;
+                        virPCIDeviceAddressFormat(buf,
+                                                  def->forward.ifs[i].device.pci,
+                                                  true);
                     }
                 }
             }
index 3118b1a310627af0ff1316d291f652341124d11e..18bcb5eb9e845f68559303d2f629a8878e5fb65b 100644 (file)
@@ -326,8 +326,8 @@ virStorageAdapterFormatSCSIHost(virBufferPtr buf,
         virBufferAsprintf(buf, "<parentaddr unique_id='%d'>\n",
                           scsi_host->unique_id);
         virBufferAdjustIndent(buf, 2);
-        ignore_value(virPCIDeviceAddressFormat(buf, scsi_host->parentaddr,
-                                               false));
+        virPCIDeviceAddressFormat(buf, scsi_host->parentaddr,
+                                  false);
         virBufferAdjustIndent(buf, -2);
         virBufferAddLit(buf, "</parentaddr>\n");
         virBufferAdjustIndent(buf, -2);