* src/xml.c: added dump of physical vbd and read-only status

Daniel
This commit is contained in:
Daniel Veillard 2005-12-14 12:36:43 +00:00
parent 3447b53fea
commit 5462d542b9
2 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Wed Dec 14 13:35:39 CET 2005 Daniel Veillard <veillard@redhat.com>
* src/xml.c: added dump of physical vbd and read-only status
Wed Dec 14 12:20:06 CET 2005 Daniel Veillard <veillard@redhat.com> Wed Dec 14 12:20:06 CET 2005 Daniel Veillard <veillard@redhat.com>
* src/xml.c: started to add block devices and interfaces descriptions * src/xml.c: started to add block devices and interfaces descriptions

View File

@ -196,6 +196,29 @@ virDomainGetXMLDevice(virDomainPtr domain, virBufferPtr buf, long dev) {
virBufferVSprintf(buf, " <target dev='%s'/>\n", val); virBufferVSprintf(buf, " <target dev='%s'/>\n", val);
free(val); free(val);
} }
val = virDomainGetXMLDeviceInfo(domain, "vbd", dev, "read-only");
if (val != NULL) {
virBufferVSprintf(buf, " <readonly/>\n", val);
free(val);
}
virBufferAdd(buf, " </disk>\n", 12);
} else if (!strcmp(type, "phy")) {
virBufferVSprintf(buf, " <disk type='device'>\n");
val = virDomainGetXMLDeviceInfo(domain, "vbd", dev, "params");
if (val != NULL) {
virBufferVSprintf(buf, " <source device='%s'/>\n", val);
free(val);
}
val = virDomainGetXMLDeviceInfo(domain, "vbd", dev, "dev");
if (val != NULL) {
virBufferVSprintf(buf, " <target dev='%s'/>\n", val);
free(val);
}
val = virDomainGetXMLDeviceInfo(domain, "vbd", dev, "read-only");
if (val != NULL) {
virBufferVSprintf(buf, " <readonly/>\n", val);
free(val);
}
virBufferAdd(buf, " </disk>\n", 12); virBufferAdd(buf, " </disk>\n", 12);
} else { } else {
TODO TODO