From b871830ac82f644d912607ebe1f60f7c0d466dc7 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sat, 6 Oct 2012 14:20:26 -0500 Subject: [PATCH] interface: fix netcf based backend naming 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c index fdc28eafe5..751e3e5ad0 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -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; }