From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pekka Enberg Subject: [PATCH] kvm tools: Enable kernel DHCP autoconf by default Date: Tue, 9 Aug 2011 20:53:31 +0300 Message-ID: <1312912411-9416-1-git-send-email-penberg@kernel.org> Cc: Pekka Enberg , Asias He , Avi Kivity , Cyrill Gorcunov , Ingo Molnar , Linus Torvalds , Prasad Joshi , Sasha Levin To: kvm@vger.kernel.org Return-path: Received: from filtteri5.pp.htv.fi ([213.243.153.188]:39819 "EHLO filtteri5.pp.htv.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754081Ab1HIRxe (ORCPT ); Tue, 9 Aug 2011 13:53:34 -0400 Sender: kvm-owner@vger.kernel.org List-ID: As we boot to '/bin/sh' by default, enable kernel DHCP autoconfiguration too. The guest kernel needs to be configured with the following configuration options: CONFIG_IP_PNP=y CONFIG_IP_PNP_DHCP=y Cc: Asias He Cc: Avi Kivity Cc: Cyrill Gorcunov Cc: Ingo Molnar Cc: Linus Torvalds Cc: Prasad Joshi Cc: Sasha Levin Signed-off-by: Pekka Enberg --- tools/kvm/README | 3 +++ tools/kvm/builtin-run.c | 2 +- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/tools/kvm/README b/tools/kvm/README index 5b85461..2cf9364 100644 --- a/tools/kvm/README +++ b/tools/kvm/README @@ -70,6 +70,9 @@ linux-0.2.img.bz2 - For virtio-rng device (--rng): CONFIG_HW_RANDOM_VIRTIO=y + - For kernel DHCP autoconf (when booting to /bin/sh): + CONFIG_IP_PNP=y + CONFIG_IP_PNP_DHCP=y 5. And finally, launch the hypervisor: diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index fa5de27..af7f59c 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -601,7 +601,7 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix) using_rootfs = 1; if (!strstr(real_cmdline, "init=")) - strlcat(real_cmdline, " init=/bin/sh ", sizeof(real_cmdline)); + strlcat(real_cmdline, " init=/bin/sh ip=dhcp ", sizeof(real_cmdline)); } if (!strstr(real_cmdline, "root=")) -- 1.7.0.4