* src/xend_internal.c src/xml.c: fix for shareable drive support

rhbz#214908
Daniel
This commit is contained in:
Daniel Veillard 2006-11-13 17:09:31 +00:00
parent c41481197d
commit caaf9441f3
3 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Mon Nov 13 17:18:00 CET 2006 Daniel Veillard <veillard@redhat.com>
* src/xend_internal.c src/xml.c: fix for shareable drive support
rhbz#214908
Fri Nov 10 17:53:41 EDT 2006 Daniel Berrange <berrange@redhat.com>
* src/xml.c: Fix memory leak, by freeing xmlParserContextPtr object

View File

@ -1690,6 +1690,8 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersi
xend has already done this ? */
if ((mode != NULL) && (!strcmp(mode, "r")))
virBufferVSprintf(&buf, " <readonly/>\n");
else if ((mode != NULL) && (!strcmp(mode, "w!")))
virBufferVSprintf(&buf, " <shareable/>\n");
virBufferAdd(&buf, " </disk>\n", 12);
bad_parse:

View File

@ -955,6 +955,7 @@ virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm, int xendCo
xmlChar *drvName = NULL;
xmlChar *drvType = NULL;
int ro = 0;
int shareable = 0;
int typ = 0;
int cdrom = 0;
@ -988,6 +989,8 @@ virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm, int xendCo
drvType = xmlGetProp(cur, BAD_CAST "type");
} else if (xmlStrEqual(cur->name, BAD_CAST "readonly")) {
ro = 1;
} else if (xmlStrEqual(cur->name, BAD_CAST "shareable")) {
shareable = 1;
}
}
cur = cur->next;
@ -1076,10 +1079,12 @@ virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm, int xendCo
virBufferVSprintf(buf, "(uname 'phy:/dev/%s')", source);
}
}
if (ro == 0)
virBufferVSprintf(buf, "(mode 'w')");
else if (ro == 1)
if (ro == 1)
virBufferVSprintf(buf, "(mode 'r')");
else if (shareable == 1)
virBufferVSprintf(buf, "(mode 'w!')");
else
virBufferVSprintf(buf, "(mode 'w')");
virBufferAdd(buf, ")", 1);
virBufferAdd(buf, ")", 1);