From nobody Tue May 21 11:24:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658400423; cv=none; d=zohomail.com; s=zohoarc; b=dh/OF/Veo+J67moIBvlvtRVerAlTQghBvxjQYmBgupz/rYdeMnaqSwaZtkQPlhP0IRyR8fbpiXp3ayev3Y9GuJD9qwdKgiJ6H/7r3abpxaLL/DGAI9dmabbnX2XkCE+iqTGkZOwKMkLH+IRlpdrVichZ2CTBOqapL8h9ZB4Kwkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658400423; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tXSHC97f5EkxarXcAQLl4G4irdfAL16ak/LfaNxqIac=; b=BqN1SHivQeoel65GOm/RoyL/P8KBIY+c8De5IC/Bc9LJcxvZVJu5RDgdPwvg2LdTMj7F7kz8IaTZuzZwrkrQTI1AlUFfK8l5vlAHI0wADd2SDiLdTVYU+CVZa2XVQLK5bymhZWNGYbt4i7canu6MsltfQJbMI5ULgYurxpvxpy4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1658400423901516.8764158070592; Thu, 21 Jul 2022 03:47:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-153-d5pgLFMPPhqQ_hdDGNH8sQ-1; Thu, 21 Jul 2022 06:46:13 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5CB0D29ABA22; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AB2C492C3B; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0F25E1947047; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 601ED1947043 for ; Thu, 21 Jul 2022 10:46:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3CFB1400E894; Thu, 21 Jul 2022 10:46:09 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB11A40CF916 for ; Thu, 21 Jul 2022 10:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658400422; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tXSHC97f5EkxarXcAQLl4G4irdfAL16ak/LfaNxqIac=; b=MhH+dym5yTo8mW07KBA6mKWi746S9l/pQQU+qIfIgDYftnruOh4PthVHgsTnYxre0oE5C/ MjanbrKe1BQoeqk0LAwxpWehhigmq2rieB3yloRm76UF7Dv0O09bCovYkdyFTYORU2eigH OJlpXAXZ5RbFojFuobJebCG1x9ayT34= X-MC-Unique: d5pgLFMPPhqQ_hdDGNH8sQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvirt-list@redhat.com Subject: [PATCH v2 1/8] domain_capabilities: use early return in virDomainCapsFeatureSEVFormat() Date: Thu, 21 Jul 2022 12:45:46 +0200 Message-Id: <8aea3aa9386985fb3d239e4e3be2f4fae477dbef.1658400080.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658400425364100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova Reviewed-by: Martin Kletzander --- src/conf/domain_capabilities.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 33570a51db..bb36a956db 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -590,25 +590,24 @@ virDomainCapsFeatureSEVFormat(virBuffer *buf, { if (!sev) { virBufferAddLit(buf, "\n"); - } else { - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); - virBufferAsprintf(buf, "%d\n", sev->cbitpos); - virBufferAsprintf(buf, "%d\n", - sev->reduced_phys_bits); - virBufferAsprintf(buf, "%d\n", - sev->max_guests); - virBufferAsprintf(buf, "%d\n", - sev->max_es_guests); - if (sev->cpu0_id !=3D NULL) { - virBufferAsprintf(buf, "%s\n", - sev->cpu0_id); - } - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); + return; } =20 - return; + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); + virBufferAsprintf(buf, "%d\n", sev->cbitpos); + virBufferAsprintf(buf, "%d\n", + sev->reduced_phys_bits); + virBufferAsprintf(buf, "%d\n", + sev->max_guests); + virBufferAsprintf(buf, "%d\n", + sev->max_es_guests); + if (sev->cpu0_id !=3D NULL) { + virBufferAsprintf(buf, "%s\n", + sev->cpu0_id); + } + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); } =20 =20 --=20 2.35.3 From nobody Tue May 21 11:24:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658400379; cv=none; d=zohomail.com; s=zohoarc; b=HYIZO3uBX3ko2827JzT8wMwnGI0T8tjveom1tU4f5hS+ywoOffsiMaRLPs7kttSQgu3F3rifKW9p/Ac/rB4+8xw1caK1+qXchwJQmG3xxNYOAfb5BdnNpwckQb/HAP1plYQHRQdzOEZFWKBFEMzEqcqr8LpnhgIuel1BVPGLjrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658400379; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yR6kqJxtp88ylr73YBGFcnHZ+G7n2m83GK+5PBxMwzQ=; b=KmmWbPwW+1VYtFB6V8CHe5hGaWNp5j6ABO1ED7eb8yoJMGV8eieRCVMTPhLaO9fedUE6AluxhmlwkZeWrJToF4PrPIkiq+9NJ9eP32Lk9RGjGW0AspKUlGqJP5JG/H1NxDKEteWqdY+G0TDkO+HYKsNnamd1E7ljWKPZ/KHJZmw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 165840037969929.15397279074932; Thu, 21 Jul 2022 03:46:19 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-487-an1ngaogPSKka-5hLjofpQ-1; Thu, 21 Jul 2022 06:46:16 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 11D163801F77; Thu, 21 Jul 2022 10:46:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id F002C14582E0; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AEDD81947043; Thu, 21 Jul 2022 10:46:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D37C91947050 for ; Thu, 21 Jul 2022 10:46:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C79B040CFD0B; Thu, 21 Jul 2022 10:46:09 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 729D640CFD0A for ; Thu, 21 Jul 2022 10:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658400378; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yR6kqJxtp88ylr73YBGFcnHZ+G7n2m83GK+5PBxMwzQ=; b=c7FMi/Wuhq7OKEaf2EMKT5BGD8oqXtHdM2vbirnHqotHd5gTIRlGDKDwmCRxXqFFmiVkkv 9mureKPYBzWDnjbhE4SjnCai1KP9pI9SGXsiGIr4Yu+UM2QcQuBy4r3095C+Di7K09XLXU Oha3g79Nz/zCbQQ6WrqqsjPeW6zozCg= X-MC-Unique: an1ngaogPSKka-5hLjofpQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvirt-list@redhat.com Subject: [PATCH v2 2/8] domain_capabilities: reformat virDomainCapsFeatureSEVFormat() Date: Thu, 21 Jul 2022 12:45:47 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658400381191100004 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova Reviewed-by: Martin Kletzander --- src/conf/domain_capabilities.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index bb36a956db..6e8f957657 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -598,14 +598,12 @@ virDomainCapsFeatureSEVFormat(virBuffer *buf, virBufferAsprintf(buf, "%d\n", sev->cbitpos); virBufferAsprintf(buf, "%d\n", sev->reduced_phys_bits); - virBufferAsprintf(buf, "%d\n", - sev->max_guests); - virBufferAsprintf(buf, "%d\n", - sev->max_es_guests); - if (sev->cpu0_id !=3D NULL) { - virBufferAsprintf(buf, "%s\n", - sev->cpu0_id); - } + virBufferAsprintf(buf, "%d\n", sev->max_guests); + virBufferAsprintf(buf, "%d\n", sev->max_es_= guests); + + if (sev->cpu0_id !=3D NULL) + virBufferAsprintf(buf, "%s\n", sev->cpu0_id); + virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); } --=20 2.35.3 From nobody Tue May 21 11:24:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658400379; cv=none; d=zohomail.com; s=zohoarc; b=kkjh5LINGr+QmmmBoKzNhBS84aT1zs8VvOQn28+dp6xwcp+oWbwTBMGjNM+X+HCBWDh5ry9twektojkVnOytUT56hJ5+raViGBFrwgHCdI814YO5tmCA+5EXixANzKARZh3hdS3j37PnGxumWxdtfnGiQR5dG6bpe2bjSCO826M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658400379; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dhg8xjXj3pwN4RgpZZO+by5O6w0lK5uvPfv9CoRMx+8=; b=PbX0iUko0ygp5qT9NuRFAZE0yMw7QW4REumKljb06yk1+xRsSc8nNcQRqAjFRzIADBDu+RRS2a/hnVtIOnrUhKLgh4zbW05iBvg50+3HvP4P6y+YXbrReH1I31fUcy1nHUu/qELo93OJm982unI4GvwLmqggYyfYWIFq/qaSXlM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1658400379807850.1464345205171; Thu, 21 Jul 2022 03:46:19 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-265-t6Yq-vs1MrSjp-Elhv2CHw-1; Thu, 21 Jul 2022 06:46:15 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B71C7804191; Thu, 21 Jul 2022 10:46:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A57BD492C3B; Thu, 21 Jul 2022 10:46:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 54F2A1947047; Thu, 21 Jul 2022 10:46:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9367A1947043 for ; Thu, 21 Jul 2022 10:46:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5F270400E894; Thu, 21 Jul 2022 10:46:10 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09A8B40CFD0A for ; Thu, 21 Jul 2022 10:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658400378; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dhg8xjXj3pwN4RgpZZO+by5O6w0lK5uvPfv9CoRMx+8=; b=MW7hrD8N1hX79dWKoiyIPjfcbbRdFBqlQtpDqddvGS3V9vpdJUKNCLBM8sLyd0xqwijaIg +NnpfkchPuuqkkeoxfjc3sMKQm7EDycY7xLbZiEv/2YHzz5sjsE66LFKpxYgs3v0qdxwNg PJiTpH95ha3a5A5/wa9WlwPwyYwCBIc= X-MC-Unique: t6Yq-vs1MrSjp-Elhv2CHw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvirt-list@redhat.com Subject: [PATCH v2 3/8] domain_capabilities: reformat virDomainCapsCPUCustomFormat() Date: Thu, 21 Jul 2022 12:45:48 +0200 Message-Id: <91022deb3d8feed61ddc5ec03c9ce302541222a4.1658400080.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658400381186100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova Reviewed-by: Martin Kletzander --- src/conf/domain_capabilities.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 6e8f957657..653123f293 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -376,12 +376,14 @@ virDomainCapsCPUCustomFormat(virBuffer *buf, =20 for (i =3D 0; i < custom->nmodels; i++) { virDomainCapsCPUModel *model =3D custom->models + i; + virBufferAsprintf(buf, "usable= )); + if (model->deprecated) virBufferAddLit(buf, " deprecated=3D'yes'"); - virBufferAsprintf(buf, ">%s\n", - model->name); + + virBufferAsprintf(buf, ">%s\n", model->name); } =20 virBufferAdjustIndent(buf, -2); --=20 2.35.3 From nobody Tue May 21 11:24:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658400378; cv=none; d=zohomail.com; s=zohoarc; b=i4zQ1qGffGdMaTULiUXlfhP5gsTTMEoYeOpfxFhwTUnTQCwwVEKxTXQIoBz97tludN4ljus4o3OLwJl3IUmMnB39+Xgs3hquC8gKNCWhamZAUpJpvWlWgBL8+EUnB7BodQLy8F7EpbWjKfXSoNe5bGVt5W2Q87X/fz/9pT3uOl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658400378; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PlyIcJ3+e6EqDHOYEFF+wor1s9da+FAqF1QvyBOCYvA=; b=ahOm2mSE7EQfQfWahIxfoKylhyia3rVlRChUPXeeU3HbNnxHAChe73F4U2LGpN7dUGE2E6cW6h7pP/7b28frlV/IXdpPpJs2O4QaZwongJwSBTAW9AbWCFTflAtLwTvh/H+lXR9F8SA0fW54fzeZbiPaLM5nDus655j7uy9REfk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1658400378783625.0783113622688; Thu, 21 Jul 2022 03:46:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-267-p9DaG40YO7Og3MI-Y6kVkw-1; Thu, 21 Jul 2022 06:46:16 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 00D9F3801F5E; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1380492C3B; Thu, 21 Jul 2022 10:46:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6C9E81947053; Thu, 21 Jul 2022 10:46:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 21C1E1947053 for ; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EAB8C400E894; Thu, 21 Jul 2022 10:46:10 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94FB8404C6C9 for ; Thu, 21 Jul 2022 10:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658400377; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PlyIcJ3+e6EqDHOYEFF+wor1s9da+FAqF1QvyBOCYvA=; b=dP4fOrWqH9IEb3dY5prL6/6vmlp8OnT1YaYNqUB+VgH12MG7Qqe+goCimXmmZcLrrLV7rq 3nrOAq44YarKzS6coHLbC+K5EpS7nBiEkOmSmjk4IINgE/AZ7PdnTZtEHsXQ/1tAYDkqWC 2HVZbQn41gHE+d4VyjbxOVG+PY+MJHM= X-MC-Unique: p9DaG40YO7Og3MI-Y6kVkw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvirt-list@redhat.com Subject: [PATCH v2 4/8] domain_conf: remove breaks after return in virDomainChrSourceDefIsEqual() Date: Thu, 21 Jul 2022 12:45:49 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658400379278100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova Reviewed-by: Martin Kletzander --- src/conf/domain_conf.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 26a241db38..b903dac1cb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2844,21 +2844,22 @@ virDomainChrSourceDefIsEqual(const virDomainChrSour= ceDef *src, case VIR_DOMAIN_CHR_TYPE_FILE: return src->data.file.append =3D=3D tgt->data.file.append && STREQ_NULLABLE(src->data.file.path, tgt->data.file.path); - break; + case VIR_DOMAIN_CHR_TYPE_PTY: case VIR_DOMAIN_CHR_TYPE_DEV: case VIR_DOMAIN_CHR_TYPE_PIPE: return STREQ_NULLABLE(src->data.file.path, tgt->data.file.path); + case VIR_DOMAIN_CHR_TYPE_NMDM: return STREQ_NULLABLE(src->data.nmdm.master, tgt->data.nmdm.master= ) && STREQ_NULLABLE(src->data.nmdm.slave, tgt->data.nmdm.slave); - break; + case VIR_DOMAIN_CHR_TYPE_UDP: return STREQ_NULLABLE(src->data.udp.bindHost, tgt->data.udp.bindHo= st) && STREQ_NULLABLE(src->data.udp.bindService, tgt->data.udp.bindSe= rvice) && STREQ_NULLABLE(src->data.udp.connectHost, tgt->data.udp.connec= tHost) && STREQ_NULLABLE(src->data.udp.connectService, tgt->data.udp.con= nectService); - break; + case VIR_DOMAIN_CHR_TYPE_TCP: return src->data.tcp.listen =3D=3D tgt->data.tcp.listen && src->data.tcp.protocol =3D=3D tgt->data.tcp.protocol && @@ -2866,18 +2867,16 @@ virDomainChrSourceDefIsEqual(const virDomainChrSour= ceDef *src, STREQ_NULLABLE(src->data.tcp.service, tgt->data.tcp.service) && src->data.tcp.reconnect.enabled =3D=3D tgt->data.tcp.reconnect= .enabled && src->data.tcp.reconnect.timeout =3D=3D tgt->data.tcp.reconnect= .timeout; - break; + case VIR_DOMAIN_CHR_TYPE_UNIX: return src->data.nix.listen =3D=3D tgt->data.nix.listen && STREQ_NULLABLE(src->data.nix.path, tgt->data.nix.path) && src->data.nix.reconnect.enabled =3D=3D tgt->data.nix.reconnect= .enabled && src->data.nix.reconnect.timeout =3D=3D tgt->data.nix.reconnect= .timeout; - break; =20 case VIR_DOMAIN_CHR_TYPE_SPICEPORT: return STREQ_NULLABLE(src->data.spiceport.channel, tgt->data.spiceport.channel); - break; =20 case VIR_DOMAIN_CHR_TYPE_SPICEVMC: return src->data.spicevmc =3D=3D tgt->data.spicevmc; @@ -2885,12 +2884,10 @@ virDomainChrSourceDefIsEqual(const virDomainChrSour= ceDef *src, case VIR_DOMAIN_CHR_TYPE_QEMU_VDAGENT: return src->data.qemuVdagent.clipboard =3D=3D tgt->data.qemuVdagen= t.clipboard && src->data.qemuVdagent.mouse =3D=3D tgt->data.qemuVdagent.mouse; - break; =20 case VIR_DOMAIN_CHR_TYPE_DBUS: return STREQ_NULLABLE(src->data.dbus.channel, tgt->data.dbus.channel); - break; =20 case VIR_DOMAIN_CHR_TYPE_NULL: case VIR_DOMAIN_CHR_TYPE_VC: --=20 2.35.3 From nobody Tue May 21 11:24:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658400435; cv=none; d=zohomail.com; s=zohoarc; b=JsPOQPKd3lg6O2aXnixsoCP7XJe3GuHf5GcfmM6Y+bZdhoGiKuGrGV5v3mf3X2PZwubKUvUaF6/zvdNSKg1ybs2kK1zxUcXpJQKLOGWPfqbcpZy5F84hvx2qrKmrTN25IAtU4fLDu1VdDaUdCfx76AXr7Oj3VM99Uq1+Y42f3NA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658400435; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UOsGerUwuH6ZLhNAPqKTSD7+FLjJFwJaE/cdZThnEOk=; b=JtHfNY8Nu7eq7Owy/H5q45d4nDuc6TbNHUOkpYym40lddly3Ehk/L12UHCMONVbJvPERzd3VIQ0qhM4RtyHZ+NMl9irok1Zct9UCz72Q385YPHkeTzWOpnUp17vgTMSHmWBAEUPf/RzrDEUybxD0W9YACC9rdv57dz4v2/0UtK8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1658400435031237.1539715407239; Thu, 21 Jul 2022 03:47:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-22-v1_yqi9cOGG7T8dqJGnLUQ-1; Thu, 21 Jul 2022 06:46:17 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B3DD1034ADF; Thu, 21 Jul 2022 10:46:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65F72404D883; Thu, 21 Jul 2022 10:46:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BE2231947077; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A1BC61947043 for ; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 836D340CFD0A; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C09340CF916 for ; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658400434; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UOsGerUwuH6ZLhNAPqKTSD7+FLjJFwJaE/cdZThnEOk=; b=RxeflCcmIpuPZkNUSO1PuQJ9TBk6YtYqzitXuNTrXx7mJYm3AYtW840Olj+Lze1Oltyrl2 Y4hHZ6HaR3UF/i0ovyHi/LsRiNdwEpleS+dAv3DyoziS4hutJ0nJFhZO0PxuUddfOI77zS agys64VO6Te6GfyOfvKRSWqWMTpA2m4= X-MC-Unique: v1_yqi9cOGG7T8dqJGnLUQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvirt-list@redhat.com Subject: [PATCH v2 5/8] domain_conf: extend switch with if in virDomainChrDefFree() Date: Thu, 21 Jul 2022 12:45:50 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658400435420100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Switch is used for just one case, but a more future proof approach is to handle all enum values. Signed-off-by: Kristina Hanicova Reviewed-by: Martin Kletzander --- src/conf/domain_conf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b903dac1cb..41eb105a6c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2904,7 +2904,7 @@ void virDomainChrDefFree(virDomainChrDef *def) if (!def) return; =20 - switch (def->deviceType) { + switch ((virDomainChrDeviceType)def->deviceType) { case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: switch (def->targetType) { case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD: @@ -2918,7 +2918,10 @@ void virDomainChrDefFree(virDomainChrDef *def) } break; =20 - default: + case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: + case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: + case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: + case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: break; } =20 --=20 2.35.3 From nobody Tue May 21 11:24:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658400427; cv=none; d=zohomail.com; s=zohoarc; b=D5r420bBrvWDyVzqHCU1WwhUdjxSdQFcx7zXutMgKwkB3oWDeTXTII/wjl6b+wvPVu6+/lerLKZ1NuXtgKfN7MAQSlAfQlaz4lsHzwo7ewTPstxHUcZ7S9m/DlApa2bstevpybfW16agBrLEvg6POW5SEyTtRTvvgN4soKCisi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658400427; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SLYEqToM8E/kmWByFd8ZPNf035471+kDdPzbLw6lHvE=; b=iCbO9LAne4BpDb4pCAEoutfvuHdcocUn93Kdpk/08iLsKo+rmbHdjcCowteMjicFGnoSu3pp5JkctXudHy4qCn0huRZBpuRcxGWupC1Yz4N2EsGe1ckl6PgpjcnrjO8CNg45Fwv5hYztpT4M/CdYZ4jswCELm/eQ1ZHFaQCzaDM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1658400427912146.10181426348947; Thu, 21 Jul 2022 03:47:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-vxpF-BqaPWK_UQxtTd0QQw-1; Thu, 21 Jul 2022 06:46:18 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE88585A58C; Thu, 21 Jul 2022 10:46:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD7FF492CA9; Thu, 21 Jul 2022 10:46:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0F7711947BBB; Thu, 21 Jul 2022 10:46:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3749A1947043 for ; Thu, 21 Jul 2022 10:46:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 185C340CFD0B; Thu, 21 Jul 2022 10:46:12 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id B721040CFD0A for ; Thu, 21 Jul 2022 10:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658400426; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SLYEqToM8E/kmWByFd8ZPNf035471+kDdPzbLw6lHvE=; b=hAwu0ZTBWK2pHKbl2rXdP8qcvrUguMzIPwZCBCbKB/HFhjvI57Z5cOrwH8fEVXGP1I2CpY 9AH9Y7KXMWrao+hsligNtolZXxkzExY5PEjm8Ss4ZstkdHuChfFD1tfQN4gke+0UT1lJOm ITZM7pxAUu19QGFxJod59jdvnUuqr3g= X-MC-Unique: vxpF-BqaPWK_UQxtTd0QQw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvirt-list@redhat.com Subject: [PATCH v2 6/8] domain_conf: use early return in virDomainObjAssignDef() Date: Thu, 21 Jul 2022 12:45:51 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658400429385100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova Reviewed-by: Martin Kletzander --- src/conf/domain_conf.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 41eb105a6c..507bff953c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3928,22 +3928,24 @@ void virDomainObjAssignDef(virDomainObj *domain, else virDomainDefFree(domain->newDef); domain->newDef =3D g_steal_pointer(def); - } else { - if (live) { - /* save current configuration to be restored on domain shutdow= n */ - if (!domain->newDef) - domain->newDef =3D domain->def; - else - virDomainDefFree(domain->def); - domain->def =3D g_steal_pointer(def); - } else { - if (oldDef) - *oldDef =3D domain->def; - else - virDomainDefFree(domain->def); - domain->def =3D g_steal_pointer(def); - } + return; + } + + if (live) { + /* save current configuration to be restored on domain shutdown */ + if (!domain->newDef) + domain->newDef =3D domain->def; + else + virDomainDefFree(domain->def); + domain->def =3D g_steal_pointer(def); + return; } + + if (oldDef) + *oldDef =3D domain->def; + else + virDomainDefFree(domain->def); + domain->def =3D g_steal_pointer(def); } =20 =20 --=20 2.35.3 From nobody Tue May 21 11:24:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658400438; cv=none; d=zohomail.com; s=zohoarc; b=X3/DtLza1KBaYFVJf4bHbHsJ6nULvyLrV+44MIe64gV4EfrK6fBHUmd2M4880mx7hBLGuAGamx/QN3PSW2tkvwFNa/URqrUG6XJXIHAYar5LQuTcF3tjo1hqISTD6IOW0HqhG0F1B7HSJZLDGdL/7Q1FE8+SkU8xNwNknuLQikk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658400438; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iafolzZne3GwCytdf4kY66SajQsUF3m6kBIXPI8OsLw=; b=WE5JKo5u9uYv3OcNk6FzLqa3IjHPXZfN35fTFiJw4tAQbrfVpZxBEycf2taKq1hq4pD+MaIEhR/qqrgHb7YjR60csS388VT0wrdTQlNldb5Jd1NEolfJHKfAZ7mvW/J1xR+GJwlBTpRzb50x89VjxIaeubM59BusIkksoYzxSxE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1658400438377828.9193189358898; Thu, 21 Jul 2022 03:47:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-jyt48ITSOdeowFARV3_cwQ-1; Thu, 21 Jul 2022 06:46:19 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B75531C13940; Thu, 21 Jul 2022 10:46:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5EB4400E894; Thu, 21 Jul 2022 10:46:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 77F0F1947048; Thu, 21 Jul 2022 10:46:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 58729194704B for ; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3B930400E894; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA46040CFD0A for ; Thu, 21 Jul 2022 10:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658400437; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=iafolzZne3GwCytdf4kY66SajQsUF3m6kBIXPI8OsLw=; b=JAHdwP94lYiOSqMOAJxdRobL3kkepmnzQ3tlyZ2gAEE+SJ20f3hoNeAFOzsYEcfoBalY10 8nD6w5oU0BrmeAzBVj2FQKY6Tzbs/ZkG0wHtNLaZRg2a4EvtGrj+DKpPEJDo+LWcSi/wa0 Bys1DexzHbe6WvVBk6hvIEEqxepNJVU= X-MC-Unique: jyt48ITSOdeowFARV3_cwQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvirt-list@redhat.com Subject: [PATCH v2 7/8] domain_conf: rewrite conditions in virDomainObjWaitUntil() Date: Thu, 21 Jul 2022 12:45:52 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658400439422100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This patch rewrites conditions to make the code easier and less structured. Signed-off-by: Kristina Hanicova Reviewed-by: Martin Kletzander --- src/conf/domain_conf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 507bff953c..bbe6574487 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4009,15 +4009,15 @@ int virDomainObjWaitUntil(virDomainObj *vm, unsigned long long whenms) { - if (virCondWaitUntil(&vm->cond, &vm->parent.lock, whenms) < 0) { - if (errno !=3D ETIMEDOUT) { - virReportSystemError(errno, "%s", - _("failed to wait for domain condition")); - return -1; - } + if (virCondWaitUntil(&vm->cond, &vm->parent.lock, whenms) >=3D 0) + return 0; + + if (errno =3D=3D ETIMEDOUT) return 1; - } - return 0; + + virReportSystemError(errno, "%s", + _("failed to wait for domain condition")); + return -1; } =20 =20 --=20 2.35.3 From nobody Tue May 21 11:24:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658400384; cv=none; d=zohomail.com; s=zohoarc; b=aBndu8YLNZZoAAvtUFgPlTvwF+V8O/xzF69sT8FXHd7YQUgTjRYB0aO2EHiqbtMIPazs33ZTgTwgbBvBeOxDxecVdbNmaNIL2fXcLv5RVSb9aCIHWeT96Hpe4uF9KToG31wC5B1fWcjQWk0E/meREDZOe15uuO/hR2I5eg1xRCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658400384; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NcomFTfPxErQRXrIbB+3fF2p4QVEXttScrYOJy35cP8=; b=cDp6LxpleCECVFYmmmf6vcFH0G46ietBiVZc8Fn7pO8hrhcsWOLM76ZCdQyuJuaS/K3HDGzDZDOqmealEziLcY2XUYdRL6npjdREbKt9PhUVlzEPDKu183zznLAHkL03CJJts/cUgwfSIWdVyRjhy9ikJjApyGQJbaXIU5GnpB0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1658400384516888.4960920109835; Thu, 21 Jul 2022 03:46:24 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-187-uHRE7aKSNvu6_v-fdq59rw-1; Thu, 21 Jul 2022 06:46:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 767048037B7; Thu, 21 Jul 2022 10:46:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61A0B1121319; Thu, 21 Jul 2022 10:46:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 32A2A1947047; Thu, 21 Jul 2022 10:46:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D278919451F3 for ; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C6D1940CFD0A; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 717C840CF916 for ; Thu, 21 Jul 2022 10:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658400383; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=NcomFTfPxErQRXrIbB+3fF2p4QVEXttScrYOJy35cP8=; b=dGUzh0j6oTy1fOsoa95AdJcniL8NCYCJwbDoM5yfNRAeV8bNPzdzPIqaJkhJIFAgaxGrad 9MlgJopcENy5U6tlEihX3KtZrD9ORIoeeh6d/JgAeJfrUmQL5MxujeRPkB3nsEPFhpzHgo USNBaRREKZpkHaxbmyHh4pt206Wss2I= X-MC-Unique: uHRE7aKSNvu6_v-fdq59rw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvirt-list@redhat.com Subject: [PATCH v2 8/8] domain_conf: rewrite variable setting Date: Thu, 21 Jul 2022 12:45:53 +0200 Message-Id: <97a887d2cfd18d325b55d5f364664da1f2189f2f.1658400080.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658400385227100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova Reviewed-by: Martin Kletzander --- src/conf/domain_conf.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index bbe6574487..d3872830c9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4216,12 +4216,8 @@ virDomainObjGetOneDefState(virDomainObj *vm, if (virDomainObjUpdateModificationImpact(vm, &flags) < 0) return NULL; =20 - if (live) { - if (flags & VIR_DOMAIN_AFFECT_LIVE) - *live =3D true; - else - *live =3D false; - } + if (live) + *live =3D flags & VIR_DOMAIN_AFFECT_LIVE; =20 if (virDomainObjIsActive(vm) && flags & VIR_DOMAIN_AFFECT_CONFIG) return vm->newDef; --=20 2.35.3