On 22.08.2013 12:17, Praveen Kumar wrote:
> 
> 
> ----- Original Message -----
>> From: "Michal Privoznik" <[email protected]>
>> To: "Praveen Kumar" <[email protected]>
>> Cc: [email protected]
>> Sent: Thursday, August 22, 2013 1:15:54 PM
>> Subject: Re: [libvirt-users] QemuAgentCommand API documents
>>
>> The API you're looking for is the one you've found:
>> virDomainQemuAgentCommand. As the second argument it accepts qemu guest
>> agent commands described in [3]. I'd also recommend reading [4].
> 
> Thanks for command reference, I am able to figure out that along with 
> libvirt, 
> libvirt_qemu also need to import because it will contain QmenuAgentCommand() 
> function
> definition, but now I am confuse about the parameters. 
> 
> As per definition : def qemuAgentCommand(domain, cmd, timeout, flags), I 
> passed below parameteres:
> domain : A active virDomain object
> command : 'guest-info'
> timeout : 10
> flags : 0

You need to wrap the command into JSON envelope:

command: '{"execute": "guest-info"}'

just exactly as you need to do for virsh:

virsh qemu-agent-command $dom '{"execute":"guest-info"}'

Michal

_______________________________________________
libvirt-users mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvirt-users

Reply via email to