[libvirt] [PATCH]: Add default pool types

As suggested by danpb, to fix up the regression caused by last week's VIR_ENUM cleanup patch, add a ".defaultFormat" member to .poolOptions. In storage_conf.c, if virXPathString(/pool/source/format/@type) returns NULL, then set the pool type to .defaultFormat; otherwise, lookup the type via formatFromString. Signed-off-by: Chris Lalancette <clalance@redhat.com>

Chris Lalancette wrote:
As suggested by danpb, to fix up the regression caused by last week's VIR_ENUM cleanup patch, add a ".defaultFormat" member to .poolOptions. In storage_conf.c, if virXPathString(/pool/source/format/@type) returns NULL, then set the pool type to .defaultFormat; otherwise, lookup the type via formatFromString.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
Thanks, this fixed a segfault I was seeing if defining a disk pool with no format. ACK. One side effect of this patch is that now disk xml can have <format type="unknown"/>, which isn't a doc'd value. Something for the future though. Thanks, Cole

On Wed, Oct 22, 2008 at 04:06:47PM +0200, Chris Lalancette wrote:
As suggested by danpb, to fix up the regression caused by last week's VIR_ENUM cleanup patch, add a ".defaultFormat" member to .poolOptions. In storage_conf.c, if virXPathString(/pool/source/format/@type) returns NULL, then set the pool type to .defaultFormat; otherwise, lookup the type via formatFromString.
ACK this looks good now. 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 :|

Chris Lalancette wrote:
As suggested by danpb, to fix up the regression caused by last week's VIR_ENUM cleanup patch, add a ".defaultFormat" member to .poolOptions. In storage_conf.c, if virXPathString(/pool/source/format/@type) returns NULL, then set the pool type to .defaultFormat; otherwise, lookup the type via formatFromString.
Committed this. Chris Lalancette
participants (3)
-
Chris Lalancette
-
Cole Robinson
-
Daniel P. Berrange