mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-10-27 01:55:20 +03:00
domain: Don't set disk path to '-' if empty, let details do that.
This commit is contained in:
parent
04b4900625
commit
dc877783a5
@ -784,7 +784,7 @@ def can_we_clone(conn, vol, path):
|
||||
ret = True
|
||||
msg = None
|
||||
|
||||
if not path or path == "-":
|
||||
if not path:
|
||||
msg = _("No storage to clone.")
|
||||
|
||||
elif vol:
|
||||
|
@ -245,7 +245,7 @@ def populate_storage_list(storage_list, vm, conn):
|
||||
# default? Reasons not to, are if the storage is marked
|
||||
# readonly or sharable, or is in use by another VM.
|
||||
|
||||
if not path or path == "-":
|
||||
if not path:
|
||||
continue
|
||||
|
||||
default = False
|
||||
|
@ -1230,7 +1230,7 @@ class vmmDetails(gobject.GObject):
|
||||
return
|
||||
|
||||
self.window.get_widget("disk-source-type").set_text(diskinfo[5])
|
||||
self.window.get_widget("disk-source-path").set_text(diskinfo[3])
|
||||
self.window.get_widget("disk-source-path").set_text(diskinfo[3] or "-")
|
||||
self.window.get_widget("disk-target-type").set_text(diskinfo[4])
|
||||
self.window.get_widget("disk-target-device").set_text(diskinfo[2])
|
||||
if diskinfo[6] == True:
|
||||
@ -1245,7 +1245,7 @@ class vmmDetails(gobject.GObject):
|
||||
|
||||
button = self.window.get_widget("config-cdrom-connect")
|
||||
if diskinfo[4] == "cdrom":
|
||||
if diskinfo[3] == "-":
|
||||
if not diskinfo[3]:
|
||||
# source device not connected
|
||||
button.set_label(gtk.STOCK_CONNECT)
|
||||
else:
|
||||
|
@ -1123,8 +1123,6 @@ class vmmDomain(gobject.GObject):
|
||||
srcpath = child.prop("file")
|
||||
elif typ == "block":
|
||||
srcpath = child.prop("dev")
|
||||
elif typ == None:
|
||||
typ = "-"
|
||||
elif child.name == "target":
|
||||
devdst = child.prop("dev")
|
||||
bus = child.prop("bus")
|
||||
@ -1135,7 +1133,6 @@ class vmmDomain(gobject.GObject):
|
||||
|
||||
if srcpath == None:
|
||||
if devtype == "cdrom" or devtype == "floppy":
|
||||
srcpath = "-"
|
||||
typ = "block"
|
||||
else:
|
||||
raise RuntimeError("missing source path")
|
||||
|
Loading…
Reference in New Issue
Block a user