
On Thu, Aug 21, 2008 at 10:29:43AM -0400, David Lively wrote:
Hi Folks - Here's my second pass at storage pool discovery. I've taken Daniel's suggestion and made it return a single XML doc containing <source> elements rather than an array of <pool> docs (and also incorporated suggestions from Daniel V and Jim M). Note that the storage <source> <name> patch is closely related (without it, the <source> docs returned for logical pools aren't correct).
Excellant, I think this patch looks more or less good to commit now.
+static char * +virStorageBackendFileSystemNetDiscoverPools(virConnectPtr conn, + const char *srcSpec, + unsigned int flags ATTRIBUTE_UNUSED)
...
+ const char *prog[] = { SHOWMOUNT, "--no-headers", "--exports", NULL, NULL }; + const char *start_tag = "<SourceList>\n"; + const char *end_tag = "</SourceList>\n";
I'd prefer that to be <sources> - we avoid capitals in the XML element names everywhere else, and in the few cases of joining words use an underscore, but I think plural form is OK for this.
+static char * +virStorageBackendLogicalDiscoverPools(virConnectPtr conn, + const char *srcSpec ATTRIBUTE_UNUSED, + unsigned int flags ATTRIBUTE_UNUSED)
+ const char *prog[] = { VGS, "--noheadings", "-o", "vg_name", NULL }; + const char *start_tag = "<SourceList>\n"; + const char *end_tag = "</SourceList>\n";
We should #define these two tags in storage_backend.h so each driver doesn't need to dup them Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|