By default if we attach the qcow2 image to the guest it adds a raw image. So, one would think --type is meant for qcow2, raw.. etc. which is actually for cdrom, floppy drive.. etc. It would be better if the help page is updated with examples like --type " target device type eg: cdrom, floppy" instead of just "target device type" and supported drivers for --driver qcow2 etc virsh attach-disk --help NAME attach-disk - attach disk device SYNOPSIS attach-disk <domain> <source> <target> [--driver <string>] [--subdriver <string>] [--cache <string>] [--type <string>] [--mode <string>] [--config] [--sourcetype <string>] [--serial <string>] [--shareable] [--rawio] [--address <string>] [--multifunction] [--print-xml] DESCRIPTION Attach new disk device. OPTIONS [--domain] <string> domain name, id or uuid [--source] <string> source of disk device [--target] <string> target of disk device --driver <string> driver of disk device --subdriver <string> subdriver of disk device --cache <string> cache mode of disk device --type <string> target device type --mode <string> mode of device reading and writing --config affect next boot --sourcetype <string> type of source (block|file) --serial <string> serial of disk device --shareable shareable between domains --rawio needs rawio capability --address <string> address of disk device --multifunction use multifunction pci under specified address --print-xml print XML document rather than attach the disk
I sent a patch upstream: http://www.redhat.com/archives/libvir-list/2016-April/msg00454.html
Upstream patch was NACKd in favor of the man page