[virt-tools-list] [useless patch] tracking lxc containers in virt-manager

Serge E. Hallyn serge.hallyn at canonical.com
Wed Oct 20 14:07:25 UTC 2010


All right this isn't particularly useful on its own.  It needs at least
support added for adding new containers.  As it is, all it lets you do
is see a list of your lxc containers in virt-manager, track whether they
are running, and, if not, start them.  But I've been sitting on this for
awhile and haven't gotten around to doing that, so I'm hoping that
sending this out will either spur me or someone else on to actually do
that.

thanks,
-serge

+--- virt-manager-0.8.4.orig/src/vmm-open-connection.glade
++++ virt-manager-0.8.4/src/vmm-open-connection.glade
+@@ -90,7 +89,8 @@
+               <widget class="GtkComboBox" id="hypervisor">
+                 <property name="visible">True</property>
+                 <property name="items" translatable="yes">Xen
+-QEMU/KVM</property>
++QEMU/KVM
++LXC</property>
+                 <accessibility>
+                   <atkproperty name="AtkObject::accessible-name" translatable="yes">Hypervisor Select</atkproperty>
+                 </accessibility>
+--- virt-manager-0.8.4.orig/src/virtManager/connection.py
++++ virt-manager-0.8.4/src/virtManager/connection.py
+@@ -408,6 +408,10 @@ class vmmConnection(gobject.GObject):
+         scheme = virtinst.util.uri_split(self.uri)[0]
+         return scheme.startswith("xen")
+ 
++    def is_lxc(self):
++        scheme = virtinst.util.uri_split(self.uri)[0]
++        return scheme.startswith("lxc")
++
+     def is_qemu(self):
+         scheme = virtinst.util.uri_split(self.uri)[0]
+         return scheme.startswith("qemu")
+--- virt-manager-0.8.4.orig/src/virtManager/connect.py
++++ virt-manager-0.8.4/src/virtManager/connect.py
+@@ -27,6 +27,7 @@ import socket
+ 
+ HV_XEN = 0
+ HV_QEMU = 1
++HV_LXC = 2
+ 
+ CONN_LOCAL = 0
+ CONN_TCP = 1
+@@ -248,6 +249,8 @@ class vmmConnect(gobject.GObject):
+                 uri = "xen+ssh://" + user + "@" + host + "/"
+             elif conn == CONN_TCP:
+                 uri = "xen+tcp://" + host + "/"
++        elif hv == HV_LXC:
++            uri = "lxc:///"
+         else:
+             if conn == CONN_LOCAL:
+                 uri = "qemu:///system"




More information about the virt-tools-list mailing list