From nobody Sat Nov 23 17:39:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1723160706; cv=none; d=zohomail.com; s=zohoarc; b=YEXbQtjp3igAUw1udt2j8yMhHMYqZzPiQxIfYCvN2d/Gl9F616gzg5mh6DUfetXNFQETOV5GJ7JnpsWMVLDWkpEPCaID0bqUdxjY5iTwu3rTjE760AWNQnb46/K8gLndQnYTAyh3t0LRm3II26Y4V6cOBX7sNexWvVCiBdjSpTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723160706; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=Ok+FUxTw6tZsmTVitpw4vtpH1fzwpe4GGRfeeVXMxAA=; b=E654HRR2VL/uMrspZVRn+G9FiMlsB2gIjAAsqGhQn7825xm5bZXxvVMS338vf5T5RC43lmr9RUqneOclvLbkI7qUSBlfHVF9HcllYzI9zVo0l/VPGw3PcdVQ/SWzSssu35EfngSlrLc8KdveBIdgfJJ36A8zCt7nH3r38zBM6u0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1723160706886361.0829019050493; Thu, 8 Aug 2024 16:45:06 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 75139140C; Thu, 8 Aug 2024 19:45:05 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 5E05B1507; Thu, 8 Aug 2024 19:39:13 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 37A6F141E; Thu, 8 Aug 2024 19:39:07 -0400 (EDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 9B93814A5 for ; Thu, 8 Aug 2024 19:38:45 -0400 (EDT) Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2f15dd0b489so18894681fa.3 for ; Thu, 08 Aug 2024 16:38:45 -0700 (PDT) Received: from localhost ([69.51.98.127]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-8223b10421dsm222801339f.12.2024.08.08.16.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:38:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1723160324; x=1723765124; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y9R/FCOn0fE1pvXFcvR3M6BWh/AnH1nQObE/+b3tKck=; b=Gkj6vZYpWofP/qdiyanjZ21AxisxvTqu8aUv272e/ShmzWEmqQjGkCxsvdEHN5SNiz zgV51YulH2S9a5ByQprVDCICe2pk3l7XdqB1FDUbBJW5aCupvm5DVRlx4qxAKsdKD5iY GNHWKBGg8adDDZc9nTEC1pLTqM7wIsYB2dnWQZfMef3I78u/wUgXXbL1itY6zRRfrIUx A3JZXVFnxle+71we/e0zrl5a0DZ9r7Won/84V6cOImVvetNewha4JdsmmUorlZiwQaZE 9FXi5enDYzM4PMgmjAWj8Oo0h8Es1jkmO4L/86NnuG0x+LPD4vtSGOPId/uzKNr4w2lI gmjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723160324; x=1723765124; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y9R/FCOn0fE1pvXFcvR3M6BWh/AnH1nQObE/+b3tKck=; b=e6WVlJihkqKDdf0nToy9O0hx0MVV6QiDx74d1fWyfdkjKUCIX7cU9sPQxMzOinBEcl oNvpR7nYyHFXlSA5QsRMcvs1OQ1LzDIChAHQQPaBRa4h7FBJSfLy+18m+pvWlKr9m6So dJ7osZKztYgO1wSbfWRkk+1qBiMXiiVmk8ssYTv/opvhG1m61MBznB+DaS4ji6UB+v3U O/ANVdVjB4ChT8fUjy2qMxk0/7uwKt8Gjbx1Qao+92o9hgdMjNtpUxsns6PKN0zqmTPw 2khlKyHEaJemChGDXGgOT0plnpQIvk0jq88BNAscu4ski4GGy6JFHeXg/ClYuCvN3W7F JxPw== X-Gm-Message-State: AOJu0YxgS3oR/NP+t3QTWBf1OAlAIYT8ZbAZ6nGdozRknUX4NUHlA36s FtDrIaNTCvoq5PgjJ5VHz1DyYzohRE1NpB5/Sr42CtJ0qUyKQ4UzErngfDcNfcfG/Vnouwxn0zj 5 X-Google-Smtp-Source: AGHT+IFfd2yTs+k8n02tJL9+cL3oKx6zTlihB1ONa0lSh78EGb6nAIfknnADvbU40SI3JhAn7JKm+g== X-Received: by 2002:a2e:9b0c:0:b0:2f1:9248:c325 with SMTP id 38308e7fff4ca-2f19de603c0mr20370301fa.31.1723160324171; Thu, 08 Aug 2024 16:38:44 -0700 (PDT) To: devel@lists.libvirt.org Subject: [PATCH 13/20] qemu: Apply migration parameters in qemuMigrationDstRun Date: Thu, 8 Aug 2024 17:38:06 -0600 Message-Id: <20240808233813.22905-14-jfehlig@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240808233813.22905-1-jfehlig@suse.com> References: <20240808233813.22905-1-jfehlig@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: MPAXBZYWL2ICCUI5ACKZ6Q4MMNMW5RBN X-Message-ID-Hash: MPAXBZYWL2ICCUI5ACKZ6Q4MMNMW5RBN X-MailFrom: jfehlig@suse.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: farosas@suse.de X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Jim Fehlig via Devel Reply-To: Jim Fehlig X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1723160707727116600 Content-Type: text/plain; charset="utf-8" Similar to qemuMigrationSrcRun, apply migration parameters in qemuMigrationDstRun. This allows callers to create customized migration parameters, but delegates their application to the function performing the migration. Signed-off-by: Jim Fehlig --- src/qemu/qemu_migration.c | 15 +++++++++------ src/qemu/qemu_migration.h | 4 +++- src/qemu/qemu_process.c | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 3ab5e2fa30..fd897b4ed1 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2285,13 +2285,19 @@ qemuMigrationDstGetURI(const char *migrateFrom, int qemuMigrationDstRun(virDomainObj *vm, const char *uri, - virDomainAsyncJob asyncJob) + virDomainAsyncJob asyncJob, + qemuMigrationParams *migParams, + unsigned int flags) { qemuDomainObjPrivate *priv =3D vm->privateData; int rv; =20 VIR_DEBUG("Setting up incoming migration with URI %s", uri); =20 + if (migParams && qemuMigrationParamsApply(vm, asyncJob, + migParams, flags) < 0) + return -1; + if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0) return -1; =20 @@ -3207,10 +3213,6 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver, goto error; } =20 - if (qemuMigrationParamsApply(vm, VIR_ASYNC_JOB_MIGRATION_IN, - migParams, flags) < 0) - goto error; - if (mig->nbd && flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC)= ) { const char *nbdTLSAlias =3D NULL; @@ -3242,7 +3244,8 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver, } =20 if (qemuMigrationDstRun(vm, incoming->uri, - VIR_ASYNC_JOB_MIGRATION_IN) < 0) + VIR_ASYNC_JOB_MIGRATION_IN, + migParams, flags) < 0) goto error; =20 if (qemuProcessFinishStartup(driver, vm, VIR_ASYNC_JOB_MIGRATION_IN, diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index 039a926e69..5529f2ee21 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -281,7 +281,9 @@ qemuMigrationDstGetURI(const char *migrateFrom, int qemuMigrationDstRun(virDomainObj *vm, const char *uri, - virDomainAsyncJob asyncJob); + virDomainAsyncJob asyncJob, + qemuMigrationParams *migParams, + unsigned int flags); =20 void qemuMigrationSrcPostcopyFailed(virDomainObj *vm); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 7eeb85062c..1d7f214212 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8248,7 +8248,7 @@ qemuProcessStart(virConnectPtr conn, relabel =3D true; =20 if (incoming) { - if (qemuMigrationDstRun(vm, incoming->uri, asyncJob) < 0) + if (qemuMigrationDstRun(vm, incoming->uri, asyncJob, NULL, 0) < 0) goto stop; } else { /* Refresh state of devices from QEMU. During migration this happe= ns --=20 2.35.3