mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
virsh: remove driver check from attach-disk command
Virsh shouldn't check for driver support but rather let the backend handled this. After removing the check, I can successfully attach file-based images to a qemu VM with attach-disk. % virsh attach-disk vm2 /images/test02.img vdc --driver qemu --type disk --subdriver raw Disk attached successfully This command generates the following XML: <disk type='block' device='disk'> <driver name='qemu' type='raw'/> <source dev='/images/test02.img'/> <target dev='vdc' bus='virtio'/> <alias name='virtio-disk2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> </disk> Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
This commit is contained in:
parent
9c4f62ae61
commit
12a41822e1
@ -8146,13 +8146,8 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
|
||||
mode = vshCommandOptString(cmd, "mode", NULL);
|
||||
|
||||
if (driver) {
|
||||
if (STREQ(driver, "file") || STREQ(driver, "tap")) {
|
||||
if (STREQ(driver, "file") || STREQ(driver, "tap"))
|
||||
isFile = 1;
|
||||
} else if (STRNEQ(driver, "phy")) {
|
||||
vshError(ctl, _("No support for %s in command 'attach-disk'"),
|
||||
driver);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if (mode) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user