How to attach a block device to qemu VM through qemu command line?

Viewed 8418

I want to configure the qemu to attach a specific block device to the VM?

Following is the command I am using now:

qemu-system-x86_64 -enable-kvm -machine type=pc,accel=kvm 
                   -cpu host -nographic  -k de -usb -m 2048 
                   -net nic -net user,hostfwd=tcp::3388-:22
                    ubuntu16.04.qcow2

I know that following is the virsh command to do this:

virsh attach-disk ubuntuVM /dev/vdb

But I want to specify this in the above command line (Don't want to use virsh). Does anyone know how to do this?

Kind Regards

1 Answers
Related