Skip to contentSkip to conversation

kvm tools: Fix running with --initrd and no real discs/rootfs

PATCH New Matt Evans 1 participant 1 message Dec 15, 2011 KVM

lore
Share & tools
lore

Matt Evans

author
#0 lore raw

PATCH 1/1 kvm tools: Fix running with --initrd and no real discs/rootfs

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.

---
 tools/kvm/builtin-run.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/kvm/builtin-run.c +1 -1
index 0879ab9..c4329ea 100644
@@ -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");
Signature · 1 line
1.7.0.4