From nobody Thu Sep 19 01:00:59 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=1718319340; cv=none; d=zohomail.com; s=zohoarc; b=Ry5+IspEZA8PtKqLXVSdl/WrL5yJPeWDUCbSxl/8QVBVBjknMt2CwIoiFp7KJEB7d/bDpjMAY910qK4wj5O6dDnSurKiMhsaMyje4BIwVrrWegInin543BKMo6sNp0p1tkdWKFGHP9AQhKvTPaeA1hh0cSzvRRmQ/z3XdPS8Ksg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718319340; h=Content-Transfer-Encoding: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:Cc; bh=xx7ph8edMWVmKejSYn6xDMckjyo663Vsqz4T8Aq84xA=; b=CsVsAxWO+mV6qz+4dD5Mj3i56pmkn8qlxid6YmgZ1hmfs0DrhasQ5H4u9W5qRXW7ISW1OC+Dihkq1Z9Po8K2/maHy274B6O9/hXHSU7gDLIAyPlepMdkInVq+qOudtSGppac+cZEUy4N+GaoAfiJFjBUtYm0hjbMHKjg5X4uBBc= 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 1718319340502376.38698520271896; Thu, 13 Jun 2024 15:55:40 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6CCB3129F; Thu, 13 Jun 2024 18:55:39 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id EF94A12A2; Thu, 13 Jun 2024 18:53:38 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id C251E12A0; Thu, 13 Jun 2024 18:53:35 -0400 (EDT) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 6719C1269 for ; Thu, 13 Jun 2024 18:52:38 -0400 (EDT) Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2ebe40673e8so15212211fa.3 for ; Thu, 13 Jun 2024 15:52:38 -0700 (PDT) Received: from localhost ([69.51.97.134]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9568ddeb0sm582342173.3.2024.06.13.15.52.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 15:52:36 -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, T_SCC_BODY_TEXT_LINE 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=1718319157; x=1718923957; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=dE/e+I6BauzdxmnwWirFXHQZL5WLgzHGglBEMPOfGKs=; b=E8F0wFxIM4xXJqfb5BR+TdJgXcpAMFmsXXZkbZzrbRdtrF76G7CAJIP9K63KxiVvx+ w0A1/So7s71XoLtnNEqjTv31kp7uwO37XPYM2roc74B0qUamLzBrVz/PHCKzXwsK7HOy Gp8iJyAwqfx0UDnkCRCU+t6E9tdL3kazmXy463XT6+rp5AgIim/PE4ePHzZ76jSCa2oc 2WenCFmssTBumKF1em31+Q5z7EZNV9VQHvpApYTb6oCCSONmIOv+Mok4BQt8knt/jHG7 FMaQEgTZpfheGASFduv8vj7VJOAjN+eQSF19Jhe1jpK1YIunkewhxcSNMog9hBx9EEQd E/eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718319157; x=1718923957; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dE/e+I6BauzdxmnwWirFXHQZL5WLgzHGglBEMPOfGKs=; b=sc1n8YjHJY3QJ5eop85V1EWy/4ObBDUjBTme2G/EQCREBeVvkXkKEWulKh1AjCbTw+ B5Zc+y/xmpa5m0m2Qm5PkdcVo3Z0oXGk/T14Tz8sLjo9Rds5ZgtbedADdCKh4JqC7Jeg 9vFsDQIk160yMc/GCuwEknEqmmNFyj3JFPlBhQM55O+vYyYU/OMTxU4lBNhqoq/z8Tov RqJNaTMgOF85h89snUnNZ5y50Cb19JFBL2TotMS0ZoI0WNeDbMNrznQ0MF6KcWL0hC9n 0MG/YitX1zyZv0Y7w7aVXAqfjP3eKyTNd+rOpYQroC/JQAkifsKuZHhY3L8p+x6YBzM4 Ma8Q== X-Gm-Message-State: AOJu0YzG4cMw7zOOuLROOzvUItF7dyOjSp2Ciz/tNMhXAe95+1lCVVgH TMTC/L74oGqBdJvIhPwhTlQoIzLyLyemyOO86n0602ZwTvxh048xf4u6bPJEhP2olbKDYFN3W6j 5 X-Google-Smtp-Source: AGHT+IF+JMH7BTXXaIp3jltCyFx/tkPgXJ7iJOKPngdytrVku8O4Y8ff9m2bVPZPx2uLSTHMNVT/nw== X-Received: by 2002:a05:651c:221f:b0:2ec:1042:fafc with SMTP id 38308e7fff4ca-2ec1042fbdemr3846611fa.0.1718319157130; Thu, 13 Jun 2024 15:52:37 -0700 (PDT) To: devel@lists.libvirt.org Subject: [PATCH RFC 3/9] qemu: Add function to get migration params for save Date: Thu, 13 Jun 2024 16:43:17 -0600 Message-ID: <20240613225228.10665-4-jfehlig@suse.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240613225228.10665-1-jfehlig@suse.com> References: <20240613225228.10665-1-jfehlig@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7XQCLYEDUAJSHUGCPQ25G2VHGDCUQMVE X-Message-ID-Hash: 7XQCLYEDUAJSHUGCPQ25G2VHGDCUQMVE 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 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: 1718319341936100001 Content-Type: text/plain; charset="utf-8" Introduce qemuMigrationParamsForMappedSave() to create a qemuMigrationParams object initialized with appropriate migration capabilities and parameters for a save operation using mapped-ram. Note that mapped-ram 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 specified by the user. Signed-off-by: Jim Fehlig --- src/qemu/qemu_migration_params.c | 19 +++++++++++++++++++ src/qemu/qemu_migration_params.h | 3 +++ 2 files changed, 22 insertions(+) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 201286e58c..96698bde9f 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -781,6 +781,25 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr para= ms, } =20 =20 +qemuMigrationParams * +qemuMigrationParamsForMappedSave(void) +{ + g_autoptr(qemuMigrationParams) saveParams =3D NULL; + + if (!(saveParams =3D qemuMigrationParamsNew())) + return NULL; + + if (virBitmapSetBit(saveParams->caps, QEMU_MIGRATION_CAP_MAPPED_RAM) <= 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 a14b189b48..0f3ed07384 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -85,6 +85,9 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params, unsigned int flags, qemuMigrationParty party); =20 +qemuMigrationParams * +qemuMigrationParamsForMappedSave(void); + int qemuMigrationParamsDump(qemuMigrationParams *migParams, virTypedParameterPtr *params, --=20 2.44.0