domain: Don't set disk path to '-' if empty, let details do that.

This commit is contained in:
Cole Robinson 2009-11-03 16:09:03 -05:00
parent 04b4900625
commit dc877783a5
4 changed files with 4 additions and 7 deletions

View File

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

View File

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

View File

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

View File

@ -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")