From nobody Sun Feb 8 19:57:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1662639208; cv=none; d=zohomail.com; s=zohoarc; b=SqHFCfPCtlTIdRU2uc3GGjKAXbBnGHaTg+jlEx3WbkhN8bEVsJuEpD4asUVw0TJKZRCnv3rO3E1gsmduNE8f7VS5TJWV/84wah6a9DvXoNShaRJTfqEX8w//ycrkLEVlDp06kzkRiFBa+6MVR4MzqBaWy7j9BvwNXtoi05jmIss= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662639208; h=Content-Type:Content-Transfer-Encoding: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; bh=67mZdmYs/hN4k9EuasQZ/rkGCnhRIQG04zBg2tLMPhs=; b=HLZExkQR+U76jPfI46GJ6QFohoUuG7gYm0J8uBjWjw/uJHLHaHNWiXdkqqyhz/KrV1HkJlermiJTxQPymawh9uQueO1cH1ZQL+wFkIuC5HySIZ46ELJW/ihetLoBcwBv3Kjf2M4WsZEy81dOBm70MA2p6svEa+I2Hxnpa9fFV+s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1662639208038465.58128765389904; Thu, 8 Sep 2022 05:13:28 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-588-UqSiQHqJPLuJ-vXHU1IWDQ-1; Thu, 08 Sep 2022 08:13:23 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0EA2E85A597; Thu, 8 Sep 2022 12:13:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF72A492C3B; Thu, 8 Sep 2022 12:13:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DC3861946A48; Thu, 8 Sep 2022 12:13:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 635471946A44 for ; Thu, 8 Sep 2022 12:13:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 558B72166B29; Thu, 8 Sep 2022 12:13:18 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0C1E2166B26 for ; Thu, 8 Sep 2022 12:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662639207; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=67mZdmYs/hN4k9EuasQZ/rkGCnhRIQG04zBg2tLMPhs=; b=fNLuDQD5RzzsEk4uVFc7l89XXXNwoVM4Qa9GZ40xlHOzdK4358t4DVPd5fFXdrjDVSvRMP scVmZvgijJ0L+nn3YnpIpk3QIsC/1g12F3c9eIOan3n2ZTKCS62W5Auw+p+qrTR5E1WIWW BD5OuhD21B5Sm9EafsUpoecPD1DDFr0= X-MC-Unique: UqSiQHqJPLuJ-vXHU1IWDQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/8] qemu: migration: Remove QEMU_MONITOR_MIGRATE_BACKGROUND Date: Thu, 8 Sep 2022 14:13:07 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1662639209266100002 Content-Type: text/plain; charset="utf-8" 'qemuMonitorJSONMigrate' is called from: - qemuMonitorMigrateToHost - qemuMonitorMigrateToSocket Both of the above function are called only from qemuMigrationSrcStart. - qemuMonitorMigrateToFd - called from: - qemuMigrationSrcToFile Both instances here pass QEMU_MONITOR_MIGRATE_BACKGROUND directly. - qemuMigrationSrcStart qemuMigrationSrcStart is then called from qemuMigrationSrcRun and qemuMigrationSrcResume, both of which always add QEMU_MONITOR_MIGRATE_BACKG= ROUND to the flags. Thus any caller always passes the flag so that we can remove the flag altogether. Signed-off-by: Peter Krempa --- src/qemu/qemu_migration.c | 15 ++++----------- src/qemu/qemu_monitor.h | 1 - src/qemu/qemu_monitor_json.c | 3 +-- tests/qemumonitorjsontest.c | 2 +- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 7dc593d49f..c63b00c922 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4678,7 +4678,6 @@ qemuMigrationSrcRun(virQEMUDriver *driver, const char *nbdURI) { int ret =3D -1; - unsigned int migrate_flags =3D QEMU_MONITOR_MIGRATE_BACKGROUND; qemuDomainObjPrivate *priv =3D vm->privateData; g_autoptr(qemuMigrationCookie) mig =3D NULL; g_autofree char *tlsAlias =3D NULL; @@ -4867,7 +4866,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, goto exit_monitor; } - rc =3D qemuMigrationSrcStart(vm, spec, migrate_flags, &fd); + rc =3D qemuMigrationSrcStart(vm, spec, 0, &fd); qemuDomainObjExitMonitor(vm); if (rc < 0) @@ -5033,8 +5032,6 @@ qemuMigrationSrcResume(virDomainObj *vm, qemuDomainObjPrivate *priv =3D vm->privateData; virQEMUDriver *driver =3D priv->driver; g_autoptr(qemuMigrationCookie) mig =3D NULL; - unsigned int migrateFlags =3D QEMU_MONITOR_MIGRATE_BACKGROUND | - QEMU_MONITOR_MIGRATE_RESUME; int rc; VIR_DEBUG("vm=3D%p", vm); @@ -5053,7 +5050,7 @@ qemuMigrationSrcResume(virDomainObj *vm, VIR_ASYNC_JOB_MIGRATION_OUT) < 0) return -1; - rc =3D qemuMigrationSrcStart(vm, spec, migrateFlags, NULL); + rc =3D qemuMigrationSrcStart(vm, spec, QEMU_MONITOR_MIGRATE_RESUME, NU= LL); qemuDomainObjExitMonitor(vm); if (rc < 0) @@ -6902,9 +6899,7 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, virDoma= inObj *vm, goto cleanup; if (!compressor) { - rc =3D qemuMonitorMigrateToFd(priv->mon, - QEMU_MONITOR_MIGRATE_BACKGROUND, - fd); + rc =3D qemuMonitorMigrateToFd(priv->mon, 0, fd); } else { virCommandSetInputFD(compressor, pipeFD[0]); virCommandSetOutputFD(compressor, &fd); @@ -6920,9 +6915,7 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, virDoma= inObj *vm, qemuDomainObjExitMonitor(vm); goto cleanup; } - rc =3D qemuMonitorMigrateToFd(priv->mon, - QEMU_MONITOR_MIGRATE_BACKGROUND, - pipeFD[1]); + rc =3D qemuMonitorMigrateToFd(priv->mon, 0, pipeFD[1]); if (VIR_CLOSE(pipeFD[0]) < 0 || VIR_CLOSE(pipeFD[1]) < 0) VIR_WARN("failed to close intermediate pipe"); diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 53ea26c58a..c256e0f5ba 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -825,7 +825,6 @@ int qemuMonitorGetSEVCapabilities(qemuMonitor *mon, virSEVCapability **capabilities); typedef enum { - QEMU_MONITOR_MIGRATE_BACKGROUND =3D 1 << 0, QEMU_MONITOR_MIGRATE_RESUME =3D 1 << 3, /* resume failed post-= copy migration */ QEMU_MONITOR_MIGRATION_FLAGS_LAST } QEMU_MONITOR_MIGRATE; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index bf22cc64f8..031238665f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -3109,10 +3109,9 @@ int qemuMonitorJSONMigrate(qemuMonitor *mon, unsigned int flags, const char *uri) { - bool detach =3D !!(flags & QEMU_MONITOR_MIGRATE_BACKGROUND); bool resume =3D !!(flags & QEMU_MONITOR_MIGRATE_RESUME); g_autoptr(virJSONValue) cmd =3D qemuMonitorJSONMakeCommand("migrate", - "b:detach", d= etach, + "b:detach", t= rue, "b:resume", r= esume, "s:uri", uri, NULL); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index fa5455e513..238c6c1813 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1201,7 +1201,7 @@ GEN_TEST_FUNC(qemuMonitorJSONExpirePassword, "spice",= "123456") GEN_TEST_FUNC(qemuMonitorJSONSetBalloon, 1024) GEN_TEST_FUNC(qemuMonitorJSONSaveVirtualMemory, 0, 1024, "/foo/bar") GEN_TEST_FUNC(qemuMonitorJSONSavePhysicalMemory, 0, 1024, "/foo/bar") -GEN_TEST_FUNC(qemuMonitorJSONMigrate, QEMU_MONITOR_MIGRATE_BACKGROUND, "tc= p:localhost:12345") +GEN_TEST_FUNC(qemuMonitorJSONMigrate, 0, "tcp:localhost:12345") GEN_TEST_FUNC(qemuMonitorJSONMigrateRecover, "tcp://destination.host:54321= "); GEN_TEST_FUNC(qemuMonitorJSONDump, "dummy_protocol", "elf", true) --=20 2.37.1