[libvirt] [PATCH] trivial libvirt example code

Richard W.M. Jones rjones at redhat.com
Mon Jan 26 11:06:01 UTC 2009


On Fri, Jan 23, 2009 at 02:51:02PM -0500, Dave Allan wrote:
> The examples directory doesn't have a trivial example of how to connect  
> to a hypervisor, make a few calls, and disconnect, so I put one  
> together.  I would appreciate any suggestions on anything that I've done  
> wrong as well as suggestions for other fundamental API calls that should  
> be illustrated.

Yes, I checked this example code and it is fine.  My only comment
would be on:

> +    /* virConnectOpenAuth called here with all default parameters */
> +    conn = virConnectOpenAuth(NULL, virConnectAuthPtrDefault, 0);

It might be better to let people connect to a named URI.

Another possibility is to default to the test URI (test:///default)
since that (almost) always exists.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top




More information about the libvir-list mailing list