From nobody Sat Nov 23 17:52:43 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=1723160445; cv=none; d=zohomail.com; s=zohoarc; b=PoAzdZNVrfCYnad0HKB20HKXtLbFHdRI3ZtMoZqclYKzvXEjEs6QLrfkmZZrvM8gb/Zk1eaRqyIwuVdAD1djkwPSHtujnU9iVkM/9vdps0m4ewHEHygWxG1NEhNqQp+wg2hENhP8zVRfkoX4JEa4bdjp0nRWS95rcRsJX/1Skds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723160445; 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=8YUXLyy9QkAAR+VlPr5pRzJcd55lieewD0Fzpqi1llE=; b=VIY812KaHBVJEGLTgIDxuae0rnmv2qSoJKPNnKd9uKN/DWI+FG6JCNyAzfB4R/iHMJu8lCETXv92PsdVfF5SCM05bXHdsqHAVGXlG1rcGRSX6vtvr86IrRv/LyakveJ6OZ2IZejveOZclxQa+4i1Hma62keVUsAxfpZGzxG2yXg= 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 172316044595695.84430787380734; Thu, 8 Aug 2024 16:40:45 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id DFA351436; Thu, 8 Aug 2024 19:40:44 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id D392C1379; Thu, 8 Aug 2024 19:38:44 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 935A21442; Thu, 8 Aug 2024 19:38:39 -0400 (EDT) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 A574D146F for ; Thu, 8 Aug 2024 19:38:25 -0400 (EDT) Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-367963ea053so1173048f8f.2 for ; Thu, 08 Aug 2024 16:38:25 -0700 (PDT) Received: from localhost ([69.51.98.127]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4c8d69a880fsm3758359173.61.2024.08.08.16.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:38:23 -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=1723160304; x=1723765104; 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=nXAWIVV4z2a5pIRAEgHP3K9iM3jyvCqwo6umyIFT9uI=; b=Ua8IE+h/nA8rrpDuJ3QCr2MPoZvPlDRNb9fRwrxvIJrgsorp+0NpDsH/TJJuudG6y+ zeMalS2lbS0gaSH4oOHlw5Hf5neOn9TeGynODo0NRrzLmzE2LWukkThcxXzzLiyw+0c8 dcHtfVROKct+Xp0/j3H9Wghy16742K/CYFnhGcpKuTdHw6UvtOtCi52YEodlKucOAnHO p0REhEa++J0kZmiPbJUdjGAubmMYY4mgy+fmaA1TEy+LkCmgL6Wq9+0JO8BTLnwiN2Um xlNEqIy7xmQlnm6HHVa/pjN78E3YRFneOxPs1wkEmsguRy+gKb347SXJv8B0fUkDR/Hm kyrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723160304; x=1723765104; 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=nXAWIVV4z2a5pIRAEgHP3K9iM3jyvCqwo6umyIFT9uI=; b=bLAxAjH6yQaafERNXjIH88zh9ouPpyZbRmeX9Ok1Ze/JT8BKssrlQkWkTI+I1rE+wy hRn34un7sBwNo58JWRVQ7mHGiaMoebrXQ8AAPHyyvJhhSaZMw1xumoY69RWsivQFrx6Q D0SSLTiFm+sEodCyGWruJZq4j8kD7HC2Nw4+mZMiQqRd41LLaM2lnfoidXHwthmlOX7j 11EVLwIMnXVLvhLqvvdTy/2zDS2AyPHpCrVvGx5+WSJhECK3Oi5to/j5QV4JGcShWJjt Zjt3WWF8YaVjN7QVHADA2wou0hW7eAQbjLgOo4e2iu7wt8/eUhTeXjme1F9PDbF0MIX3 Z5FA== X-Gm-Message-State: AOJu0YzTElSJt2ZPkY33GqekII74qPFm/LVkvz6liofFO0G3FuUYG8Co Ef3N3gxog9DBeV5uxcvuQeljl2cJqi3cRokreU2o7pUqbixlirq2QZX/BrHockTp83WVlm33HWU E X-Google-Smtp-Source: AGHT+IEHsEQeuL6001FZr1hGENLQbyW9jW7o9DKM7PQjdg1Il5b4qHzb6Rgm1+v6Ckj5f2I5OByx7w== X-Received: by 2002:a05:6000:18a7:b0:368:420c:74ab with SMTP id ffacd0b85a97d-36d2751b275mr3061596f8f.28.1723160304245; Thu, 08 Aug 2024 16:38:24 -0700 (PDT) To: devel@lists.libvirt.org Subject: [PATCH 04/20] qemu: Add function to get bool value from migration params Date: Thu, 8 Aug 2024 17:37:57 -0600 Message-Id: <20240808233813.22905-5-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: QUYYVHEAJITEK7G67R6RFVMMRBMQD6D5 X-Message-ID-Hash: QUYYVHEAJITEK7G67R6RFVMMRBMQD6D5 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: 1723160446694116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jim Fehlig Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_migration_params.c | 18 ++++++++++++++++++ src/qemu/qemu_migration_params.h | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index c3c9120c22..daa52269f4 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -1303,6 +1303,24 @@ qemuMigrationParamsGetULL(qemuMigrationParams *migPa= rams, } =20 =20 +int +qemuMigrationParamsGetBool(qemuMigrationParams *migParams, + qemuMigrationParam param, + bool *value) +{ + if (!migParams || !value) + return 0; + + if (qemuMigrationParamsCheckType(param, QEMU_MIGRATION_PARAM_TYPE_BOOL= ) < 0) + return -1; + + *value =3D migParams->params[param].set ? + migParams->params[param].value.b : false; + + return 0; +} + + /** * Returns true if @cap is enabled in @migParams, false otherwise. */ diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_par= ams.h index 020071e8ef..64b2dde59b 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -136,6 +136,11 @@ qemuMigrationParamsGetULL(qemuMigrationParams *migPara= ms, qemuMigrationParam param, unsigned long long *value); =20 +int +qemuMigrationParamsGetBool(qemuMigrationParams *migParams, + qemuMigrationParam param, + bool *value); + bool qemuMigrationParamsCapEnabled(qemuMigrationParams *migParams, qemuMigrationCapability cap); --=20 2.35.3