From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Evans Subject: [PATCH] kvm tools: Fix running with --initrd and no real discs/rootfs Date: Thu, 15 Dec 2011 18:13:41 +1100 Message-ID: <4EE99E25.70509@ozlabs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Sasha Levin , Cyrill Gorcunov , Asias He , KVM list To: Pekka Enberg Return-path: Received: from ozlabs.org ([203.10.76.45]:39646 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750996Ab1LOHNA (ORCPT ); Thu, 15 Dec 2011 02:13:00 -0500 Sender: kvm-owner@vger.kernel.org List-ID: It's useful to boot with no -d and no implicit 9p root, with --initrd. Since commit eaf720b285947a6f4e29174d0eba1899de31d8ab, we die() failing to create the 2nd stage custom rootfs. This patch doesn't try to set up a custom rootfs by default if user specifies an initrd on the commandline. Signed-off-by: Matt Evans --- tools/kvm/builtin-run.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index 0879ab9..c4329ea 100644 --- a/tools/kvm/builtin-run.c +++ b/tools/kvm/builtin-run.c @@ -973,7 +973,7 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix) if (kernel_cmdline) strlcat(real_cmdline, kernel_cmdline, sizeof(real_cmdline)); - if (!using_rootfs && !image_filename[0]) { + if (!using_rootfs && !image_filename[0] && !initrd_filename) { char tmp[PATH_MAX]; kvm_setup_create_new("default"); -- 1.7.0.4