# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1209142960 25200
# Node ID a34b2f403fe423753084631235364f23220cb8f8
# Parent a0cecff057584e71cc0cf2ff48ae0c5b31631c4c
DefineSystem changes for LXC
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r a0cecff05758 -r a34b2f403fe4 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Fri Apr 25 10:02:25 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Fri Apr 25 10:02:40 2008 -0700
@@ -171,6 +171,24 @@ static int fv_vssd_to_domain(CMPIInstanc
return 1;
}
+static int lxc_vssd_to_domain(CMPIInstance *inst,
+ struct domain *domain)
+{
+ int ret;
+ const char *val;
+
+ domain->type = DOMAIN_LXC;
+
+ ret = cu_get_str_prop(inst, "InitPath", &val);
+ if (ret != CMPI_RC_OK)
+ val = "/bin/false";
+
+ free(domain->os_info.lxc.init);
+ domain->os_info.lxc.init = strdup(val);
+
+ return 1;
+}
+
static int vssd_to_domain(CMPIInstance *inst,
struct domain *domain)
{
@@ -207,16 +225,18 @@ static int vssd_to_domain(CMPIInstance *
domain->on_crash = (int)tmp;
- if (STREQC(pfx, "KVM"))
- fullvirt = true;
- else if (cu_get_bool_prop(inst, "IsFullVirt", &fullvirt) !=
CMPI_RC_OK)
+ if (cu_get_bool_prop(inst, "IsFullVirt", &fullvirt) != CMPI_RC_OK)
fullvirt = false;
- if (fullvirt)
+ if (fullvirt || STREQC(pfx, "KVM"))
ret = fv_vssd_to_domain(inst, domain, pfx);
- else
+ else if (STREQC(pfx, "Xen"))
ret = xenpv_vssd_to_domain(inst, domain);
-
+ else if (STREQC(pfx, "LXC"))
+ ret = lxc_vssd_to_domain(inst, domain);
+ else {
+ CU_DEBUG("Unknown domain prefix: %s", pfx);
+ }
out:
free(pfx);