From nobody Mon Feb 9 05:40:00 2026 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559790127; cv=none; d=zoho.com; s=zohoarc; b=lmxRCQ8Kn6wBSPgqhEnO6vmaSfSS054mCuN3pliIK+6Y+ujLIvB0LvBbmfCEyhgMWeqhA/sHuaNXPxhemNcJzIYL+tdCOQ+N44iI+S+aksTpS9uHCaoGYoFKikm5PywmdoMYgA8du2YdWiUb/0c+rnv23i3+MlcoEsCLkalZYQ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559790127; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=SDIYRXod09Vamu/9plXC1w3VnIIF++lQRF8fVEfA31o=; b=AsbSLv5urtt6DnFz4zZqP4FVPUjgLOJ0QM9R1gfAxaZ2rDzIS/qBSfiNj0fRuioBUvmipAcffqOPSoeASKD99TP7Wa+iELSp4cecBQkGdle3vX5O+BuT8fyIvZe37ahaODSCxoeiup5jkayAk1/ljnUMWwwePsCX3vS3XkGTj5A= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1559790127700131.4197459141136; Wed, 5 Jun 2019 20:02:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A17BDC05001F; Thu, 6 Jun 2019 03:01:53 +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 5B17A620AF; Thu, 6 Jun 2019 03:01:42 +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 E4AF21806B11; Thu, 6 Jun 2019 03:01:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5631FKf013436 for ; Wed, 5 Jun 2019 23:01:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7550A2E026; Thu, 6 Jun 2019 03:01:15 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-85.phx2.redhat.com [10.3.116.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B0ED2E025; Thu, 6 Jun 2019 03:01:15 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Wed, 5 Jun 2019 22:01:10 -0500 Message-Id: <20190606030110.4457-5-eblake@redhat.com> In-Reply-To: <20190606030110.4457-1-eblake@redhat.com> References: <20190606030110.4457-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com Subject: [libvirt] [PATCH 4/4] backup: Add new parameters to qemu monitor nbd-server-add 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: , 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 06 Jun 2019 03:02:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The upcoming virDomainBackup() API needs to take advantage of the ability to expose a bitmap as part of nbd-server-add for a pull-mode backup (this is the recently-added QEMU_CAPS_NBD_BITMAP capability). Signed-off-by: Eric Blake --- src/qemu/qemu_monitor.h | 4 +++- src/qemu/qemu_monitor_json.h | 4 +++- src/qemu/qemu_migration.c | 2 +- src/qemu/qemu_monitor.c | 10 +++++++--- src/qemu/qemu_monitor_json.c | 7 ++++++- tests/qemumonitorjsontest.c | 2 +- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 30474c325d..482d51c41d 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1118,7 +1118,9 @@ int qemuMonitorNBDServerStart(qemuMonitorPtr mon, ATTRIBUTE_NONNULL(2); int qemuMonitorNBDServerAdd(qemuMonitorPtr mon, const char *deviceID, - bool writable); + const char *export, + bool writable, + const char *bitmap); int qemuMonitorNBDServerStop(qemuMonitorPtr); int qemuMonitorGetTPMModels(qemuMonitorPtr mon, char ***tpmmodels); diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 8f92e6de35..85d8f00fc0 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -463,7 +463,9 @@ int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon, const char *tls_alias); int qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon, const char *deviceID, - bool writable); + const char *export, + bool writable, + const char *bitmap); int qemuMonitorJSONNBDServerStop(qemuMonitorPtr mon); int qemuMonitorJSONGetTPMModels(qemuMonitorPtr mon, char ***tpmmodels) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 267a729c6f..a62cb668fe 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -424,7 +424,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver, goto exit_monitor; } - if (qemuMonitorNBDServerAdd(priv->mon, diskAlias, true) < 0) + if (qemuMonitorNBDServerAdd(priv->mon, diskAlias, NULL, true, NULL= ) < 0) goto exit_monitor; if (qemuDomainObjExitMonitor(driver, vm) < 0) goto cleanup; diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index a371f7d425..39df201eca 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3945,13 +3945,17 @@ qemuMonitorNBDServerStart(qemuMonitorPtr mon, int qemuMonitorNBDServerAdd(qemuMonitorPtr mon, const char *deviceID, - bool writable) + const char *export, + bool writable, + const char *bitmap) { - VIR_DEBUG("deviceID=3D%s", deviceID); + VIR_DEBUG("deviceID=3D%s, export=3D%s, bitmap=3D%s", deviceID, NULLSTR= (export), + NULLSTR(bitmap)); QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONNBDServerAdd(mon, deviceID, writable); + return qemuMonitorJSONNBDServerAdd(mon, deviceID, export, writable, + bitmap); } diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 41eef0c38c..6b66f6ef55 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6736,15 +6736,20 @@ qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon, int qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon, const char *deviceID, - bool writable) + const char *export, + bool writable, + const char *bitmap) { int ret =3D -1; virJSONValuePtr cmd; virJSONValuePtr reply =3D NULL; + /* Note: bitmap must be NULL if QEMU_CAPS_NBD_BITMAP is lacking */ if (!(cmd =3D qemuMonitorJSONMakeCommand("nbd-server-add", "s:device", deviceID, + "S:name", export, "b:writable", writable, + "S:bitmap", bitmap, NULL))) return ret; diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 9d707fcc7c..2a9e6cc75f 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1348,7 +1348,7 @@ GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "/fo= o/bar1", "/foo/bar2", "back GEN_TEST_FUNC(qemuMonitorJSONDrivePivot, "vdb") GEN_TEST_FUNC(qemuMonitorJSONScreendump, "devicename", 1, "/foo/bar") GEN_TEST_FUNC(qemuMonitorJSONOpenGraphics, "spice", "spicefd", false) -GEN_TEST_FUNC(qemuMonitorJSONNBDServerAdd, "vda", true) +GEN_TEST_FUNC(qemuMonitorJSONNBDServerAdd, "vda", NULL, true, NULL) GEN_TEST_FUNC(qemuMonitorJSONDetachCharDev, "serial1") GEN_TEST_FUNC(qemuMonitorJSONBlockdevTrayOpen, "foodev", true) GEN_TEST_FUNC(qemuMonitorJSONBlockdevTrayClose, "foodev") --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list