[RFC PATCT 2/2] TODO virNodeDeviceUpdateCaps: checks missing?

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

 



I'm not familiar with the code so I cannot decide if ignoring the return values
is a bug or not. At least, it looks awkward and should be annotated.

Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
---
 src/conf/node_device_conf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index c146a9f0c881..2f9abf5d9938 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -2646,11 +2646,13 @@ virNodeDeviceUpdateCaps(virNodeDeviceDef *def)
     while (cap) {
         switch (cap->data.type) {
         case VIR_NODE_DEV_CAP_SCSI_HOST:
-            virNodeDeviceGetSCSIHostCaps(&cap->data.scsi_host);
+            if (virNodeDeviceGetSCSIHostCaps(&cap->data.scsi_host) < 0)
+                return -1;
             break;
         case VIR_NODE_DEV_CAP_SCSI_TARGET:
-            virNodeDeviceGetSCSITargetCaps(def->sysfs_path,
-                                           &cap->data.scsi_target);
+            if (virNodeDeviceGetSCSITargetCaps(def->sysfs_path,
+                                               &cap->data.scsi_target) < 0)
+                return -1;
             break;
         case VIR_NODE_DEV_CAP_NET:
             if (virNetDevGetLinkInfo(cap->data.net.ifname,
-- 
2.34.1
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[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