[libvirt] [PATCH 06/10] Qemu Monitor API entry point.

Chris Lalancette clalance at redhat.com
Tue Apr 27 21:36:40 UTC 2010


On 04/27/2010 04:25 PM, Daniel P. Berrange wrote:
>> Causes the build to fail when linking virsh:
>>
>>   CCLD   virsh
>> ../src/.libs/libvirt-qemu.so: undefined reference to `qemuMonitorCommand'
>> collect2: ld returned 1 exit status
>>
>> Indeed, if I nm src/.libs/libvirt-qemu.so:
>>
>> [clalance at localhost libvirt (qemu_monitor)]$ nm src/.libs/libvirt-qemu.so | grep Monitor
>>          U qemuMonitorCommand
>>          U remoteQemuMonitorCommand@@LIBVIRT_PRIVATE_0.8.0
>> 000010b0 T virDomainQemuMonitorCommand
>>
>> Any suggestions about what I'm doing wrong?
> 
> Have you re-ordered your patches ? There is a qemuMonitorCommand  defined
> in src/qemu/qemu_monitor_text.c but that is static. The qemuMonitorCommand
> you actually want is not added till your next patch. So perhaps your old
> code was pullin in the wrong definition ?
> 
> It'd be good to rename this to reflect the public API name and avoid the
> clash

I did not re-order my patches, but you are right, there is a name clash.
I've now resolved that as you suggested (calling the external function
qemuDomainMonitorCommand).

That's not actually the problem, though.  What's happening is that
src/Makefile.am has this:

if WITH_QEMU
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
else
noinst_LTLIBRARIES += libvirt_driver_qemu.la
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_qemu.la

i.e. libvirt_driver_qemu.la is not being added to libvirt.la, so that's
why my linking step in virsh is failing (and *not* failing when linking
libvirtd).  So I think I need to manually specify libvirt_qemu.la in
my libvirt_qemu_la_LIBADD to avoid this failure.

-- 
Chris Lalancette




More information about the libvir-list mailing list