]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: check driver name while attaching disk
authorWen Congyang <wency@cn.fujitsu.com>
Mon, 7 Mar 2011 06:35:49 +0000 (14:35 +0800)
committerLaine Stump <laine@laine.org>
Fri, 18 Mar 2011 04:36:37 +0000 (00:36 -0400)
commite2aec53b9706bc2872cb1ce6d0ceecceda762649
treed3b7f8c34dcd113e00e6b21697cf771c7815ed07
parent08ddbe61f68856bfb75f3def0080928e5e3c1599
qemu: check driver name while attaching disk

This bug was reported by Shi Jin(jinzishuai@gmail.com):
=============
# virsh attach-disk RHEL6RC /var/lib/libvirt/images/test3.img vdb \
        --driver file --subdriver qcow2
Disk attached successfully

# virsh save RHEL6RC /var/lib/libvirt/images/memory.save
Domain RHEL6RC saved to /var/lib/libvirt/images/memory.save

# virsh restore /var/lib/libvirt/images/memory.save
error: Failed to restore domain from /var/lib/libvirt/images/memory.save
error: internal error unsupported driver name 'file'
       for disk '/var/lib/libvirt/images/test3.img'
=============

We check the driver name when we start or restore VM, but we do
not check it while attaching a disk. This adds the same check on disk
driverName used in qemuBuildCommandLine to qemudDomainAttachDevice.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
src/qemu/qemu_driver.c