From virsh:

virsh # qemu-monitor-command --hmp DOMAIN drive_add 0 if=none,file=/tmp/mydisk.img,id=usbdrive1

virsh # qemu-monitor-command --hmp DOMAIN info block
[...]
usbdrive1 (#block9999): /tmp/mydisk.img (raw)
    Attached to:      /machine/peripheral/usbdevice/usbdevice.0/legacy[0]
    Cache mode:       writethrough

virsh # qemu-monitor-command --hmp DOMAIN device_add usb-storage,id=usbstorage1,drive=usbdrive1


CategoryTechnote

robots.org.uk: AttachingUSBDiskToLibvirtVM (last edited 2020-04-16 11:00:09 by sam)

© Sam Morris <sam@robots.org.uk>.
Content may be distributed and modified providing this notice is preserved.