mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
Drop some explicit openvz handling
I don't think many, if any, people are using virt-manager with openvz. Drop the specific handling the filesystem UI, users can use the raw XML editor if they need special behavior Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ class TestConn(unittest.TestCase):
|
|||||||
conn.invalidate_caps()
|
conn.invalidate_caps()
|
||||||
assert conn.libvirt_new_enough_for_virtmanager(1000) is True
|
assert conn.libvirt_new_enough_for_virtmanager(1000) is True
|
||||||
assert conn.is_open() is True
|
assert conn.is_open() is True
|
||||||
assert conn.is_container() is False
|
assert conn.is_container_only() is False
|
||||||
assert conn.is_openvz() is False
|
assert conn.is_openvz() is False
|
||||||
assert not conn.get_uri_hostname()
|
assert not conn.get_uri_hostname()
|
||||||
assert not conn.get_uri_port()
|
assert not conn.get_uri_port()
|
||||||
|
|||||||
@@ -329,9 +329,9 @@ class vmmConnection(vmmGObject):
|
|||||||
getattr(s, "_backend").get_uri_transport)
|
getattr(s, "_backend").get_uri_transport)
|
||||||
get_uri_port = property(lambda s: getattr(s, "_backend").get_uri_port)
|
get_uri_port = property(lambda s: getattr(s, "_backend").get_uri_port)
|
||||||
get_driver = property(lambda s: getattr(s, "_backend").get_uri_driver)
|
get_driver = property(lambda s: getattr(s, "_backend").get_uri_driver)
|
||||||
is_container = property(lambda s: getattr(s, "_backend").is_container)
|
is_container_only = property(
|
||||||
|
lambda s: getattr(s, "_backend").is_container_only)
|
||||||
is_lxc = property(lambda s: getattr(s, "_backend").is_lxc)
|
is_lxc = property(lambda s: getattr(s, "_backend").is_lxc)
|
||||||
is_openvz = property(lambda s: getattr(s, "_backend").is_openvz)
|
|
||||||
is_vz = property(lambda s: getattr(s, "_backend").is_vz)
|
is_vz = property(lambda s: getattr(s, "_backend").is_vz)
|
||||||
is_xen = property(lambda s: getattr(s, "_backend").is_xen)
|
is_xen = property(lambda s: getattr(s, "_backend").is_xen)
|
||||||
is_remote = property(lambda s: getattr(s, "_backend").is_remote)
|
is_remote = property(lambda s: getattr(s, "_backend").is_remote)
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ class vmmCreateVM(vmmGObjectUI):
|
|||||||
is_storage_capable = self.conn.support.conn_storage()
|
is_storage_capable = self.conn.support.conn_storage()
|
||||||
can_storage = (is_local or is_storage_capable)
|
can_storage = (is_local or is_storage_capable)
|
||||||
is_pv = guest.os.is_xenpv()
|
is_pv = guest.os.is_xenpv()
|
||||||
is_container = self.conn.is_container()
|
is_container_only = self.conn.is_container_only()
|
||||||
is_vz = self.conn.is_vz()
|
is_vz = self.conn.is_vz()
|
||||||
is_vz_container = is_vz and guest.os.is_container()
|
is_vz_container = is_vz and guest.os.is_container()
|
||||||
can_remote_url = self.conn.get_backend().support_remote_url_install()
|
can_remote_url = self.conn.get_backend().support_remote_url_install()
|
||||||
@@ -505,7 +505,7 @@ class vmmCreateVM(vmmGObjectUI):
|
|||||||
installable_arch)
|
installable_arch)
|
||||||
method_local.set_sensitive(not is_pv and can_storage and
|
method_local.set_sensitive(not is_pv and can_storage and
|
||||||
installable_arch)
|
installable_arch)
|
||||||
method_manual.set_sensitive(not is_container)
|
method_manual.set_sensitive(not is_container_only)
|
||||||
method_import.set_sensitive(can_storage)
|
method_import.set_sensitive(can_storage)
|
||||||
virt_methods = [method_local, method_tree,
|
virt_methods = [method_local, method_tree,
|
||||||
method_manual, method_import]
|
method_manual, method_import]
|
||||||
@@ -538,7 +538,7 @@ class vmmCreateVM(vmmGObjectUI):
|
|||||||
w.set_active(True)
|
w.set_active(True)
|
||||||
break
|
break
|
||||||
|
|
||||||
if not (is_container or
|
if not (is_container_only or
|
||||||
[w for w in virt_methods if w.get_sensitive()]):
|
[w for w in virt_methods if w.get_sensitive()]):
|
||||||
return self._show_startup_error(
|
return self._show_startup_error(
|
||||||
_("No install methods available for this connection."),
|
_("No install methods available for this connection."),
|
||||||
@@ -550,10 +550,10 @@ class vmmCreateVM(vmmGObjectUI):
|
|||||||
|
|
||||||
# Container install options
|
# Container install options
|
||||||
method_container_app.set_active(True)
|
method_container_app.set_active(True)
|
||||||
self.widget("container-install-box").set_visible(is_container)
|
self.widget("container-install-box").set_visible(is_container_only)
|
||||||
self.widget("vz-install-box").set_visible(is_vz)
|
self.widget("vz-install-box").set_visible(is_vz)
|
||||||
self.widget("virt-install-box").set_visible(
|
self.widget("virt-install-box").set_visible(
|
||||||
not is_container and not is_vz_container)
|
not is_container_only and not is_vz_container)
|
||||||
|
|
||||||
self.widget("kernel-info-box").set_visible(not installable_arch)
|
self.widget("kernel-info-box").set_visible(not installable_arch)
|
||||||
|
|
||||||
|
|||||||
@@ -88,11 +88,7 @@ class vmmFSDetails(vmmGObjectUI):
|
|||||||
model.append([xmlval, label])
|
model.append([xmlval, label])
|
||||||
|
|
||||||
# Filesystem widgets
|
# Filesystem widgets
|
||||||
if self.conn.is_openvz():
|
if self.conn.is_container_only():
|
||||||
simple_store_set("fs-type-combo",
|
|
||||||
[DeviceFilesystem.TYPE_MOUNT,
|
|
||||||
DeviceFilesystem.TYPE_TEMPLATE], sort=False)
|
|
||||||
elif self.conn.is_lxc():
|
|
||||||
simple_store_set("fs-type-combo",
|
simple_store_set("fs-type-combo",
|
||||||
[DeviceFilesystem.TYPE_MOUNT,
|
[DeviceFilesystem.TYPE_MOUNT,
|
||||||
DeviceFilesystem.TYPE_FILE,
|
DeviceFilesystem.TYPE_FILE,
|
||||||
@@ -116,8 +112,7 @@ class vmmFSDetails(vmmGObjectUI):
|
|||||||
simple_store_set("fs-format-combo", ["raw", "qcow2"], capitalize=False)
|
simple_store_set("fs-format-combo", ["raw", "qcow2"], capitalize=False)
|
||||||
simple_store_set("fs-wrpolicy-combo",
|
simple_store_set("fs-wrpolicy-combo",
|
||||||
DeviceFilesystem.WRPOLICIES + [None])
|
DeviceFilesystem.WRPOLICIES + [None])
|
||||||
self.show_pair_combo("fs-type",
|
self.show_pair_combo("fs-type", self.conn.is_container_only())
|
||||||
self.conn.is_openvz() or self.conn.is_lxc())
|
|
||||||
self.show_check_button("fs-readonly",
|
self.show_check_button("fs-readonly",
|
||||||
self.conn.is_qemu() or
|
self.conn.is_qemu() or
|
||||||
self.conn.is_test() or
|
self.conn.is_test() or
|
||||||
@@ -178,8 +173,7 @@ class vmmFSDetails(vmmGObjectUI):
|
|||||||
self.widget("fs-target").set_text(dev.target or "")
|
self.widget("fs-target").set_text(dev.target or "")
|
||||||
self.widget("fs-readonly").set_active(dev.readonly)
|
self.widget("fs-readonly").set_active(dev.readonly)
|
||||||
|
|
||||||
self.show_pair_combo("fs-type",
|
self.show_pair_combo("fs-type", self.conn.is_container_only())
|
||||||
self.conn.is_openvz() or self.conn.is_lxc())
|
|
||||||
|
|
||||||
def set_config_value(self, name, value):
|
def set_config_value(self, name, value):
|
||||||
combo = self.widget("%s-combo" % name)
|
combo = self.widget("%s-combo" % name)
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ class VirtinstConnection(object):
|
|||||||
return self._uriobj.scheme.startswith("lxc")
|
return self._uriobj.scheme.startswith("lxc")
|
||||||
def is_openvz(self):
|
def is_openvz(self):
|
||||||
return self._uriobj.scheme.startswith("openvz")
|
return self._uriobj.scheme.startswith("openvz")
|
||||||
def is_container(self):
|
def is_container_only(self):
|
||||||
return self.is_lxc() or self.is_openvz()
|
return self.is_lxc() or self.is_openvz()
|
||||||
def is_vz(self):
|
def is_vz(self):
|
||||||
return (self._uriobj.scheme.startswith("vz") or
|
return (self._uriobj.scheme.startswith("vz") or
|
||||||
|
|||||||
Reference in New Issue
Block a user