diff --git a/src/xml.c b/src/xml.c index 22dc211..6e2f05d 100644 --- a/src/xml.c +++ b/src/xml.c @@ -1300,6 +1300,8 @@ virDomainParseXMLDiskDesc(virConnectPtr conn, xmlNodePtr node, typ = 0; else if (xmlStrEqual(type, BAD_CAST "block")) typ = 1; + else if (xmlStrEqual(type, BAD_CAST "pool")) + typ = 2; xmlFree(type); } device = xmlGetProp(node, BAD_CAST "device"); @@ -1312,8 +1314,22 @@ virDomainParseXMLDiskDesc(virConnectPtr conn, xmlNodePtr node, if (typ == 0) source = xmlGetProp(cur, BAD_CAST "file"); - else + else if (typ == 1) source = xmlGetProp(cur, BAD_CAST "dev"); + else if (typ == 2) { + xmlChar *pool = xmlGetProp(cur, BAD_CAST "pool"); + xmlChar *volume = xmlGetProp(cur, BAD_CAST "volume"); + if (pool != NULL && volume != NULL) { + virStoragePoolPtr virPool; + virPool = virStoragePoolLookupByName(conn, (const char *) pool); + if (virPool != NULL) { + virStorageVolPtr virVol; + virVol = virStorageVolLookupByName(virPool, (const char *) volume); + if (virVol != NULL) + source = BAD_CAST virStorageVolGetPath(virVol); + } + } + } } else if ((target == NULL) && (xmlStrEqual(cur->name, BAD_CAST "target"))) { target = xmlGetProp(cur, BAD_CAST "dev");