From nobody Sat Nov 23 17:54:42 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=1723160418; cv=none; d=zohomail.com; s=zohoarc; b=Nhd1hp53gbnIck7CzZ5/SKyRtjBreO9S2IFLMOT/Is7CDOwCnFFt2VDZ7YnZFz5A4MwhOa4ysFH7+/0yy5bNJigQteeEfJrPqNqGWsmlitoj4gNNACkHrZOnqv7JYiqy8i9fCVnJ/+PWOqoVugLKNxwGnZ3xIsjDfaG4aQEu/MU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723160418; 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=F7OjoIGScxOrkcXGELPavdiXzkMfTcKzjOq4WawwPnU=; b=JcCQ9L9QWx8SR/h9ijwOGc3nMuXvyaTAgLKzeixLLjEzECqtmFBPRfL1P7ND4H02/hKG19Hmp7Wmld2fCTbxrlj20meTj1IvvqTa2i4jB5H03eESu4EjKSG0Df4EJJecDKIJ6c+39svcUkmJZyPv1kzDx7qtGcLnaLJNOkW2c/g= 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 1723160418151462.52267223434853; Thu, 8 Aug 2024 16:40:18 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id F1AF1137A; Thu, 8 Aug 2024 19:40:16 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 44CCC14C1; Thu, 8 Aug 2024 19:38:30 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5350A12CA; Thu, 8 Aug 2024 19:38:24 -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 9335B12CA for ; Thu, 8 Aug 2024 19:38:23 -0400 (EDT) Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2eeb1ba0468so19135451fa.0 for ; Thu, 08 Aug 2024 16:38:23 -0700 (PDT) Received: from localhost ([69.51.98.127]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4c8d6a273c5sm3795354173.100.2024.08.08.16.38.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:38:21 -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=1723160302; x=1723765102; 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=CBLP3RLVKI8Z0qp59yitF9BIiaylGPi/8peHWDi8AFY=; b=ZXZRNdWdo8ruX71GZi751aJ9LLBd8myRUNrhHZI2S8RGJp2kdxPg3WNkVmBindl0Rb r8Khveoqk/qSX0TV/RUYKN9UGaIhxQG4M8cpIXBCz90yoVqewZt9M1bT3rswpb+pZsks Q4FGi3NGdAhKSsH9s3/x87a0rqvHOL3vPJXPiPghHHifI0IHap17O6Ic+9vFuNnmB0zv TI/Myvi4dOZGG+KSIl5ieVBj1HzGw2fbtHNvfp8zq5FZJMveE0dTwyHWeaN9QAvQMv08 pO5xhAecEoPzfqOqF9KjHmE9ViW0jMwNba2PbFwIc4nGYU6Lt4XMBtyGv5IOojeWxhqD rOEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723160302; x=1723765102; 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=CBLP3RLVKI8Z0qp59yitF9BIiaylGPi/8peHWDi8AFY=; b=Wnu6LRCnzC4v0KkA+zREXWRxSecei2yKO5aL1Mqfz7h2m5RE1xyIll5i4mHZYVMPWX 2wYgo1lLKk8W4I3WOjRAMFU3Ft8rjlplW6ka9FeTsjjGRo+mAM3dzES4OWTgl/FX1L1G jG6LQ+8IO/GJBlOAJAgx9gaDh1uAhTrvgnPoPX8Ee3OcyaVPsLqWshjduXdJo4pwKRgs DhoZUF/JdoGsn9Kck451Df+OLbQLhs15oL60p4fNYdmZ8S3K+jDQsm5Y20hme0ecDrX+ nHwbcgaobjr9T0iJSzqr05+joAXjrr2kUDyQSR/ATo0SgcP/eyinwQ4nVuIRmf91Gm7l 72Ug== X-Gm-Message-State: AOJu0Yzyj3c50w3F0YPd+2EvQH2PCgsnw/KirnJmLL3EhzsnJOAIEnAD t+1Ucoer//GkZbVgEoKHvKTsppewiFKX9nuZkc9/u+hXVC3kgM3Z9UHhFgWwQxEcXr4N+FGzrr3 q X-Google-Smtp-Source: AGHT+IHOPJuDsl0ZUmBTuzA8ZQ/qELXXH6kn4DUMMFE8D/1jnNMA01wNDBytbUEHQeGBObDACZpBbg== X-Received: by 2002:a2e:a7ca:0:b0:2f1:a594:c1c3 with SMTP id 38308e7fff4ca-2f1a594c497mr1136631fa.32.1723160302182; Thu, 08 Aug 2024 16:38:22 -0700 (PDT) To: devel@lists.libvirt.org Subject: [PATCH 03/20] qemu: Add function to check capability in migration params Date: Thu, 8 Aug 2024 17:37:56 -0600 Message-Id: <20240808233813.22905-4-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: BF77N63CRYHE4F3LHGEFOGYPUQNI6ZJL X-Message-ID-Hash: BF77N63CRYHE4F3LHGEFOGYPUQNI6ZJL 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: 1723160418596116600 Content-Type: text/plain; charset="utf-8" Add new function qemuMigrationParamsCapEnabled() to check if a capability is set in the caller-provided migration parameters. Signed-off-by: Jim Fehlig Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_migration_params.c | 16 ++++++++++++++++ src/qemu/qemu_migration_params.h | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 98822012cc..c3c9120c22 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -1303,6 +1303,22 @@ qemuMigrationParamsGetULL(qemuMigrationParams *migPa= rams, } =20 =20 +/** + * Returns true if @cap is enabled in @migParams, false otherwise. + */ +bool +qemuMigrationParamsCapEnabled(qemuMigrationParams *migParams, + qemuMigrationCapability cap) +{ + bool enabled =3D false; + + if (migParams) + ignore_value(virBitmapGetBit(migParams->caps, cap, &enabled)); + + return enabled; +} + + /** * qemuMigrationParamsCheck: * diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_par= ams.h index df67f1fb92..020071e8ef 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -136,6 +136,10 @@ qemuMigrationParamsGetULL(qemuMigrationParams *migPara= ms, qemuMigrationParam param, unsigned long long *value); =20 +bool +qemuMigrationParamsCapEnabled(qemuMigrationParams *migParams, + qemuMigrationCapability cap); + void qemuMigrationParamsSetBlockDirtyBitmapMapping(qemuMigrationParams *migPara= ms, virJSONValue **params); --=20 2.35.3