[Libvir] virConnectOpenReadOnly broken

Richard W.M. Jones rjones at redhat.com
Mon Apr 7 14:00:52 UTC 2008

This is just a note that the following program tickles a nasty (memory
corruptor?) bug somewhere in the open code.  I'm still trying to look
into the cause and will post a followup if I find the problem.


  #include <libvirt/libvirt.h>
  #include <stdlib.h>
  #include <assert.h>
  main ()
    virConnectPtr conn;
    conn = virConnectOpenReadOnly ("xen+unix:///");
    assert (conn);
    virConnectClose (conn);
    exit (0);

  $ gcc -Wall test.c -lvirt -o test
  $ ./test
  libvir: Domain error : invalid domain pointer in virDomainFree
  test: test.c:11: main: Assertion `conn' failed.

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.

More information about the libvir-list mailing list