addhw: Fix adding empty cdrom/floppy drive

This commit is contained in:
Cole Robinson 2014-03-12 16:54:14 -04:00
parent d2ad2bcf94
commit abb3920ac6

View File

@ -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,