From: Philipp Hahn <hahn@univention.de>
To: libvir-list@redhat.com, qemu-devel <qemu-devel@nongnu.org>
Cc: Jiri Denemark <jdenemar@redhat.com>,
Orit Wasserman <owasserm@redhat.com>
Subject: Re: [Qemu-devel] [libvirt] [PATCH v2 3/8] Add support for fetching statistics of completed jobs
Date: Mon, 9 May 2016 12:59:33 +0200 [thread overview]
Message-ID: <57306D95.2080503@univention.de> (raw)
In-Reply-To: <ef223fe1d6fb252009ecdb278260cd9b938b4f9d.1410256286.git.jdenemar@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2536 bytes --]
Hi,
FYI as tracking down that failure did cost me some time and hopefully
this summary will help other to avoid this situation:
Am 09.09.2014 um 11:54 schrieb Jiri Denemark:
> virDomainGetJobStats gains new VIR_DOMAIN_JOB_STATS_COMPLETED flag that
> can be used to fetch statistics of a completed job rather than a
> currently running job.
>
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
...
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -2500,7 +2500,8 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply,
...
> - if (status->status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE) {
> + if (status->status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE ||
> + status->status == QEMU_MONITOR_MIGRATION_STATUS_COMPLETED) {
> virJSONValuePtr ram = virJSONValueObjectGet(ret, "ram");
> if (!ram) {
> virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> _("migration was active, but RAM 'transferred' "
> "data was missing"));
This change from libvirt v1.2.9-rc1~203 breaks migration with
qemu-kvm-1.1.2, as that ancient implementation does *not* export
transfer statistics for completed jobs:
> qemuMonitorJSONCommandWithFd:286 : Send command '{"execute":"query-migrate","id":"libvirt-41"}' for write with FD -1
> qemuMonitorJSONIOProcessLine:179 : Line [{"return": {"status": "active", "ram": {"total": 2164654080, "remaining": 22474752, "transferred": 175117413}}, "id": "libvirt-41"}]
...
> qemuMonitorJSONCommandWithFd:286 : Send command '{"execute":"query-migrate","id":"libvirt-42"}' for write with FD -1
> qemuMonitorJSONIOProcessLine:179 : Line [{"return": {"status": "completed"}, "id": "libvirt-42"}]
As you can see, there is not "ram" section and the migration is aborted
with the message:
> internal error: migration was active, but no RAM info was set
qemu-kvm/qmp-commands.hx even states this:
> - "ram": only present if "status" is "active", it is a json-object with the
> following RAM information (in bytes):
but the example some lines below is wrong:
> 2. Migration is done and has succeeded
>
> -> { "execute": "query-migrate" }
> <- { "return": {
> "status": "completed",
> "ram":{
That example has been updated by v1.2.0-rc0~29^2~2, but forgot to update
the specification above.
The attached hack for libvirt makes migration work again for me by
making "ram" optional in case of "completed".
Philipp
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Bug-40318-libvirt-Handle-qemu-kvm-1.1.2-migration-in.patch --]
[-- Type: text/x-diff; name="0001-Bug-40318-libvirt-Handle-qemu-kvm-1.1.2-migration-in.patch", Size: 3045 bytes --]
From c4f6dfb25042f420fdd1728865686552d928d90e Mon Sep 17 00:00:00 2001
Message-Id: <c4f6dfb25042f420fdd1728865686552d928d90e.1462786017.git.hahn@univention.de>
From: Philipp Hahn <hahn@univention.de>
Date: Mon, 9 May 2016 10:52:09 +0200
Subject: [PATCH] Bug #40318 libvirt: Handle qemu-kvm-1.1.2 migration
incompatibility
Organization: Univention GmbH, Bremen, Germany
To: libvir-list@redhat.com
The change from libvirt v1.2.9-rc1~203 breaks migration with qemu-kvm-1.1.2, as
that ancient implementation does *not* export transfer statistics for completed
jobs:
> qemuMonitorJSONCommandWithFd:286 : Send command '{"execute":"query-migrate","id":"libvirt-41"}' for write with FD -1
> qemuMonitorJSONIOProcessLine:179 : Line [{"return": {"status": "active", "ram": {"total": 2164654080, "remaining": 22474752, "transferred": 175117413}}, "id": "libvirt-41"}]
...
> qemuMonitorJSONCommandWithFd:286 : Send command '{"execute":"query-migrate","id":"libvirt-42"}' for write with FD -1
> qemuMonitorJSONIOProcessLine:179 : Line [{"return": {"status": "completed"}, "id": "libvirt-42"}]
As you can see, there is not "ram" section and the migration is aborted with
the message:
> internal error: migration was active, but no RAM info was set
qemu-kvm/qmp-commands.hx even states this:
> - "ram": only present if "status" is "active", it is a json-object with the
> following RAM information (in bytes):
but the example some lines below is wrong:
> 2. Migration is done and has succeeded
>
> -> { "execute": "query-migrate" }
> <- { "return": {
> "status": "completed",
> "ram":{
That example has been updated by v1.2.0-rc0~29^2~2, but forgot to update the
specification above.
---
src/qemu/qemu_monitor_json.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index a62c02f..d3b7b90 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -2483,8 +2483,11 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply,
if (!ram) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("migration was active, but no RAM info was set"));
+ if (status->status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE) {
+ // qemu-kvm-1.1.2 does NOT report 'ram':{...} on complete
return -1;
- }
+ }
+ } else {
if (virJSONValueObjectGetNumberUlong(ram, "transferred",
&status->ram_transferred) < 0) {
@@ -2514,6 +2517,7 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply,
virJSONValueObjectGetNumberUlong(ram, "normal", &status->ram_normal);
virJSONValueObjectGetNumberUlong(ram, "normal-bytes",
&status->ram_normal_bytes);
+ }
virJSONValuePtr disk = virJSONValueObjectGet(ret, "disk");
if (disk) {
--
2.1.4
parent reply other threads:[~2016-05-09 10:59 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <ef223fe1d6fb252009ecdb278260cd9b938b4f9d.1410256286.git.jdenemar@redhat.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57306D95.2080503@univention.de \
--to=hahn@univention.de \
--cc=jdenemar@redhat.com \
--cc=libvir-list@redhat.com \
--cc=owasserm@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.