提交 caaf9441 编写于 作者: D Daniel Veillard

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

  rhbz#214908
Daniel
上级 c4148119
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
......
......@@ -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:
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册