qmpclient-qga : build qga command

example of command:

first json is guest-sync to sync and flush the client, second json is the command

{ "execute": "guest-sync", "arguments": { "id": 123456 } }{"execute":"guest-ping"}

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2013-03-17 16:09:06 +01:00 committed by Dietmar Maurer
parent c6fb6a6978
commit a45a14fcf7

View File

@ -189,10 +189,27 @@ my $check_queue = sub {
delete $cmd->{arguments}->{fd};
}
my $qmpcmd = to_json({
execute => $cmd->{execute},
arguments => $cmd->{arguments},
id => $cmd->{id}});
my $qmpcmd = undef;
if($self->{qga}){
my $qmpcmdid =to_json({
execute => 'guest-sync',
arguments => { id => int($cmd->{id})}});
$qmpcmd = to_json({
execute => $cmd->{execute},
arguments => $cmd->{arguments}});
$qmpcmd = $qmpcmdid.$qmpcmd;
}else{
$qmpcmd = to_json({
execute => $cmd->{execute},
arguments => $cmd->{arguments},
id => $cmd->{id}});
}
if ($fd >= 0) {
my $ret = PVE::IPCC::sendfd(fileno($fh), $fd, $qmpcmd);