
On Tue, Feb 12, 2008 at 04:35:19AM +0000, Daniel P. Berrange wrote:
This patch adds 3 extra commands to virsh to allow storage pools and volumes to be defined & created without using XML. These have the names 'pool-define-as', 'pool-create-as', 'vol-create-as'. virsh will take the args to these commands and build suitable XML to pass into the libvirt APIs. This is a useful capability for people quickly shell scripting the virsh command, since they don't need to build up XML in the shell directly. In doing this we need to expose a couple of virBuffer* APIs to virsh. Turning these calls into macros exposed a couple of places where the existing code calls the virBufferVSprintf() function without actually having any va_args. These were turned int virBufferAdd calls instead.
buf.c | 11 + buf.h | 12 +
Hum, for virsh own use, i was tempted to suggest using an xmlBuffer instead of virBuffer, since xmlBuffer functions are exported from libxml2. But there is no xmlBufferVSprintf() or equivalent, just the basic Add() , i'm a bit annoyed by exporting more of the internal functions but I guess code coherency primes, so that's fine. okay, +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/