[libvirt] [PATCH] interface: Use proper return codes in the open function

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

 



The open function returned -1 in case of an error, but -1 maps
to VIR_DRV_OPEN_DECLINED instead of VIR_DRV_OPEN_ERROR.
---
 src/interface/netcf_driver.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/interface/netcf_driver.c b/src/interface/netcf_driver.c
index 2753049..7f4d43d 100644
--- a/src/interface/netcf_driver.c
+++ b/src/interface/netcf_driver.c
@@ -139,7 +139,7 @@ static virDrvOpenStatus interfaceOpenInterface(virConnectPtr conn,
     }
 
     conn->interfacePrivateData = driverState;
-    return 0;
+    return VIR_DRV_OPEN_SUCCESS;
 
 netcf_error:
     if (driverState->netcf)
@@ -150,7 +150,7 @@ netcf_error:
 mutex_error:
     VIR_FREE(driverState);
 alloc_error:
-    return -1;
+    return VIR_DRV_OPEN_ERROR;
 }
 
 static int interfaceCloseInterface(virConnectPtr conn)
-- 
1.6.3.3

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