[libvirt] [sandbox 1/3] Add af_packet module for dhclient to work

Cédric Bosdonnat cbosdonnat at suse.com
Mon Aug 24 10:17:04 UTC 2015


dhclient requires the af_packet to be loaded to work. Some distros
have it built-in, others like openSUSE have it as a module. Adding
the module to the init image, makes sure we have it. Of course no
error should be raised if the module can't be found.
---
 libvirt-sandbox/libvirt-sandbox-builder-machine.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libvirt-sandbox/libvirt-sandbox-builder-machine.c b/libvirt-sandbox/libvirt-sandbox-builder-machine.c
index a458882..43372b5 100644
--- a/libvirt-sandbox/libvirt-sandbox-builder-machine.c
+++ b/libvirt-sandbox/libvirt-sandbox-builder-machine.c
@@ -181,6 +181,8 @@ static gchar *gvir_sandbox_builder_machine_mkinitrd(GVirSandboxConfig *config,
 #if 0
     gvir_sandbox_config_initrd_add_module(initrd, "virtio_balloon.ko");
 #endif
+    /* For dhclient to work */
+    gvir_sandbox_config_initrd_add_module(initrd, "af_packet.ko");
 
     if (!gvir_sandbox_builder_initrd_construct(builder, initrd, targetfile, error))
         goto cleanup;
-- 
2.1.4




More information about the libvir-list mailing list