mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-29 15:24:32 +00:00
qm agent: remove 'guest-' prefix from commands
This commit is contained in:
parent
ee2ff074b1
commit
249d8fedd8
@ -2836,22 +2836,22 @@ __PACKAGE__->register_method({
|
|||||||
}});
|
}});
|
||||||
|
|
||||||
my $guest_agent_commands = [
|
my $guest_agent_commands = [
|
||||||
'guest-ping',
|
'ping',
|
||||||
'guest-get-time',
|
'get-time',
|
||||||
'guest-info',
|
'info',
|
||||||
'guest-fsfreeze-status',
|
'fsfreeze-status',
|
||||||
'guest-fsfreeze-freeze',
|
'fsfreeze-freeze',
|
||||||
'guest-fsfreeze-thaw',
|
'fsfreeze-thaw',
|
||||||
'guest-fstrim',
|
'fstrim',
|
||||||
'guest-network-get-interfaces',
|
'network-get-interfaces',
|
||||||
'guest-get-vcpus',
|
'get-vcpus',
|
||||||
'guest-get-fsinfo',
|
'get-fsinfo',
|
||||||
'guest-get-memory-blocks',
|
'get-memory-blocks',
|
||||||
'guest-get-memory-block-info',
|
'get-memory-block-info',
|
||||||
'guest-suspend-hybrid',
|
'suspend-hybrid',
|
||||||
'guest-suspend-ram',
|
'suspend-ram',
|
||||||
'guest-suspend-disk',
|
'suspend-disk',
|
||||||
'guest-shutdown',
|
'shutdown',
|
||||||
];
|
];
|
||||||
|
|
||||||
__PACKAGE__->register_method({
|
__PACKAGE__->register_method({
|
||||||
@ -2889,11 +2889,12 @@ property depends on the executed command.",
|
|||||||
|
|
||||||
my $conf = PVE::QemuConfig->load_config ($vmid); # check if VM exists
|
my $conf = PVE::QemuConfig->load_config ($vmid); # check if VM exists
|
||||||
|
|
||||||
die "Only qga commands are allowed\n" if $param->{command} !~ m/^guest-.*$/;
|
|
||||||
die "No Qemu Guest Agent\n" if !defined($conf->{agent});
|
die "No Qemu Guest Agent\n" if !defined($conf->{agent});
|
||||||
die "VM $vmid is not running\n" if !PVE::QemuServer::check_running($vmid);
|
die "VM $vmid is not running\n" if !PVE::QemuServer::check_running($vmid);
|
||||||
|
|
||||||
my $res = PVE::QemuServer::vm_mon_cmd($vmid, $param->{command});
|
my $cmd = $param->{command};
|
||||||
|
|
||||||
|
my $res = PVE::QemuServer::vm_mon_cmd($vmid, "guest-$cmd");
|
||||||
|
|
||||||
return { result => $res };
|
return { result => $res };
|
||||||
}});
|
}});
|
||||||
|
Loading…
Reference in New Issue
Block a user