mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
domain: Drop is_management_domain
It's not consistently applied. If I had a setup to test against old xen that still listed dom0, I'd make it so we never even show dom0 so we can sidestep the problem entirely.
This commit is contained in:
parent
d449fb6fd5
commit
7a56c322ed
@ -706,10 +706,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
for i in self._addhwmenuitems.values():
|
||||
self.addhwmenu.add(i)
|
||||
|
||||
# Don't allowing changing network/disks for Dom0
|
||||
dom0 = self.vm.is_management_domain()
|
||||
self.widget("add-hardware-button").set_sensitive(not dom0)
|
||||
|
||||
self.widget("hw-panel").set_show_tabs(False)
|
||||
self.widget("details-pages").set_show_tabs(False)
|
||||
self.widget("console-pages").set_show_tabs(False)
|
||||
@ -797,8 +793,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
except:
|
||||
logging.exception("Error determining machine list")
|
||||
|
||||
show_machine = (arch not in ["i686", "x86_64"] and
|
||||
not self.vm.is_management_domain())
|
||||
show_machine = (arch not in ["i686", "x86_64"])
|
||||
uiutil.set_grid_row_visible(self.widget("machine-type-title"),
|
||||
show_machine)
|
||||
|
||||
@ -851,8 +846,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.widget("overview-firmware-label").set_visible(
|
||||
not self.is_customize_dialog)
|
||||
show_firmware = ((self.conn.is_qemu() or self.conn.is_test_conn()) and
|
||||
domcaps.arch_can_uefi() and
|
||||
not self.vm.is_management_domain())
|
||||
domcaps.arch_can_uefi())
|
||||
uiutil.set_grid_row_visible(
|
||||
self.widget("overview-firmware-title"), show_firmware)
|
||||
|
||||
@ -879,8 +873,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.widget("overview-chipset-label").set_visible(
|
||||
not self.is_customize_dialog)
|
||||
show_chipset = ((self.conn.is_qemu() or self.conn.is_test_conn()) and
|
||||
arch in ["i686", "x86_64"] and
|
||||
not self.vm.is_management_domain())
|
||||
arch in ["i686", "x86_64"])
|
||||
uiutil.set_grid_row_visible(
|
||||
self.widget("overview-chipset-title"), show_chipset)
|
||||
|
||||
@ -1307,7 +1300,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
run = vm.is_runable()
|
||||
stop = vm.is_stoppable()
|
||||
paused = vm.is_paused()
|
||||
ro = vm.is_read_only()
|
||||
|
||||
if vm.managedsave_supported:
|
||||
self.change_run_text(vm.has_managed_save())
|
||||
@ -1322,11 +1314,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
|
||||
self.widget("overview-name").set_editable(not active)
|
||||
|
||||
self.widget("config-vcpus").set_sensitive(not ro)
|
||||
self.widget("config-vcpupin").set_sensitive(not ro)
|
||||
self.widget("config-memory").set_sensitive(not ro)
|
||||
self.widget("config-maxmem").set_sensitive(not ro)
|
||||
|
||||
# Disable send key menu entries for offline VM
|
||||
send_key = self.widget("details-menu-send-key")
|
||||
for c in send_key.get_submenu().get_children():
|
||||
|
@ -315,7 +315,6 @@ class vmmDomain(vmmLibvirtObject):
|
||||
}
|
||||
|
||||
self._install_abort = False
|
||||
self._is_management_domain = None
|
||||
self._id = None
|
||||
self._uuid = None
|
||||
self._has_managed_save = None
|
||||
@ -460,17 +459,6 @@ class vmmDomain(vmmLibvirtObject):
|
||||
def stable_defaults(self):
|
||||
return self.get_xmlobj().stable_defaults()
|
||||
|
||||
def is_read_only(self):
|
||||
if self.is_management_domain():
|
||||
return True
|
||||
return False
|
||||
|
||||
def is_management_domain(self):
|
||||
if self._is_management_domain is None:
|
||||
self._is_management_domain = (self.conn.is_xen() and
|
||||
self.get_id() == 0)
|
||||
return self._is_management_domain
|
||||
|
||||
def has_spicevmc_type_redirdev(self):
|
||||
devs = self.get_redirdev_devices()
|
||||
for dev in devs:
|
||||
@ -1887,13 +1875,6 @@ class vmmDomain(vmmLibvirtObject):
|
||||
if current > expected:
|
||||
del self._stats[expected:current]
|
||||
|
||||
# Xen reports complete crap for Dom0 max memory
|
||||
# (ie MAX_LONG) so lets clamp it to the actual
|
||||
# physical RAM in machine which is the effective
|
||||
# real world limit
|
||||
if self.is_management_domain() and info:
|
||||
info[1] = self.conn.host_memory_size()
|
||||
|
||||
now = time.time()
|
||||
(cpuTime, cpuTimeAbs,
|
||||
pcentHostCpu, pcentGuestCpu) = self._sample_cpu_stats(info, now)
|
||||
|
@ -128,7 +128,7 @@ class VMActionMenu(_VMMenu):
|
||||
"suspend": bool(vm and vm.is_stoppable()),
|
||||
"resume": bool(vm and vm.is_paused()),
|
||||
"migrate": bool(vm and vm.is_stoppable()),
|
||||
"clone": bool(vm and not vm.is_read_only()),
|
||||
"clone": True,
|
||||
}
|
||||
vismap = {
|
||||
"suspend": bool(vm and not vm.is_paused()),
|
||||
|
Loading…
Reference in New Issue
Block a user