[Libvirt-cim] [PATCH 2 of 4] Add code to be able to parse an existing storage pool's XML

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Jul 21 23:49:21 UTC 2009


>> +        for (child = node->children; child != NULL; child = 
>> child->next) {
>> +                if (XSTREQ(child->name, "device")) {
>> +                        const char *path;
>> +                        path = get_attr_value(child, "path");
>> +                        /* Build device path array here */
>> +                } else if (XSTREQ(child->name, "host")) {
>> +                        pool->host = get_attr_value(child, "name");
>> +                        if (pool->host == NULL)
>> +                                goto err;
>> +                } else if (XSTREQ(child->name, "dir")) {
>> +                        pool->src_dir = get_attr_value(child, "path");
>> +                        if (pool->src_dir == NULL)
>> +                                goto err;
>> +                } else if (XSTREQ(child->name, "dir")) {
>> +                        pool->src_dir = get_attr_value(child, "path");
>> +                        if (pool->src_dir == NULL)
>> +                                goto err;
> Duplicate code for node "dir". Also, I can't find the "dir" node in the 
> libvirt xml documentation, storage pool section.
> 

Good catch - not sure what I was thinking there...

Check out netfs type pools - they have a dir node.
-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list