Commit Graph

32 Commits

Author SHA1 Message Date
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