[PATCH 3/5] kvm tools: Attach default 'root=' only if required

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes a case where the 'root=' parameter was passed twice
when using virtio-9p root mode.

Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx>
---
 tools/kvm/builtin-run.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
index b9efde2..ef1a358 100644
--- a/tools/kvm/builtin-run.c
+++ b/tools/kvm/builtin-run.c
@@ -739,11 +739,10 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
 			strlcat(real_cmdline, " init=/bin/sh ", sizeof(real_cmdline));
 	}
 
-	if (!strstr(real_cmdline, "root="))
-		strlcat(real_cmdline, " root=/dev/vda rw ", sizeof(real_cmdline));
-
 	if (using_rootfs)
-		strcat(real_cmdline, " root=/dev/root rootflags=rw,trans=virtio,version=9p2000.L rootfstype=9p");
+		strcat(real_cmdline, " root=/dev/root rw rootflags=rw,trans=virtio,version=9p2000.L rootfstype=9p");
+	else if (!strstr(real_cmdline, "root="))
+		strlcat(real_cmdline, " root=/dev/vda rw ", sizeof(real_cmdline));
 
 	if (image_count) {
 		kvm->nr_disks = image_count;
-- 
1.7.6.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux