This automagical guessing of disk type, driver name, and other stuff is not easily changeable since users may rely on that. Thus you need to explicitly override these fields, e.g. you would do virsh attach-disk console /var/lib/libvirt/images/foo.qcow2 vdb --sourcetype file --driver qemu --subdriver qcow2 This has been fixed as bug 609422 so I'm closing this one as a dup of it. *** This bug has been marked as a duplicate of bug 609422 ***
(In reply to comment #1) yes, i have added the parameters for attach-disk like you wrote above. and the guest can be start successfully.
but i also check attach-disk command. # virsh help attach-disk NAME attach-disk - attach disk device SYNOPSIS attach-disk <domain> <source> <target> [--driver <string>] [--subdriver <string>] [--type <string>] [--mode <string>] [--persistent] [--sourcetype <string>] Please have a look. these parameters like --driver are optional, if we use the method above to fix this bug, should this parameters are mandatory? or need we submit a new bug for attach-disk mandatory parameters check?
Yes, they are optional because you don't need to specify them in all cases. For example, you can successfully attach a disk into a Xen guest without these optional arguments. For compatibility reasons we can't change the automagic behavior of attach-disk commands used without these optional parameters and make them mandatory.