[Libvir] PATCH: Remove no-op network API impl from OpenVZ driver

The openvz_driver.c file registers an implementation of the networking driver APIs, which is a no-op. Even though the networking APIs are implemented in the QEMU driver, this one impl is *shared* and used across all virtualization driver backends. Thus no other driver such as Xen/OpenVZ/etc should ever implement the network APIs. The only exceptions are the remote driver, and the test driver. So this patch removes the no-op impl from openvz diff -r 079dc4e2fd54 src/openvz_driver.c --- a/src/openvz_driver.c Mon Jan 14 18:09:49 2008 -0500 +++ b/src/openvz_driver.c Mon Jan 14 19:04:10 2008 -0500 @@ -86,14 +86,6 @@ static int openvzShutdown(void); static int openvzShutdown(void); static int openvzReload(void); static int openvzActive(void); -static int openvzCloseNetwork(virConnectPtr conn); -static virDrvOpenStatus openvzOpenNetwork(virConnectPtr conn, - const char *name ATTRIBUTE_UNUSED, - int *credtype ATTRIBUTE_UNUSED, - int ncredtype ATTRIBUTE_UNUSED, - virConnectAuthCallbackPtr cb ATTRIBUTE_UNUSED, - void *cbdata ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED); static virDomainPtr openvzDomainDefineXML(virConnectPtr conn, const char *xml); static virDomainPtr openvzDomainCreateLinux(virConnectPtr conn, const char *xml, @@ -696,20 +688,6 @@ static int openvzActive(void) { static int openvzActive(void) { return 1; -} - -static int openvzCloseNetwork(virConnectPtr conn ATTRIBUTE_UNUSED) { - return 0; -} - -static virDrvOpenStatus openvzOpenNetwork(virConnectPtr conn ATTRIBUTE_UNUSED, - const char *name ATTRIBUTE_UNUSED, - int *credtype ATTRIBUTE_UNUSED, - int ncredtype ATTRIBUTE_UNUSED, - virConnectAuthCallbackPtr cb ATTRIBUTE_UNUSED, - void *cbdata ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED) { - return VIR_DRV_OPEN_SUCCESS; } static virDriver openvzDriver = { @@ -771,27 +749,6 @@ static virDriver openvzDriver = { NULL, /* nodeGetFreeMemory */ }; -static virNetworkDriver openvzNetworkDriver = { - NULL, /* name */ - openvzOpenNetwork, /* open */ - openvzCloseNetwork, /* close */ - NULL, /* numOfNetworks */ - NULL, /* listNetworks */ - NULL, /* numOfDefinedNetworks */ - NULL, /* listDefinedNetworks */ - NULL, /* networkLookupByUUID */ - NULL, /* networkLookupByName */ - NULL, /* networkCreateXML */ - NULL, /* networkDefineXML */ - NULL, /* networkUndefine */ - NULL, /* networkCreate */ - NULL, /* networkDestroy */ - NULL, /* networkDumpXML */ - NULL, /* networkGetBridgeName */ - NULL, /* networkGetAutostart */ - NULL, /* networkSetAutostart */ -}; - static virStateDriver openvzStateDriver = { openvzStartup, openvzShutdown, @@ -801,7 +758,6 @@ static virStateDriver openvzStateDriver int openvzRegister(void) { virRegisterDriver(&openvzDriver); - virRegisterNetworkDriver(&openvzNetworkDriver); virRegisterStateDriver(&openvzStateDriver); return 0; } Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

On Sat, Jan 19, 2008 at 06:44:19PM +0000, Daniel P. Berrange wrote:
The openvz_driver.c file registers an implementation of the networking driver APIs, which is a no-op.
Even though the networking APIs are implemented in the QEMU driver, this one impl is *shared* and used across all virtualization driver backends. Thus no other driver such as Xen/OpenVZ/etc should ever implement the network APIs. The only exceptions are the remote driver, and the test driver. So this patch removes the no-op impl from openvz
Fine by me +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel P. Berrange wrote:
The openvz_driver.c file registers an implementation of the networking driver APIs, which is a no-op.
Even though the networking APIs are implemented in the QEMU driver, this one impl is *shared* and used across all virtualization driver backends. Thus no other driver such as Xen/OpenVZ/etc should ever implement the network APIs. The only exceptions are the remote driver, and the test driver. So this patch removes the no-op impl from openvz
Yup. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Mon, Jan 21, 2008 at 11:52:36AM +0000, Richard W.M. Jones wrote:
Daniel P. Berrange wrote:
The openvz_driver.c file registers an implementation of the networking driver APIs, which is a no-op.
Even though the networking APIs are implemented in the QEMU driver, this one impl is *shared* and used across all virtualization driver backends. Thus no other driver such as Xen/OpenVZ/etc should ever implement the network APIs. The only exceptions are the remote driver, and the test driver. So this patch removes the no-op impl from openvz
Yup.
Committed. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Richard W.M. Jones