]> xenbits.xensource.com Git - libvirt.git/commitdiff
interface: fix netcf based backend naming
authorDoug Goldstein <cardoe@cardoe.com>
Sat, 6 Oct 2012 19:20:26 +0000 (14:20 -0500)
committerEric Blake <eblake@redhat.com>
Tue, 9 Oct 2012 15:43:38 +0000 (09:43 -0600)
All other backends for virInterface or other HVs implementations of
virInterface list their own names for the name instead of the generic
'Interface' value. This does the same for the netcf based backend.
Also, report any errors during registration.

src/interface/interface_backend_netcf.c

index fdc28eafe59323bd265f867e64192caada8e5338..751e3e5ad0e5ae9b50214eb7bbe9dd09ef126f6e 100644 (file)
@@ -2,7 +2,7 @@
  * interface_driver.c: backend driver methods to handle physical
  *                     interface configuration using the netcf library.
  *
- * Copyright (C) 2006-2011 Red Hat, Inc.
+ * Copyright (C) 2006-2012 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -782,7 +782,7 @@ static int interfaceChangeRollback(virConnectPtr conn, unsigned int flags)
 #endif /* HAVE_NETCF_TRANSACTIONS */
 
 static virInterfaceDriver interfaceDriver = {
-    "Interface",
+    "netcf",
     .open = interfaceOpenInterface, /* 0.7.0 */
     .close = interfaceCloseInterface, /* 0.7.0 */
     .numOfInterfaces = interfaceNumOfInterfaces, /* 0.7.0 */
@@ -806,6 +806,10 @@ static virInterfaceDriver interfaceDriver = {
 };
 
 int interfaceRegister(void) {
-    virRegisterInterfaceDriver(&interfaceDriver);
+    if (virRegisterInterfaceDriver(&interfaceDriver) < 0) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("failed to register netcf interface driver"));
+        return -1;
+    }
     return 0;
 }