mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-12 09:18:00 +03:00
create: Fix default storage path when VM name is changed (bz 1169141)
Regressed with 2e7ebd4
. Use skip_disk_page() to determine when we
shouldn't assume default storage
This commit is contained in:
parent
c090d18beb
commit
4a678f0543
@ -108,9 +108,6 @@ class vmmAddStorage(vmmGObjectUI):
|
||||
hd_label = ("<span color='#484848'>%s</span>" % hd_label)
|
||||
widget.set_markup(hd_label)
|
||||
|
||||
def _is_default_storage(self):
|
||||
return bool(self.widget("config-storage-create").get_active())
|
||||
|
||||
def _check_default_pool_active(self):
|
||||
default_pool = self.conn.get_default_pool()
|
||||
if default_pool and not default_pool.is_active():
|
||||
@ -257,8 +254,7 @@ class vmmAddStorage(vmmGObjectUI):
|
||||
return path
|
||||
|
||||
def is_default_storage(self):
|
||||
return self.widget("config-storage-create").is_visible() and \
|
||||
self.widget("config-storage-create").get_active()
|
||||
return self.widget("config-storage-create").get_active()
|
||||
|
||||
def _check_ideal_path(self, path, vmname, collidelist):
|
||||
# See if the ideal disk path (/default/pool/vmname.img)
|
||||
|
@ -1062,9 +1062,8 @@ class vmmCreate(vmmGObjectUI):
|
||||
return self.addstorage.get_default_path(name)
|
||||
|
||||
def is_default_storage(self):
|
||||
usedef = self.addstorage.is_default_storage()
|
||||
isimport = (self.get_config_install_page() == INSTALL_PAGE_IMPORT)
|
||||
return usedef and not isimport
|
||||
return (self.addstorage.is_default_storage() and
|
||||
not self.skip_disk_page())
|
||||
|
||||
def get_config_customize(self):
|
||||
return self.widget("summary-customize").get_active()
|
||||
@ -1718,6 +1717,8 @@ class vmmCreate(vmmGObjectUI):
|
||||
if name != self.guest.name:
|
||||
self.guest.name = name
|
||||
if self.is_default_storage():
|
||||
logging.debug("User changed VM name and using default storage,"
|
||||
"re-validating with new default storage path.")
|
||||
# User changed the name and we are using default storage
|
||||
# which depends on the VM name. Revalidate things
|
||||
if not self.validate_storage_page():
|
||||
|
Loading…
Reference in New Issue
Block a user