The root filesystem for an openvz guest is defined from a template name.
We support this when creating a new guest, but never include this info
when dumping the XML. Thsi patch addresses this problem by reading the
OSTEMPLATE config parameter
diff -r e0c166ce24bd src/openvz_conf.c
--- a/src/openvz_conf.c Tue Oct 14 15:46:24 2008 +0100
+++ b/src/openvz_conf.c Tue Oct 14 15:49:41 2008 +0100
@@ -308,6 +308,47 @@ error:
}
+static int
+openvzReadFSConf(virConnectPtr conn,
+ virDomainDefPtr def,
+ int veid) {
+ int ret;
+ virDomainFSDefPtr fs;
+ char temp[4096];
+
+ ret = openvzReadConfigParam(veid, "OSTEMPLATE", temp, sizeof(temp));
+ if (ret < 0) {
+ openvzError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Cound not read 'OSTEMPLATE' from config for container
%d"),
+ veid);
+ goto error;
+ } else if (ret > 0) {
+ if (VIR_ALLOC(fs) < 0)
+ goto no_memory;
+
+ fs->type = VIR_DOMAIN_FS_TYPE_TEMPLATE;
+ fs->src = strdup(temp);
+ fs->dst = strdup("/");
+
+ if (fs->src == NULL || fs->dst == NULL)
+ goto no_memory;
+
+ if (VIR_REALLOC_N(def->fss, def->nfss + 1) < 0)
+ goto no_memory;
+ def->fss[def->nfss++] = fs;
+ fs = NULL;
+
+ }
+
+ return 0;
+no_memory:
+ openvzError(conn, VIR_ERR_NO_MEMORY, NULL);
+error:
+ virDomainFSDefFree(fs);
+ return -1;
+}
+
+
/* Free all memory associated with a openvz_driver structure */
void
openvzFreeDriver(struct openvz_driver *driver)
@@ -393,6 +434,7 @@ int openvzLoadDomains(struct openvz_driv
/* XXX load rest of VM config data .... */
openvzReadNetworkConf(NULL, dom->def, veid);
+ openvzReadFSConf(NULL, dom->def, veid);
if (VIR_REALLOC_N(driver->domains.objs,
driver->domains.count + 1) < 0)
--
|: Red Hat, Engineering, London -o-
http://people.redhat.com/berrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org -o-
http://ovirt.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|