Commit Graph

47 Commits

Author SHA1 Message Date
Fiona Ebner
b0d1a00a24 QMP client: increase default timeout for drive-mirror to 10 minutes
like for other block operations.

Reported in the community forum:
https://forum.proxmox.com/threads/141238/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2024-03-08 14:35:16 +01:00
Fiona Ebner
5674d19810 remove left-over mentions of to-be-dropped, outdated QMP commands
The commands snapshot-drive and delete-drive-snapshot have been unused
by qemu-server since commit eba2b721 ("use qemu's blockdev-snapshot
functions") and are now going to be dropped in our QEMU builds too, so
get rid of these left-overs.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-06-07 19:36:45 +02:00
Fiona Ebner
7bd9abd243 tree-wide: switch to official spelling of QEMU in descriptions/messages
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-12-20 10:26:41 +01:00
Thomas Lamprecht
8174a894f1 qmp client: increase default fallback timeout to 5s
allowing slower or overloaded systems a higher chance to finish
commands while not being to long to be problematic for sync api calls
with their 30s total budget

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-09-16 13:01:45 +02:00
Fiona Ebner
50164179db qmp client: increase guest fstrim timeout to 10 minutes
like for other drive-related operations. The default of 3 seconds is
just not enough for large (or slow) disks.

Reported in the community forum:
https://forum.proxmox.com/threads/49543/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-08-19 09:40:04 +02:00
Thomas Lamprecht
46336bd283 qmp client: fix indendation of timeout checks
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-14 09:24:21 +02:00
Fabian Ebner
d11391ff30 qmp client: increase timeout for thaw
Using a loop of freeze, sleep 5, thaw, sleep 5, an idling Windows 11
VM with 4 cores and 8GiB RAM once took 54 seconds for thawing. It took
less than a second about 90% of the time and maximum of a few seconds
for the majortiy of other cases, but there can be outliers where 10
seconds is not enough.

And there can be hookscripts executed upon thaw, which might also not
complete instantly.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-03-03 12:12:14 +01:00
Thomas Lamprecht
f7d1505b0c tree wide cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-16 18:03:32 +02:00
Thomas Lamprecht
d1c1af4b02 tree wide cleanup of s/return undef/return/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-16 16:20:05 +02:00
Kamil Trzcinski
148850f693 Append newline to all QGA commands
Since the MacOS Mojave Apple ships AppleQEMUGuestAgent by default.
However, it does not fully adhere to QGA specs as they do expect each
command to be newline delimited.

This makes each command to be newline delimited which is harmless for
all other systems (Windows, Linux), but enable guest agent by default
without any changes on OSX.

Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2020-03-11 11:11:45 +01:00
Stefan Reiter
d036e418a8 refactor: create QemuServer::Helpers and move file/dir code
Also remove unused $confdir variable in QemuConfig, but leave it and
$lock_dir there, since those paths should only be used with
cfs_config_path anyway.

nodename() is still called in multiple places, but since it's cached by
INotify it doesn't really matter.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2019-11-20 16:29:23 +01:00
Wolfgang Bumiller
56afd466dd QMPClient: add destructor
Explicitly close leftover connections in the destructor,
otherwise the IO::Multiplex instance can be leaked causing
the qmp connection to never be closed.

This could occur for instance when cancelling vzdump with
ctrl+c with extremely unlucky timing...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-10-30 10:36:51 +01:00
Thomas Lamprecht
7c2d9b4089 [no-change] sort and group module use
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-29 15:59:10 +01:00
Thomas Lamprecht
7167d3bde2 QMPClient is no executable
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-23 15:41:36 +02:00
Aaron Lauterer
a022e3fdab tree-wide trailing whitespace cleanup
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2019-09-25 16:55:53 +02:00
Wolfgang Bumiller
eba2b72199 use qemu's blockdev-snapshot functions
Instead of our own. The code is almost the same, but the
upstream implementation uses qemu's transactional system and
performs a drain() on the block device first. This seems to
help avoid some issues we run into with qcow2 files when
creating snapshots.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-09-24 11:12:34 +02:00
Dominik Csapak
1928c20188 return error from guest-agent
in case of e.g. a non-existant guest-agent command, it would return
{ error: {someerrorobject} }
but we did only include the 'return' property

in case we do not get any and the error property is set,
return that

i looked at all the paths were we use the QMPClient, and either
we have our own callback for the result,
or we do not rely on the result being empty upon an error, so this
should not break anything

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-02-20 09:56:59 +01:00
Alexandre Derumier
a9e7997eb3 qmpclient : block-job-(complete|cancel) : set timeout to 10min
like query-block-jobs.

qmp socket can be busy when block job are running

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00
Thomas Lamprecht
cfb7a70165 increase timeout from guest-fsfreeze-freeze
The qmp command 'guest-fsfreeze-freeze' issues in linux a FIFREEZE
ioctl call on all mounted guest FS.
This ioctl call locks the filesystem and gets it into an consistent
state. For this all caches must be synced after blocking new writes
to the FS, which may need a relative long time, especially under high
IO load on the backing storage.

In windows a VSS (Volume Shadow Copy Service) request_freeze will
issued. As of the closed Windows nature the exact mechanisms cannot
be checked but some microsoft blog posts and other forum post suggest
that it should return fast but certain workloads can still trigger a
long delay resulting an similar problems.

Thus try to minimize the error probability and increase the timeout
significantly.
We use 60 minutes as timeout as this seems a limit which should not
get trespassed in a somewhat healthy system.

See:
https://forum.proxmox.com/threads/22192/

see the 'freeze_super' and 'thaw_super' function in fs/super.c from
the linux kernel tree for more details on the freeze behavior in
Linux guests.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-11-30 06:09:46 +01:00
Dietmar Maurer
5cb6fe54d8 qmpclient: use guest-sync-delimited 2014-12-02 13:09:53 +01:00
Dietmar Maurer
edb52f14a5 qmpclient: fix mux_input regex 2014-12-01 09:50:12 +01:00
Dietmar Maurer
c8125172c7 qmpclient: improve error handling 2014-12-01 09:50:12 +01:00
Dietmar Maurer
7a6c215042 qmpclient: code cleanup, execute qga and qmp in parallel 2014-12-01 09:50:12 +01:00
Wolfgang Link
1c0c1c17b0 shutdown by Qemu Guest Agent if the agent flag in the config is set
Important: "guest-shutdown" returns only by error a message.

Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>
2014-12-01 09:50:12 +01:00
Wolfgang Link
c5a07de5af qmpclient: now if the QMP command starts with guest-+ , it will bind dynamicly to the VMID.qga socket
Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>
2014-12-01 09:50:12 +01:00
Alexandre Derumier
bcfbc40b39 qmpclient-qga : mux_input : parse qga result
result sample:

first json is guest-sync result, second json is command result

{ "return": 123456}\n{"return": {}}

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2014-12-01 09:50:12 +01:00
Alexandre Derumier
a45a14fcf7 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>
2014-12-01 09:50:12 +01:00
Alexandre Derumier
c6fb6a6978 qmpclient-qga : do not sent qmp_capabilities for qga
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-12-01 09:50:12 +01:00
Alexandre Derumier
b1d8a6d44b qmpclient-qga : cmdid : use integer instead string
qga client use only integer as id

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-12-01 09:50:12 +01:00
Alexandre Derumier
f1f36aca43 qmpclient-qga : add qga param to qmp_socket
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-12-01 09:50:12 +01:00
Alexandre Derumier
d64ee87e73 qmpclient-qga : add qga option at object creation
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2014-12-01 09:50:11 +01:00
Dietmar Maurer
990fc5e22e use warnings instead of global -w flag 2013-10-01 13:14:49 +02:00
Dietmar Maurer
4fca015325 set long timeout for query-block-jobs
Like we do for other block job query commands. Seems those commands
can hangs for some time.
2013-05-06 09:25:39 +02:00
Dietmar Maurer
b006e70b68 avoid endless loop in QMPClient 2013-04-18 10:34:44 +02:00
Dietmar Maurer
f4fde4d376 do not delete unmatched content from $$input 2013-04-18 08:26:23 +02:00
Dietmar Maurer
fc97ae2788 fix backup-cancel timeout 2013-03-01 10:59:19 +01:00
Dietmar Maurer
a0e7a5d00d also support getfd 2012-12-06 09:01:56 +01:00
Dietmar Maurer
558f16446e add support for add-fd command
We can now pass open file descriptors to qemu.
2012-12-06 08:39:03 +01:00
Dietmar Maurer
b3ea07f71e fix memory leak in QMP Client (many thanks to Stefan!) 2012-10-29 12:15:43 +01:00
Dietmar Maurer
6d04217600 pass timeout to qmp open_connection 2012-09-25 09:27:24 +02:00
Dietmar Maurer
9dcf4909f0 updates for async shapshot patch 2012-09-24 10:43:19 +02:00
Dietmar Maurer
9d6890772d use long timeouts for snapshot monitor command
Internal snapshots should be fast, but there is not guarantee.
2012-09-12 13:32:12 +02:00
Dietmar Maurer
2ae10d4e22 fix bug 247: retry qmp open 2012-08-27 13:43:30 +02:00
Dietmar Maurer
14db53662a set default qmp timout to 3 seconds
And allow to pass timeout paramater to vm_qmp_command().
2012-08-27 13:13:36 +02:00
Dietmar Maurer
f0002f62f1 fix command timeout 2012-07-13 12:36:40 +02:00
Dietmar Maurer
26f11676c7 use new QMPClient code 2012-07-13 07:21:34 +02:00
Dietmar Maurer
30a3378acd add PVE::QMPClient.pm
This is experimental code, not used currently.
2012-07-12 12:28:27 +02:00