From nobody Sat Nov 23 17:44:50 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=1723160495; cv=none; d=zohomail.com; s=zohoarc; b=Ec3sEb5m0XGDr+0NDoieb8vz6WDnDtPCOKSRbKBNjqimdvyYhJxvmiyUWIBfUwhWKaketos9ZBCBTPfhmp4xxIhjiR2D/44nec5wgvFQyZBhquV8GtYfBEH8/zBGH71G0SErTcry0w4HNYDRMGq181aDBZXz9uozJCRQDDG7FX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723160495; 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=lD2KHfHRcl8fCSyPgebLBrCpy+hZ4kPseJ8iTVkxWIQ=; b=mOMJK3zaeYrjsLenhCSrNjA98geTQBlZn+D6fPusZg98GlrXmRVkqs3P1scx5lDqCBSirTeW+3RYMO6JWgUpxpxebvxHosSMhBnyqFi911KPV/boQTPjxjxOXybgF1AHle0MrulQE0i3ulV/TIrLKubIFdIfhLF+Z8gogneMdgU= 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 1723160495180810.3965875668914; Thu, 8 Aug 2024 16:41:35 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1D48C14D1; Thu, 8 Aug 2024 19:41:34 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 690D01405; Thu, 8 Aug 2024 19:38:56 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E028813AA; Thu, 8 Aug 2024 19:38:49 -0400 (EDT) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 C6CB614B5 for ; Thu, 8 Aug 2024 19:38:29 -0400 (EDT) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-428f5c0833bso14721755e9.0 for ; Thu, 08 Aug 2024 16:38:29 -0700 (PDT) Received: from localhost ([69.51.98.127]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4c8d6a29236sm3760240173.113.2024.08.08.16.38.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:38:28 -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=1723160308; x=1723765108; 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=i46WZdZcA0BLPY2UCIYN0lEK9DYwBaU1czStBthu+VQ=; b=QpJtKgAWen3oXqvOLchcqCXXAzla+p/+iu2hx5oqHS2rPVqzqz+q9Vz8Pcersc/qyb hg60mc5xWFc4UNCwZVTqaO8TSdtphBtZS6nEPPMVVwUctuANsBmlbTZDjfCKD4WMRFuC 8t1d0DOFx5adenNMzEg0IrL8qirV+YPmpKWWzYfbkCDlVOt0JwrBF/Vb+eX7h4qQ2zjH pT2vBxhRWGs/J6q8BtoxUVeNdvoYBegjx7wV3DGuRYLjTBkPODB1nDbzRcj2NSmv4OXU cgZBF+RHbPF5jU34G8/9cjHHmh97hh+q8KCCSFRxVh4V68sBSzXqvO4gnr9FEHHuimcb M/Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723160308; x=1723765108; 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=i46WZdZcA0BLPY2UCIYN0lEK9DYwBaU1czStBthu+VQ=; b=iI0DEoqiZtkMFUTF9DMzfDVDP7zkZdHirAniFJ+vrSx26MFxjOskmb9B7g/TJcCdkc 83GgYZAuk782YeQ+mGqZD4Vgfw2JCvjHOAwn3Q3DtXtC+XROvU+puDyElv+QOcY3+j7q 2L9jQER01f6xccQqHGeRGKoprTf82Yt8VyLqNNNCR6/CShAbu6+24ALXnwNx3B9GfSmL I2KPW4aCOhaNDsHHjAguQwr+LxLKHAQdzBTsV8DscutCjRTHLMU0DNCYlU7wJWo1J/hy jTNXuwiasAKibB1jYMVWl8lC2F78+QTZ84axch4qrPAm9HDu1KlrtJ8XmnX1WeLqSJuq zN8A== X-Gm-Message-State: AOJu0YyMHf2zpkLETogiIWRu+1yw56j/pVsSe7FVcxhOJPexGYRvSOge NnasslkjUPMbPRllfofTRne7sf+vr+Q7tj+rusa5wHuQjZN2IGcauG2ZHw94mA1V8r4/qyG0l2S A X-Google-Smtp-Source: AGHT+IFaK2LaH419e9vvRIMhDCTNJnb1AyuV6vEXgncL71OAAGN1UkaVFrfEbPwriYnIoBY3c6Ub1Q== X-Received: by 2002:adf:efcc:0:b0:36b:5d86:d885 with SMTP id ffacd0b85a97d-36d281e5833mr2316470f8f.24.1723160308439; Thu, 08 Aug 2024 16:38:28 -0700 (PDT) To: devel@lists.libvirt.org Subject: [PATCH 06/20] qemu: Add function to get migration params for save Date: Thu, 8 Aug 2024 17:37:59 -0600 Message-Id: <20240808233813.22905-7-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: MPAS2YYQRVX4MEHNUMNMJSF2S62IQLPX X-Message-ID-Hash: MPAS2YYQRVX4MEHNUMNMJSF2S62IQLPX 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: 1723160496922116600 Content-Type: text/plain; charset="utf-8" Introduce qemuMigrationParamsForSave() to create a qemuMigrationParams object initialized with appropriate migration capabilities and parameters for a save operation. Note that mapped-ram capability also requires the multifd capability. For now, the number of multifd channels is set to 1. Future work to support parallel save/restore can set the number of channels to a user-specified value. Signed-off-by: Jim Fehlig Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_migration.c | 2 +- src/qemu/qemu_migration_params.c | 21 +++++++++++++++++++++ src/qemu/qemu_migration_params.h | 3 +++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4fd7a0aafb..c1bdaa273b 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -6965,7 +6965,7 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, virDoma= inObj *vm, =20 /* Increase migration bandwidth to unlimited since target is a file. * Failure to change migration speed is not fatal. */ - if (!(migParams =3D qemuMigrationParamsNew())) + if (!(migParams =3D qemuMigrationParamsForSave(false))) return -1; =20 if (qemuMigrationParamsSetULL(migParams, diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 03937df2d3..503d6165b0 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -783,6 +783,27 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr para= ms, } =20 =20 +qemuMigrationParams * +qemuMigrationParamsForSave(bool mappedRam) +{ + g_autoptr(qemuMigrationParams) saveParams =3D NULL; + + if (!(saveParams =3D qemuMigrationParamsNew())) + return NULL; + + if (mappedRam) { + if (virBitmapSetBit(saveParams->caps, QEMU_MIGRATION_CAP_MAPPED_RA= M) < 0) + return NULL; + if (virBitmapSetBit(saveParams->caps, QEMU_MIGRATION_CAP_MULTIFD) = < 0) + return NULL; + saveParams->params[QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS].value.i = =3D 1; + saveParams->params[QEMU_MIGRATION_PARAM_MULTIFD_CHANNELS].set =3D = true; + } + + return g_steal_pointer(&saveParams); +} + + int qemuMigrationParamsDump(qemuMigrationParams *migParams, virTypedParameterPtr *params, diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_par= ams.h index 91a1965a74..fe239d9a8f 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -86,6 +86,9 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params, unsigned int flags, qemuMigrationParty party); =20 +qemuMigrationParams * +qemuMigrationParamsForSave(bool mappedRam); + int qemuMigrationParamsDump(qemuMigrationParams *migParams, virTypedParameterPtr *params, --=20 2.35.3