qvm-block is just an alias to qvm-device. It shouldn’t result in different functionality.
I’m not sure what the problem was, but it works now. Using the same USB drive, now qvm-block lists the device node sda at the top of the list and I can attach it fine.
Sorry to correct a minor point - it is absolutely possible for an executable to change behaviour, depending on its filename.
This feature is fairly widely used in Linux and other unix-y systems… (Busybox is a particularly neat case, where a single file can act as an entire Linux base system, just by creating multiple links to it)
Bonus point: I use this occasionally in shell scripts, by testing the value of the $0 variable. It can help avoid code duplication or management of dependencies.
I bet everyone is pleased to know that
I think this is (probably) exactly the case of qvm-{device,block,usb,pci,…}
If any partition has been attached to a VM, then it may be necessary to unplug the device, and look immediately after it has been connected.
After plugin, I see :
Block : sys-usb:sdc
Block : sys-usb:sdc1
USB Device: sys-usb:2-3
After attaching the sys-usb:sdc1 partition to a disposable, I do not see the sdc block, because it was hidden when the partition was attached. I am guessing this is to avoid parallel access to the blocks from two different VMs, although the USB device does remain available (because of multifunction devices, maybe?).
The sdc blockdev remains hidden after detaching the partition, or closing the disposable.
Running sudo udevadm trigger in sys-usb seems to make it come back (as does physical unplug-replug).