Hello,
I have tried writing a simple program.
I have compiled it with
cc xmlist.c -L /usr/src/redhat/BUILD/libvir-0.0.1/src/.libs -lvir -o xmlist
But am getting an error on trying after the virConnectOpen call .
Any help would be appreciated .
                 Rgds,
                 Dakshina


Here is the code :xmlist.c

#include <stdio.h>
#include <libvir.h>

main(){
virConnectPtr conn;
int *domids ;
int maxids = 20;
int numDoms=-1;
conn=virConnectOpen("");
if(conn == NULL){
  printf("Error : Could not open a connection \n");
  return(-1);
}

numDoms=virConnectListDomains(conn,domids,maxids);

printf("The number of domains %d\n",numDoms);
printf("The number of! domains %d\n", virConnectNumOfDomains(conn));
}
 cc xmlist.c -L /usr/src/redhat/BUILD/libvir-0.0.1/src/.libs -lvir -o xmlist


Daniel Veillard <veillard@redhat.com> wrote:
On Tue, Jan 24, 2006 at 08:46:07PM -0800, dasari dakshina wrote:
> Hello Daniel,
> Thanks so much for the info .I downloaded the Xen
> 3 source and was able to compile without any issues.
> Is there any link where I can look at simple examples
> of the API usage ?

not yet, check http://libvir.org/html/libvir-libvir.html
Please keep discussion on the list,

thanks,

Daniel

--
Daniel Veillard | Red Hat http://redhat.com/
veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



What are the most popular cars? Find out at Yahoo! Autos