mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-09-05 05:01:33 +00:00
kvm tools: do not append root=/dev/vda if passed via command line
Hardcoding the root= option prevents an existing qemu-kvm based disk
image using LVM from booting. It fails to find the root filesystem.
By making the root parameter optional if given on the command line, the
image boots correctly. For example,
./kvm --kernel=/tmp/vmlinuz-2.6.38 \
--initrd=/tmp/initramfs-2.6.38.img \
--image=/home/dsa/vm/images/f14/nkvm-f14.img \
--mem=1024
--params="ro root=/dev/mapper/vg_f14vm-lv_root"
works now.
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
@@ -148,7 +148,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
kvm__setup_cpuid(kvm);
|
||||
|
||||
strcpy(real_cmdline, "notsc nolapic nosmp noacpi pci=conf1 console=ttyS0 root=/dev/vda rw ");
|
||||
strcpy(real_cmdline, "notsc nolapic nosmp noacpi pci=conf1 console=ttyS0 ");
|
||||
if (!kernel_cmdline || (strstr(kernel_cmdline, "root=") == NULL))
|
||||
strlcat(real_cmdline, "root=/dev/vda rw ", sizeof(real_cmdline));
|
||||
|
||||
if (kernel_cmdline) {
|
||||
strlcat(real_cmdline, kernel_cmdline, sizeof(real_cmdline));
|
||||
real_cmdline[sizeof(real_cmdline)-1] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user