From: Sasha Levin Date: Mon, 5 Sep 2011 23:23:53 +0000 (+0300) Subject: kvm tools: Attach default 'root=' only if required X-Git-Tag: next-20110909~2^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fcaa162d843498033a12d44b2d9e8c41ee7bd9d0;p=karo-tx-linux.git kvm tools: Attach default 'root=' only if required This patch fixes a case where the 'root=' parameter was passed twice when using virtio-9p root mode. Signed-off-by: Sasha Levin Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c index b9efde2006e6..ef1a3585abe1 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;