]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix device destroy return value
authorDavid Allan <dallan@redhat.com>
Thu, 3 Jun 2010 01:59:16 +0000 (21:59 -0400)
committerDavid Allan <dallan@redhat.com>
Thu, 3 Jun 2010 14:54:29 +0000 (10:54 -0400)
* Set return value in error cases
* Clarify error message when parent device is not vport capable

src/conf/node_device_conf.c
src/node_device/node_device_driver.c

index 7f2dac80e35edda191af06839ac0a5d397df091c..6583570d05fbf147eefbf38ab97412a6e22aa0d5 100644 (file)
@@ -1308,7 +1308,7 @@ virNodeDeviceGetParentHost(const virNodeDeviceObjListPtr devs,
     parent = virNodeDeviceFindByName(devs, parent_name);
     if (parent == NULL) {
         virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
-                                 _("Could not find parent HBA for '%s'"),
+                                 _("Could not find parent device for '%s'"),
                                  dev_name);
         ret = -1;
         goto out;
@@ -1328,7 +1328,7 @@ virNodeDeviceGetParentHost(const virNodeDeviceObjListPtr devs,
 
     if (cap == NULL) {
         virNodeDeviceReportError(VIR_ERR_INTERNAL_ERROR,
-                                 _("Parent HBA %s is not capable "
+                                 _("Parent device %s is not capable "
                                    "of vport operations"),
                                  parent->def->name);
         ret = -1;
index a6c1fa08b79db37192b92066b053a07981f905fb..8fb062c73ed3d94280e898271b272b80d8cbd4d4 100644 (file)
@@ -584,7 +584,7 @@ cleanup:
 static int
 nodeDeviceDestroy(virNodeDevicePtr dev)
 {
-    int ret = 0;
+    int ret = -1;
     virDeviceMonitorStatePtr driver = dev->conn->devMonPrivateData;
     virNodeDeviceObjPtr obj = NULL;
     char *parent_name = NULL, *wwnn = NULL, *wwpn = NULL;
@@ -631,6 +631,7 @@ nodeDeviceDestroy(virNodeDevicePtr dev)
         goto out;
     }
 
+    ret = 0;
 out:
     if (obj)
         virNodeDeviceObjUnlock(obj);