mirror of
https://github.com/virt-manager/virt-manager.git
synced 2026-08-14 15:05:26 -05:00
Tune default device list for Virtuozzo containers
Virtuozzo supports virtio NIC. Also add default VNC graphics. Privnet feature and emulator device have no sense for vz containers.
This commit is contained in:
committed by
Cole Robinson
parent
d86792fe0a
commit
c25ea6537b
@@ -8,11 +8,7 @@
|
|||||||
<type arch="x86_64">exe</type>
|
<type arch="x86_64">exe</type>
|
||||||
<init>/sbin/init</init>
|
<init>/sbin/init</init>
|
||||||
</os>
|
</os>
|
||||||
<features>
|
|
||||||
<privnet/>
|
|
||||||
</features>
|
|
||||||
<devices>
|
<devices>
|
||||||
<emulator>vz</emulator>
|
|
||||||
<filesystem type="template">
|
<filesystem type="template">
|
||||||
<source name="centos-7-x86_64"/>
|
<source name="centos-7-x86_64"/>
|
||||||
<target dir="/"/>
|
<target dir="/"/>
|
||||||
@@ -21,6 +17,7 @@
|
|||||||
<source network="Bridged"/>
|
<source network="Bridged"/>
|
||||||
<mac address="00:11:22:33:44:55"/>
|
<mac address="00:11:22:33:44:55"/>
|
||||||
</interface>
|
</interface>
|
||||||
|
<graphics type="vnc" port="-1" keymap="en-us"/>
|
||||||
<console type="pty"/>
|
<console type="pty"/>
|
||||||
</devices>
|
</devices>
|
||||||
</domain>
|
</domain>
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ class vmmAddHardware(vmmGObjectUI):
|
|||||||
model.append([None, _("Hypervisor default")])
|
model.append([None, _("Hypervisor default")])
|
||||||
if vm.is_hvm():
|
if vm.is_hvm():
|
||||||
mod_list = []
|
mod_list = []
|
||||||
if vm.get_hv_type() in ["kvm", "qemu", "test"]:
|
if vm.get_hv_type() in ["kvm", "qemu", "vz", "test"]:
|
||||||
mod_list.append("virtio")
|
mod_list.append("virtio")
|
||||||
mod_list.append("rtl8139")
|
mod_list.append("rtl8139")
|
||||||
mod_list.append("e1000")
|
mod_list.append("e1000")
|
||||||
|
|||||||
@@ -387,6 +387,9 @@ class VirtualConnection(object):
|
|||||||
return self._uriobj.scheme.startswith("openvz")
|
return self._uriobj.scheme.startswith("openvz")
|
||||||
def is_container(self):
|
def is_container(self):
|
||||||
return self.is_lxc() or self.is_openvz()
|
return self.is_lxc() or self.is_openvz()
|
||||||
|
def is_vz(self):
|
||||||
|
return (self._uriobj.scheme.startswith("vz") or
|
||||||
|
self._uriobj.scheme.startswith("parallels"))
|
||||||
|
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
|
|||||||
+3
-3
@@ -637,7 +637,7 @@ class Guest(XMLBuilder):
|
|||||||
return
|
return
|
||||||
if self.get_devices("graphics"):
|
if self.get_devices("graphics"):
|
||||||
return
|
return
|
||||||
if self.os.is_container():
|
if self.os.is_container() and not self.conn.is_vz():
|
||||||
return
|
return
|
||||||
if self.os.arch not in ["x86_64", "i686", "ppc64", "ppc64le", "ia64"]:
|
if self.os.arch not in ["x86_64", "i686", "ppc64", "ppc64le", "ia64"]:
|
||||||
return
|
return
|
||||||
@@ -786,7 +786,7 @@ class Guest(XMLBuilder):
|
|||||||
hyperv.present = True
|
hyperv.present = True
|
||||||
|
|
||||||
def _set_emulator_defaults(self):
|
def _set_emulator_defaults(self):
|
||||||
if self.os.is_xenpv():
|
if self.os.is_xenpv() or self.type == "vz":
|
||||||
self.emulator = None
|
self.emulator = None
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -850,7 +850,7 @@ class Guest(XMLBuilder):
|
|||||||
self.features.acpi = None
|
self.features.acpi = None
|
||||||
self.features.apic = None
|
self.features.apic = None
|
||||||
self.features.pae = None
|
self.features.pae = None
|
||||||
if self._is_full_os_container():
|
if self._is_full_os_container() and self.type != "vz":
|
||||||
self.features.privnet = True
|
self.features.privnet = True
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user