mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
addhw: Fix adding empty cdrom/floppy drive
This commit is contained in:
parent
d2ad2bcf94
commit
abb3920ac6
@ -324,11 +324,11 @@ class vmmAddStorage(vmmGObjectUI):
|
|||||||
if is_default:
|
if is_default:
|
||||||
path = self._check_ideal_path(path, vmname, collidelist)
|
path = self._check_ideal_path(path, vmname, collidelist)
|
||||||
|
|
||||||
if not path and device != "disk":
|
if not path and device in ["disk", "lun"]:
|
||||||
return self.err.val_err(_("A storage path must be specified."))
|
return self.err.val_err(_("A storage path must be specified."))
|
||||||
|
|
||||||
disk = virtinst.VirtualDisk(conn)
|
disk = virtinst.VirtualDisk(conn)
|
||||||
disk.path = path
|
disk.path = path or None
|
||||||
disk.read_only = readonly
|
disk.read_only = readonly
|
||||||
disk.device = device
|
disk.device = device
|
||||||
disk.set_create_storage(size=size, sparse=sparse,
|
disk.set_create_storage(size=size, sparse=sparse,
|
||||||
|
Loading…
Reference in New Issue
Block a user