[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] Re: [PATCH 0/3] A small example program



Hi David,

I've just applied your 3 patches and built the example.
That went fine.  Then I tried to run it like this:

     $ LIBVIRT_DEBUG=1 libvirtd 2> log & pid=$!
     $ ./hellolibvirt
     Attempting to connect to hypervisor
     Connected to hypervisor at "qemu:///session"
? -> Failed to get hypervisor version
     Disconnected from hypervisor
     [Exit 1]

There was plenty in the log:

DEBUG: libvirt.c: virInitialize (register drivers)
DEBUG: libvirt.c: virRegisterDriver (registering Test as driver 0)
DEBUG: libvirt.c: virRegisterNetworkDriver (registering Test as network driver 0)
DEBUG: libvirt.c: virRegisterStorageDriver (registering Test as storage driver 0)
DEBUG: libvirt.c: virRegisterDriver (registering Xen as driver 1)
DEBUG: libvirt.c: virRegisterDriver (registering OPENVZ as driver 2)
DEBUG: libvirt.c: virRegisterDriver (registering remote as driver 3)
DEBUG: libvirt.c: virRegisterNetworkDriver (registering remote as network driver 1)
DEBUG: libvirt.c: virRegisterStorageDriver (registering remote as storage driver 1)
DEBUG: libvirt.c: virRegisterDeviceMonitor (registering remote as device driver 0)
DEBUG: libvirt.c: virRegisterNetworkDriver (registering Network as network driver 2)
DEBUG: libvirt.c: virRegisterStorageDriver (registering storage as storage driver 2)
DEBUG: libvirt.c: virRegisterDeviceMonitor (registering halDeviceMonitor as device driver 1)
DEBUG: libvirt.c: virRegisterDriver (registering QEMU as driver 4)
DEBUG: libvirt.c: virRegisterDriver (registering LXC as driver 5)
DEBUG: libvirt.c: virRegisterDriver (registering UML as driver 6)
DEBUG: libvirt.c: virConnectOpen (name=)
DEBUG: libvirt.c: do_open (no name, allowing driver auto-select)
DEBUG: libvirt.c: do_open (trying driver 0 (Test) ...)
DEBUG: libvirt.c: do_open (driver 0 Test returned DECLINED)
DEBUG: libvirt.c: do_open (trying driver 1 (Xen) ...)
DEBUG: libvirt.c: do_open (driver 1 Xen returned DECLINED)
DEBUG: libvirt.c: do_open (trying driver 2 (OPENVZ) ...)
DEBUG: libvirt.c: do_open (driver 2 OPENVZ returned DECLINED)
DEBUG: libvirt.c: do_open (trying driver 3 (remote) ...)
DEBUG: libvirt.c: do_open (driver 3 remote returned DECLINED)
DEBUG: libvirt.c: do_open (trying driver 4 (QEMU) ...)
DEBUG: libvirt.c: do_open (driver 4 QEMU returned SUCCESS)
DEBUG: libvirt.c: do_open (network driver 0 Test returned DECLINED)
DEBUG: libvirt.c: do_open (network driver 1 remote returned DECLINED)
DEBUG: libvirt.c: do_open (network driver 2 Network returned SUCCESS)
DEBUG: libvirt.c: do_open (storage driver 0 Test returned DECLINED)
DEBUG: libvirt.c: do_open (storage driver 1 remote returned DECLINED)
DEBUG: libvirt.c: do_open (storage driver 2 storage returned SUCCESS)
DEBUG: libvirt.c: do_open (node driver 0 remote returned DECLINED)
DEBUG: libvirt.c: do_open (node driver 1 halDeviceMonitor returned SUCCESS)
DEBUG: libvirt.c: virConnectGetURI (conn=0xcbab10)
DEBUG: libvirt.c: virConnectGetType (conn=0xcbab10)
DEBUG: libvirt.c: virConnectGetVersion (conn=0xcbab10, hvVer=0x7fffbc541108)
DEBUG: libvirt.c: virConnectClose (conn=0xcbab10)
DEBUG: datatypes.c: virUnrefConnect (unref connection 0xcbab10 1)
DEBUG: datatypes.c: virReleaseConnect (release connection 0xcbab10)
Shutting down on signal 15
Then I repeated with the just-built libvirtd,
instead of the installed one, but then I get a new error:

     $ kill $pid
     $ LIBVIRT_DEBUG=1 ../../qemud/libvirtd 2> log &
     $ ./hellolibvirt
     Attempting to connect to hypervisor
     Connected to hypervisor at "qemu:///session"
? -> libvir: error : Unknown failure
     Failed to get hypervisor version
     Disconnected from hypervisor
     [Exit 1]

This is on F10 x86_64.
Does the above work for you?

Also, please change examples/hellolibvirt/Makefile.am to
use $(...) rather than the obsolete @...@ notation.
I.e., just apply the following to the rest when you squash those
commits into one.
Yes, I know there are quite a few existing uses of @...@,
and I even wrote a patch to remove them, but made the mistake
of also fixing some minor quoting bugs along the way, and haven't
gotten around to separating it into two change sets.

Finally, please add examples/hellolibvirt/hellolibvirt
to the top-level .cvsignore and rerun sync-vcs-ignore-files
to regenerate .gitignore and .hgignore to match.

>From 27f0007067280e4fa93b8c1d3c1c203314bde285 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering redhat com>
Date: Fri, 30 Jan 2009 10:02:51 +0100
Subject: [PATCH] use $(var), rather than obsolete @var@ notation

---
 examples/hellolibvirt/Makefile.am |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/hellolibvirt/Makefile.am b/examples/hellolibvirt/Makefile.am
index 6ef2cc8..489bf8b 100644
--- a/examples/hellolibvirt/Makefile.am
+++ b/examples/hellolibvirt/Makefile.am
@@ -1,5 +1,5 @@
-INCLUDES = -I top_srcdir@/include
+INCLUDES = -I$(top_srcdir)/include
 noinst_PROGRAMS = hellolibvirt
 hellolibvirt_CFLAGS = $(WARN_CFLAGS)
 hellolibvirt_SOURCES = hellolibvirt.c
-hellolibvirt_LDADD = @top_builddir@/src/libvirt.la
+hellolibvirt_LDADD = $(top_builddir)/src/libvirt.la
--
1.6.1.2.418.gd79e6

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]