[PATCH 0 of 2] Add first bits of LXC support

This set adds very preliminary support to libvirt-cim for LXC guests. Added are changes to the ComputerSystem, HostSystem, and VSSD schema as well as the change required to make misc_utils capable of generation lxc:// URIs.

# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1206386444 25200 # Node ID 9a53365f6ff549292ab8148a9954c534c187870f # Parent c8c0e264c75cccccb40ff0de1cfdfc7a14c3d65a Add LXC support to ComputerSystem, HostSystem, and VSMS schema Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r c8c0e264c75c -r 9a53365f6ff5 schema/ComputerSystem.mof --- a/schema/ComputerSystem.mof Thu Mar 20 10:47:48 2008 -0700 +++ b/schema/ComputerSystem.mof Mon Mar 24 12:20:44 2008 -0700 @@ -26,3 +26,16 @@ class KVM_ComputerSystem : CIM_ComputerS }; +[Description ( + "A class derived from CIM_ComputerSystem to represent " + "the LXC virtual machines running on the system."), + Provider("cmpi::Virt_ComputerSystem") +] +class LXC_ComputerSystem : CIM_ComputerSystem +{ + + [Description("UUID assigned to this virtual machine.")] + string UUID; + +}; + diff -r c8c0e264c75c -r 9a53365f6ff5 schema/ComputerSystem.registration --- a/schema/ComputerSystem.registration Thu Mar 20 10:47:48 2008 -0700 +++ b/schema/ComputerSystem.registration Mon Mar 24 12:20:44 2008 -0700 @@ -2,3 +2,4 @@ # Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ComputerSystem root/virt Virt_ComputerSystem Virt_ComputerSystem instance method KVM_ComputerSystem root/virt Virt_ComputerSystem Virt_ComputerSystem instance method +LXC_ComputerSystem root/virt Virt_ComputerSystem Virt_ComputerSystem instance method \ No newline at end of file diff -r c8c0e264c75c -r 9a53365f6ff5 schema/HostSystem.mof --- a/schema/HostSystem.mof Thu Mar 20 10:47:48 2008 -0700 +++ b/schema/HostSystem.mof Mon Mar 24 12:20:44 2008 -0700 @@ -18,3 +18,12 @@ class KVM_HostSystem : CIM_ComputerSyste { }; +[Description ( + "A class derived from CIM_ComputerSystem to represent " + "the LXC host system."), + Provider("cmpi::Virt_HostSystem") +] +class LXC_HostSystem : CIM_ComputerSystem +{ +}; + diff -r c8c0e264c75c -r 9a53365f6ff5 schema/HostSystem.registration --- a/schema/HostSystem.registration Thu Mar 20 10:47:48 2008 -0700 +++ b/schema/HostSystem.registration Mon Mar 24 12:20:44 2008 -0700 @@ -2,3 +2,4 @@ # Classname Namespace ProviderName ProviderModule ProviderTypes Xen_HostSystem root/virt Virt_HostSystem Virt_HostSystem instance KVM_HostSystem root/virt Virt_HostSystem Virt_HostSystem instance +LXC_HostSystem root/virt Virt_HostSystem Virt_HostSystem instance diff -r c8c0e264c75c -r 9a53365f6ff5 schema/VirtualSystemManagementService.mof --- a/schema/VirtualSystemManagementService.mof Thu Mar 20 10:47:48 2008 -0700 +++ b/schema/VirtualSystemManagementService.mof Mon Mar 24 12:20:44 2008 -0700 @@ -9,3 +9,8 @@ class KVM_VirtualSystemManagementService class KVM_VirtualSystemManagementService : CIM_VirtualSystemManagementService { }; + +[Provider("cmpi::Virt_VirtualSystemManagementService")] +class LXC_VirtualSystemManagementService : CIM_VirtualSystemManagementService +{ +}; diff -r c8c0e264c75c -r 9a53365f6ff5 schema/VirtualSystemManagementService.registration --- a/schema/VirtualSystemManagementService.registration Thu Mar 20 10:47:48 2008 -0700 +++ b/schema/VirtualSystemManagementService.registration Mon Mar 24 12:20:44 2008 -0700 @@ -2,3 +2,4 @@ # Classname Namespace ProviderName ProviderModule ProviderTypes Xen_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance KVM_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance +LXC_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance

# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1206386465 25200 # Node ID 08bd3393c777cb87b8bfc4ad5d8ef0ceedb12590 # Parent 9a53365f6ff549292ab8148a9954c534c187870f Add LXC support to misc_utils functions Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r 9a53365f6ff5 -r 08bd3393c777 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Mon Mar 24 12:20:44 2008 -0700 +++ b/libxkutil/misc_util.c Mon Mar 24 12:21:05 2008 -0700 @@ -46,6 +46,8 @@ static const char *cn_to_uri(const char return "xen"; else if (STARTS_WITH(classname, "KVM")) return "qemu:///system"; + else if (STARTS_WITH(classname, "LXC")) + return "lxc:///system"; else return NULL; } @@ -200,6 +202,8 @@ const char *pfx_from_conn(virConnectPtr pfx = "Xen"; else if (STARTS_WITH(uri, "qemu")) pfx = "KVM"; + else if (STARTS_WITH(uri, "lxc")) + pfx = "LXC"; free(uri);
participants (1)
-
Dan Smith