Liang Chaojun
2021-May-13 07:34 UTC
How to hot plugin a new vhost-user-blk-pci device to running VM?
Hi Guy, Does anyone clear how to hot plugin a new vhost-user-blk-pci device to a running VM? Before staring vm , I pass the disk through QEMU command line like below. <qemu:commandline> <qemu:arg value='-object'/> <qemu:arg value='memory-backend-file,id=mem0,size=4G,mem-path=/dev/hugepages,share=on'/> <qemu:arg value='-numa'/> <qemu:arg value='node,memdev=mem0'/> <qemu:arg value='-chardev'/> <qemu:arg value='socket,id=spdk_vhost_blk721ea46a-b306-11eb-a280-525400a98761,path=/var/tmp/vhost.721ea46a-b306-11eb-a280-525400a98761,reconnect=1'/> <qemu:arg value='-device'/> <qemu:arg value='vhost-user-blk-pci,chardev=spdk_vhost_blk721ea46a-b306-11eb-a280-525400a98761,bootindex=1,num-queues=4'/> <qemu:arg value='-chardev'/> <qemu:arg value='socket,id=spdk_vhost_blk2f699c58-d222-4629-9fdc-400c3aadc55e,path=/var/tmp/vhost.2f699c58-d222-4629-9fdc-400c3aadc55e,reconnect=1'/> <qemu:arg value='-device'/> <qemu:arg value='vhost-user-blk-pci,chardev=spdk_vhost_blk2f699c58-d222-4629-9fdc-400c3aadc55e,num-queues=4'/> </qemu:commandline> But I don?t know how to live add a vhost-user-blk-pci device on running VM even with calling attachDevice API now. OS: redhat 7.4 Libvirt version: 3.4 Your help will be appreciated. Thanks!