[libvirt] [PATCH] Handle kernels with no ipv6 support

If the ipv6 kernel module is not loaded, then we get this when starting a virtual network: libvir: Network Config error : cannot enable /proc/sys/net/ipv6/conf/virbr0/disable_ipv6: No such file or directory If disable_ipv6 is not present, we should just merrily continue on our way. * src/network_driver.c: make networkDisableIPV6() not fail if the kernel has no ipv6 support --- src/network_driver.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/network_driver.c b/src/network_driver.c index eaea454..84910ab 100644 --- a/src/network_driver.c +++ b/src/network_driver.c @@ -801,6 +801,12 @@ static int networkDisableIPV6(virConnectPtr conn, goto cleanup; } + if (access(field, W_OK) < 0 && errno == ENOENT) { + VIR_DEBUG("ipv6 appears to already be disabled on %s", network->def->bridge); + ret = 0; + goto cleanup; + } + if (virFileWriteStr(field, "1") < 0) { virReportSystemError(conn, errno, _("cannot enable %s"), field); -- 1.6.2.5

On Mon, Aug 10, 2009 at 11:20:51AM +0100, Mark McLoughlin wrote:
If the ipv6 kernel module is not loaded, then we get this when starting a virtual network:
libvir: Network Config error : cannot enable /proc/sys/net/ipv6/conf/virbr0/disable_ipv6: No such file or directory
If disable_ipv6 is not present, we should just merrily continue on our way.
* src/network_driver.c: make networkDisableIPV6() not fail if the kernel has no ipv6 support --- src/network_driver.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
ACK. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Mon, Aug 10, 2009 at 11:20:51AM +0100, Mark McLoughlin wrote:
If the ipv6 kernel module is not loaded, then we get this when starting a virtual network:
libvir: Network Config error : cannot enable /proc/sys/net/ipv6/conf/virbr0/disable_ipv6: No such file or directory
If disable_ipv6 is not present, we should just merrily continue on our way.
* src/network_driver.c: make networkDisableIPV6() not fail if the kernel has no ipv6 support
Looks fine, ACK Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Mark McLoughlin