From nobody Thu May 15 02:18:43 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 151724354476386.49942859356713; Mon, 29 Jan 2018 08:32:24 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 862F128209; Mon, 29 Jan 2018 16:32:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 102D260C90; Mon, 29 Jan 2018 16:32:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4E90E18033DC; Mon, 29 Jan 2018 16:32:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0TGWJUk012293 for ; Mon, 29 Jan 2018 11:32:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 821A860C90; Mon, 29 Jan 2018 16:32:19 +0000 (UTC) Received: from unknown54ee7586bd10.attlocal.net.com (ovpn-116-232.phx2.redhat.com [10.3.116.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40E4C60C82 for ; Mon, 29 Jan 2018 16:32:18 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Mon, 29 Jan 2018 11:32:00 -0500 Message-Id: <20180129163209.22424-3-jferlan@redhat.com> In-Reply-To: <20180129163209.22424-1-jferlan@redhat.com> References: <20180129163209.22424-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 02/11] qemu: Introduce qemuProcessHandleDumpCompleted X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 29 Jan 2018 16:32:23 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add data to qemuDomainJobObj in order to store the dump completion event information. Once the event has been received future code waiting on the event will be able to process the stats and error buffer. If there's no async job, we can just ignore. Signed-off-by: John Ferlan --- src/qemu/qemu_domain.c | 5 +++++ src/qemu/qemu_domain.h | 3 +++ src/qemu/qemu_process.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6b4bd3cca..d8b2b3067 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -334,6 +334,11 @@ qemuDomainObjResetAsyncJob(qemuDomainObjPrivatePtr pri= v) job->spiceMigration =3D false; job->spiceMigrated =3D false; job->postcopyEnabled =3D false; + job->dumpCompleted =3D false; + qemuMonitorEventDumpStatsFree(job->dumpCompletedStats); + job->dumpCompletedStats =3D NULL; + VIR_FREE(job->dumpCompletedError); + job->dumpCompletedError =3D NULL; VIR_FREE(job->current); } =20 diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index ddfc46dcd..7dab758fb 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -164,6 +164,9 @@ struct qemuDomainJobObj { * should wait for it to finish */ bool spiceMigrated; /* spice migration completed */ bool postcopyEnabled; /* post-copy migration was enabled= */ + bool dumpCompleted; /* dump completed */ + qemuMonitorDumpStatsPtr dumpCompletedStats; /* dump completion stats */ + char *dumpCompletedError; /* dump completion event error */ }; =20 typedef void (*qemuDomainCleanupCallback)(virQEMUDriverPtr driver, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 3a697de03..de43f6ac0 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1690,6 +1690,37 @@ qemuProcessHandleMigrationPass(qemuMonitorPtr mon AT= TRIBUTE_UNUSED, } =20 =20 +static int +qemuProcessHandleDumpCompleted(qemuMonitorPtr mon ATTRIBUTE_UNUSED, + virDomainObjPtr vm, + qemuMonitorDumpStatsPtr stats, + const char *error, + void *opaque ATTRIBUTE_UNUSED) +{ + qemuDomainObjPrivatePtr priv; + + virObjectLock(vm); + + VIR_DEBUG("Dump completed for domain %p %s with stats=3D%p error=3D'%s= '", + vm, vm->def->name, stats, NULLSTR(error)); + + priv =3D vm->privateData; + if (priv->job.asyncJob =3D=3D QEMU_ASYNC_JOB_NONE) { + VIR_DEBUG("got DUMP_COMPLETED event without a dump_completed job"); + goto cleanup; + } + priv->job.dumpCompleted =3D true; + VIR_STEAL_PTR(priv->job.dumpCompletedStats, stats); + ignore_value(VIR_STRDUP_QUIET(priv->job.dumpCompletedError, error)); + virDomainObjBroadcast(vm); + + cleanup: + qemuMonitorEventDumpStatsFree(stats); + virObjectUnlock(vm); + return 0; +} + + static qemuMonitorCallbacks monitorCallbacks =3D { .eofNotify =3D qemuProcessHandleMonitorEOF, .errorNotify =3D qemuProcessHandleMonitorError, @@ -1718,6 +1749,7 @@ static qemuMonitorCallbacks monitorCallbacks =3D { .domainMigrationPass =3D qemuProcessHandleMigrationPass, .domainAcpiOstInfo =3D qemuProcessHandleAcpiOstInfo, .domainBlockThreshold =3D qemuProcessHandleBlockThreshold, + .domainDumpCompleted =3D qemuProcessHandleDumpCompleted, }; =20 static void --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list