[libvirt] Unable to setup qemu-guest-agent

Could anyone please list out the steps required to run the command $virsh qemu-agent-command Steps that I followed: 1. Clone the latest source code of libvirt 2. Create a vm of f18 (source:liveCD) 3. Edit f18 domain xml and add this: <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/> <target type='virtio' name='org.qemu.guest_agent.0'/> </channel> 4. On host: #./tools/virsh start f18 5. On guest: #yum install qemu-guest-agent -y 6. On host: # ./tools/virsh qemu-agent-command f18 '{"execute":"guest-network-get-interfaces"}' Expected Response: {"return":[{"name":"lo","ip- addresses":[{"ip-address-type":"ipv4","ip-address":"127.0.0.1","prefix":8},{"ip-address-type":"ipv6","ip-address":"::1","prefix":128}],"hardware-address":"00:00:00:00:00:00"},{"name":"eth0","ip-addresses":[{"ip-address-type":"ipv4","ip-address":"192.168.122.62","prefix":24},{"ip-address-type":"ipv6","ip-address":"fe80::5054:ff:fe14:9998","prefix":64}],"hardware-address":"52:54:00:14:99:98"}]} Actual result: error: unknown procedure: 3 Where am I going wrong? -- Nehal J. Wani UG2, BTech CS+MS(CL) IIIT-Hyderabad http://commanlinewani.blogspot.com

On 17/06/13 14:00, Nehal J. Wani wrote:
Could anyone please list out the steps required to run the command $virsh qemu-agent-command
Steps that I followed:
1. Clone the latest source code of libvirt 2. Create a vm of f18 (source:liveCD) 3. Edit f18 domain xml and add this:
<channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/> <target type='virtio' name='org.qemu.guest_agent.0'/> </channel>
4. On host: #./tools/virsh start f18 5. On guest: #yum install qemu-guest-agent -y 6. On host: # ./tools/virsh qemu-agent-command f18 '{"execute":"guest-network-get-interfaces"}'
Expected Response:
{"return":[{"name":"lo","ip- addresses":[{"ip-address-type":"ipv4","ip-address":"127.0.0.1","prefix":8},{"ip-address-type":"ipv6","ip-address":"::1","prefix":128}],"hardware-address":"00:00:00:00:00:00"},{"name":"eth0","ip-addresses":[{"ip-address-type":"ipv4","ip-address":"192.168.122.62","prefix":24},{"ip-address-type":"ipv6","ip-address":"fe80::5054:ff:fe14:9998","prefix":64}],"hardware-address":"52:54:00:14:99:98"}]}
Actual result: error: unknown procedure: 3
What's your running libvirtd's version? It sounds like it's old enough without the API used by "qemu-guest-agent". Osier

The error: # ./tools/virsh qemu-agent-command f18 '{"execute":"guest-network-get-interfaces"}' "error: unknown procedure: 3" Comes when I clone from $git clone git://libvirt.org/libvirt.git But when I download http://libvirt.org/sources/libvirt-1.0.6.tar.gz and make, I get: # ./tools/virsh qemu-agent-command f18 '{"execute":"guest-network-get-interfaces"}' (null) On 6/17/13, Osier Yang <jyang@redhat.com> wrote:
On 17/06/13 14:00, Nehal J. Wani wrote:
Could anyone please list out the steps required to run the command $virsh qemu-agent-command
Steps that I followed:
1. Clone the latest source code of libvirt 2. Create a vm of f18 (source:liveCD) 3. Edit f18 domain xml and add this:
<channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/> <target type='virtio' name='org.qemu.guest_agent.0'/> </channel>
4. On host: #./tools/virsh start f18 5. On guest: #yum install qemu-guest-agent -y 6. On host: # ./tools/virsh qemu-agent-command f18 '{"execute":"guest-network-get-interfaces"}'
Expected Response:
{"return":[{"name":"lo","ip- addresses":[{"ip-address-type":"ipv4","ip-address":"127.0.0.1","prefix":8},{"ip-address-type":"ipv6","ip-address":"::1","prefix":128}],"hardware-address":"00:00:00:00:00:00"},{"name":"eth0","ip-addresses":[{"ip-address-type":"ipv4","ip-address":"192.168.122.62","prefix":24},{"ip-address-type":"ipv6","ip-address":"fe80::5054:ff:fe14:9998","prefix":64}],"hardware-address":"52:54:00:14:99:98"}]}
Actual result: error: unknown procedure: 3
What's your running libvirtd's version? It sounds like it's old enough without the API used by "qemu-guest-agent".
Osier
-- Nehal J. Wani UG2, BTech CS+MS(CL) IIIT-Hyderabad http://commanlinewani.blogspot.com

On 17.06.2013 09:21, Nehal J. Wani wrote:
The error: # ./tools/virsh qemu-agent-command f18 '{"execute":"guest-network-get-interfaces"}' "error: unknown procedure: 3"
Comes when I clone from $git clone git://libvirt.org/libvirt.git
But when I download http://libvirt.org/sources/libvirt-1.0.6.tar.gz and make, I get: # ./tools/virsh qemu-agent-command f18 '{"execute":"guest-network-get-interfaces"}' (null)
Unfortunately, the patch which dispatches errors from qemu-agent-command has been submitted after the 1.0.6 release: commit 0eb2f8aa90d26e75ce5d9449da03bb553da85d2d Author: Peter Krempa <pkrempa@redhat.com> AuthorDate: Mon Jun 3 16:12:52 2013 +0200 Commit: Peter Krempa <pkrempa@redhat.com> CommitDate: Mon Jun 3 17:25:33 2013 +0200 libvirt-qemu: Dispatch errors from virDomainQemuAgentCommand() The original implementation didn't follow the established pattern and did not dispatch errors in case of failure. So if you could try out building the libvirt from git and get the real error. Or if you want to use the 1.0.6 release, you'll find the error message in the libvirtd log. Michal

I was able to solve the error. It was a stupid mistake. There was a mismatch between versions of virsh and the libvirt daemon. On Mon, Jun 17, 2013 at 3:56 PM, Michal Privoznik <mprivozn@redhat.com>wrote:
On 17.06.2013 09:21, Nehal J. Wani wrote:
The error: # ./tools/virsh qemu-agent-command f18 '{"execute":"guest-network-get-interfaces"}' "error: unknown procedure: 3"
Comes when I clone from $git clone git://libvirt.org/libvirt.git
But when I download http://libvirt.org/sources/libvirt-1.0.6.tar.gz and make, I get: # ./tools/virsh qemu-agent-command f18 '{"execute":"guest-network-get-interfaces"}' (null)
Unfortunately, the patch which dispatches errors from qemu-agent-command has been submitted after the 1.0.6 release:
commit 0eb2f8aa90d26e75ce5d9449da03bb553da85d2d Author: Peter Krempa <pkrempa@redhat.com> AuthorDate: Mon Jun 3 16:12:52 2013 +0200 Commit: Peter Krempa <pkrempa@redhat.com> CommitDate: Mon Jun 3 17:25:33 2013 +0200
libvirt-qemu: Dispatch errors from virDomainQemuAgentCommand()
The original implementation didn't follow the established pattern and did not dispatch errors in case of failure.
So if you could try out building the libvirt from git and get the real error. Or if you want to use the 1.0.6 release, you'll find the error message in the libvirtd log.
Michal
-- Nehal J. Wani UG2, BTech CS+MS(CL) IIIT-Hyderabad http://commanlinewani.blogspot.com
participants (3)
-
Michal Privoznik
-
Nehal J. Wani
-
Osier Yang