From nobody Fri May 3 06:37:33 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=1658322786; cv=none; d=zohomail.com; s=zohoarc; b=AowMlZdmtp3vtkX7Wdek9p7e4KHJc1I2/ef76o/ZgDtn94GB4KzWTXtMqO/It6z/9ospdBSWj1fbgHv5XrJ+1ACGRSOD5lOefuG63iXa47QuexQpyxwdiRKWc1OOGNPzpF9AzrqiDq7HNWd43LaM9dE1KPYcaC8yEl+iUG9CIgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322786; 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=KDvfnEmXoZBKXUuWInpEqly4HrWDrUzyeV+XCI4FvJGGtLV2MeHdvdO7OJqrRWa2ot8SdGvrGvjaSlgoZZ2sUXycZjFLyKw7WjMg5hTDhpsdHDftKoqYrrTB/Ge2ZNE8E4O19ZXUq/I99nlSFBS4JwATOoMkVsQsrwAIRoMT3Bc= 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 1658322786541779.3940691344918; Wed, 20 Jul 2022 06:13:06 -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-589-0Gx-2BYsNBucSwbFQRxSRg-1; Wed, 20 Jul 2022 09:13:02 -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 76B928001EA; Wed, 20 Jul 2022 13:12:59 +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 5F2DF141511A; Wed, 20 Jul 2022 13:12:59 +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 E100B1947074; Wed, 20 Jul 2022 13:12:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AD66D1947066 for ; Wed, 20 Jul 2022 13:11:19 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 90C4840D2853; Wed, 20 Jul 2022 13:11:19 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BE5840D282F for ; Wed, 20 Jul 2022 13:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322785; 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=EcXSWC/xr4R3g1MHzufrZHLvicU6tXcpIGY3h37DoFenuk7KTjvzb1tByyl+Vw6x/WlixE rBqB2G4luGee+Pyt1/AyCU6XL6pAIdOqFVEIqX4MkSLy7V+G7OEboFlzm7L4GA8apMvh+p AnMvodt/odWbgvjrJhrMSvbKAPzidXE= X-MC-Unique: 0Gx-2BYsNBucSwbFQRxSRg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 1/9] domain_capabilities: use early return in virDomainCapsFeatureSEVFormat() Date: Wed, 20 Jul 2022 15:11:04 +0200 Message-Id: <8aea3aa9386985fb3d239e4e3be2f4fae477dbef.1658322264.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: 1658322788648100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova --- 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 Fri May 3 06:37:33 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=1658323699; cv=none; d=zohomail.com; s=zohoarc; b=fmSru0k2h9ssM9CvebkoyLq+C680HOvJ44D26vo37nJ933HHlxRmNM55K44inN5O/vNXVm9krBid2BTcYgUlt16/mPdtTFOVaUz/VFROzKWMIZTLJUr5TL+4/3+tH8bM996r1DzLDESULYL4SOg4Hbjc9kWB7LdYKPmBI4O01B8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658323699; 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=C9PkJ+zph0ZXsjwC4mlcB1KyaqY9Hhx4m/LL7Va++zDu8Ifw4VhNXKF8xu7he2WoJHhok/Rmd2hmBWWqPTK1nFkRK5Sv2FoEKAU8TPf+c8zkdyxJVasmui1qI7JjjRb3W9KH2EBlDQk0Ro+rv4yLdKRzeRkgIl7KhMrsTnN3DSc= 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 1658323699752659.0921702787984; Wed, 20 Jul 2022 06:28: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-375-3BsRzKQ4Ne-rIi-N6DE8bA-1; Wed, 20 Jul 2022 09:28:16 -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 269E01C19763; Wed, 20 Jul 2022 13:28: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 D12F740CFD0A; Wed, 20 Jul 2022 13:28: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 B945E19451EF; Wed, 20 Jul 2022 13:28:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4C82B1947066 for ; Wed, 20 Jul 2022 13:11:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2826C40D296B; Wed, 20 Jul 2022 13:11:20 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id C783540D2962 for ; Wed, 20 Jul 2022 13:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658323697; 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=ejvwY4Ltn1z9Ycusa9L59wqpzO6/663CS8jgH7P9brlMb4fDmoeFseJc3lZXWE1TsW4d5B rJNfPd7eykaJisilEjH+VP5/rgUBamSGV5FZxo9zPFwwlhsnMW7QrQ4VSVlFAttUWK+1v0 U3dZ9H/TFt6ethimQCqtdeFdICtfiiA= X-MC-Unique: 3BsRzKQ4Ne-rIi-N6DE8bA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 2/9] domain_capabilities: reformat virDomainCapsFeatureSEVFormat() Date: Wed, 20 Jul 2022 15:11:05 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: 1658323700466100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova --- 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 Fri May 3 06:37:33 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=1658322745; cv=none; d=zohomail.com; s=zohoarc; b=Hw+iZLVBUiH0YQ7claAiapdQBlvTW7+eecGwGP0ng+k96GdxfnJduBUVblgveSoEuyNBkR8EIVpP+19YXE9Wy0Hbuxz5GBi1+FjukTQ95kvQCbTaMpOvZXs2V12QvfnEmm169Qr9dFZBHEb/ThMILKmfsE2JnrLuylnO1Paqur0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322745; 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=KBZ/BYxKKGUbMXQykXuGcrBSb0IMaQt+3M0bYmPkV8psqgGgBjuPBFhMFfrhXSx5aipAFdVsAd4wX9GSj6Ffci/nI/EcTUEvYYOyggXGKhZmyuRGkigb+l5FXV2xWzVxWY+sVO79/e+/1uOQk9L5yZB7BOo5PyjEN5+4X5Uy9Hs= 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 165832274517834.39665001972253; Wed, 20 Jul 2022 06:12:25 -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-620-h_kLNHxFPh6fM7U9D1mjIw-1; Wed, 20 Jul 2022 09:12:13 -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 B07BB800124; Wed, 20 Jul 2022 13:12:10 +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 9C0D21121314; Wed, 20 Jul 2022 13:12:10 +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 5D21E1923CA3; Wed, 20 Jul 2022 13:12:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CB27E1947066 for ; Wed, 20 Jul 2022 13:11:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B38FE40D296B; Wed, 20 Jul 2022 13:11:20 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EDCE40D2962 for ; Wed, 20 Jul 2022 13:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322743; 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=BF4uJgXyxPX1AvmpkbDnFRUpdPIpAUxUzLsUi47d5tGBvTw8G82UsqLRBHjurfvbsZXtm3 J62bcuoPp4frWT33B8/F4xZAHFwqJjTIlB4hvROtK9v7p+iIhs5rsDbx56y14lELyhXAAd YUC7OFctNmDQxdPYZB3joJt6jyDu1bs= X-MC-Unique: h_kLNHxFPh6fM7U9D1mjIw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 3/9] domain_capabilities: reformat virDomainCapsCPUCustomFormat() Date: Wed, 20 Jul 2022 15:11:06 +0200 Message-Id: <91022deb3d8feed61ddc5ec03c9ce302541222a4.1658322264.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: 1658322745808100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova --- 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 Fri May 3 06:37:33 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=1658322736; cv=none; d=zohomail.com; s=zohoarc; b=Befl2oP4kO9CnGJjR9Ux51DhrnK4MtMzJagAXEudP5rzb4LHH8jd1vo/Klym3RXoI6nIfV6CX+xYFXAcA4VIF921lm3kHprFX+c6K2b5y+NCNRH4PRRuvvCAj+wU/hIDGJfILVnmBkhgLLREshQXol0f6hxbosxDAHBgCL3bPks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322736; 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=h5n8zS5+Itf4WjqsM67gbwAgBpLnIP2cuKn+8bIMuy+viZgRyavuuTe824rs64/rXJ40ULxmGPHZDtD69qILseu+aa28GXkFzvxaKQJDVdM1AyEakzMH9lVYzPliQlbM5mML3tteT/Ldfn52Cjm35pAZBUjMI51keQN96d1Ad7c= 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 1658322736729790.4376138425199; Wed, 20 Jul 2022 06:12:16 -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-475-fJ8Xi7c-OrOO6mIFof5JAQ-1; Wed, 20 Jul 2022 09:12:12 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 786B9185A7B2; Wed, 20 Jul 2022 13:12:09 +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 605962026D64; Wed, 20 Jul 2022 13:12:09 +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 EAFAA194706C; Wed, 20 Jul 2022 13:11:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5B5211947066 for ; Wed, 20 Jul 2022 13:11:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4BAA440D296B; Wed, 20 Jul 2022 13:11:21 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB3CD40D2962 for ; Wed, 20 Jul 2022 13:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322735; 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=Jg9B33KntrzQbq6Ny1f6gHyWhr1/WPD82I3f1oORPRDLsxVjujQcO2vxN3Am4n4EDLkoGT pgcJU3UyADO8Tf9wKhm2OgVq7Twnj/SjQR3/xnQDuhBKrdlVq8d/BOneD+zV9O573+S35g /zdIUH9Vow+LY0H5YVbpWEA8oYeOMe0= X-MC-Unique: fJ8Xi7c-OrOO6mIFof5JAQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 4/9] domain_conf: remove breaks after return in virDomainChrSourceDefIsEqual() Date: Wed, 20 Jul 2022 15:11:07 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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.4 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: 1658322737755100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova --- 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 Fri May 3 06:37:33 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=1658322743; cv=none; d=zohomail.com; s=zohoarc; b=fVvAeJNFe++lipg2wSWgXchDwcHgLnzj27sN39/X7mQR9sKFTKWUMnbGRd1YuK8CXIk9MWOpzu7AVELzqxCV5a/H/MAvD9hi8OcnWOFcMUpwMPvZJ3wVF9DwmS5JhCY97xPrVaY1zQX140fcN46rhe/rBDokcCcRHkL4ihXFPg4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322743; 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=lD/NdsMiTPke8xF4wnPzKGeAnYdbafrkE13DeSpzjC0=; b=hBg8Inx8pFMbbqwe7e/u6wAoDd/fMwgY0LeF8oevbKNLfm/IJ4rUcu+MQ41x41ZjGScnFJ3S9AdDbiM7u3pEhWA0F4QAUKUP3xiGIrLeqjo7n/uy6RPk9SctE1jNUCG0le7Jo8KuhBFHwIE1ZXQOwsTQ1l3GbPsDeGSyHsKs4/c= 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 16583227435161016.307623029755; Wed, 20 Jul 2022 06:12:23 -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-225-6-BVR4lYOSmcBFbYqghF6Q-1; Wed, 20 Jul 2022 09:12:19 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 449A338041EB; Wed, 20 Jul 2022 13:12: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 2DE7A18EA8; Wed, 20 Jul 2022 13:12: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 404DA1923CBA; Wed, 20 Jul 2022 13:12:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 004031947066 for ; Wed, 20 Jul 2022 13:11:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D708140D296B; Wed, 20 Jul 2022 13:11:21 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8298F40D2962 for ; Wed, 20 Jul 2022 13:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322742; 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=lD/NdsMiTPke8xF4wnPzKGeAnYdbafrkE13DeSpzjC0=; b=Ib1E5A3o0BDGOvSg9/EgA47RJ85Jt4V/ctvTcm+3dLfQTL23sZQDBlbtLnx2iwP/XbBqz9 JP2yz6HKeOdHof7KfUxayjw5LboARyeF9+tYFC7Wi/HSVf41APRBVXQ14Gdmtz8P4rRUYd t03CCg7A5R+y8MLCReIx8Oit9HikGL8= X-MC-Unique: 6-BVR4lYOSmcBFbYqghF6Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 5/9] domain_conf: replace switch with if in virDomainChrDefFree() Date: Wed, 20 Jul 2022 15:11:08 +0200 Message-Id: <3b8128204eb71cad87e82361f57d34ac9fe5f5c3.1658322264.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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.79 on 10.11.54.5 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: 1658322743805100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Switch is used for just one case, so I replaced it with a simple if condition. Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b903dac1cb..f51476c968 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2904,8 +2904,7 @@ void virDomainChrDefFree(virDomainChrDef *def) if (!def) return; =20 - switch (def->deviceType) { - case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: + if (def->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL) { switch (def->targetType) { case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD: g_free(def->target.addr); @@ -2916,10 +2915,6 @@ void virDomainChrDefFree(virDomainChrDef *def) g_free(def->target.name); break; } - break; - - default: - break; } =20 virObjectUnref(def->source); --=20 2.35.3 From nobody Fri May 3 06:37:33 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=1658322748; cv=none; d=zohomail.com; s=zohoarc; b=JE0ExvqAg1MalCT4ieLXQnaiFox9lQbJqbaJeX+YW//DEgz3/BPr1bljvDCNXLspqr4UksIQVRtpNbZukKgoTpdrpUbbtOlFBqNmAJZ1c85Y0FCcyNSe6rLNp93EG2g7hqfVA0r8dT0qMiA9O43D0kotN24zYiKVWhyRVKhW8UY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322748; 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=xEI5IfvuEaDUqObsh5zoiTKrIXcyvZyAICnje455BUU=; b=hwXUG6KIF0zKVsqINtVaCRWOwfRDlu+J3UR5tHZNF/1sn0MLMn9MJ8wvUMltbInzP8UnMrh5mXF1mdtfrhZWK2IqM17K/PsHV8LBnmDXeJqp8Rkjds4HgZtHxR91OiJct10gpNwAAdxBGSKZb8ov92x2ArH22EY4LadhahUo6JQ= 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 1658322748786246.51063647544788; Wed, 20 Jul 2022 06:12:28 -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-444-onAwJCeCO6u1s0wyupF8mQ-1; Wed, 20 Jul 2022 09:12:18 -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 5CA2394E6F5; Wed, 20 Jul 2022 13:12: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 4961C40C1288; Wed, 20 Jul 2022 13:12: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 CFEBF18B5BF7; Wed, 20 Jul 2022 13:12:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7A3A81947066 for ; Wed, 20 Jul 2022 13:11:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6DBE240D296B; Wed, 20 Jul 2022 13:11:22 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 199E140D2962 for ; Wed, 20 Jul 2022 13:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322747; 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=xEI5IfvuEaDUqObsh5zoiTKrIXcyvZyAICnje455BUU=; b=JGgTKtKk8s5igZf57L//NZhvrEIEQ56sIwAlvAzO4Yb6Czr0I2z8CYQ/rUEQY/dYAHwU62 jFa7RjBIB0u3HHuZtbCxAvj38XiMKNWCmTiFh/F6QWbDZUrIHZ4WnsqAR3RpLtqOD0Mi6b r3+HiN0Funi+LFFJB3+dA5ADh6vpzLo= X-MC-Unique: onAwJCeCO6u1s0wyupF8mQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 6/9] domain_conf: rewrite virDomainSoundCodecDefFree() Date: Wed, 20 Jul 2022 15:11:09 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: 1658322750496100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova --- src/conf/domain_conf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f51476c968..88d50d27f5 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2955,10 +2955,8 @@ void virDomainSmartcardDefFree(virDomainSmartcardDef= *def) =20 void virDomainSoundCodecDefFree(virDomainSoundCodecDef *def) { - if (!def) - return; - - g_free(def); + if (def) + g_free(def); } =20 void virDomainSoundDefFree(virDomainSoundDef *def) --=20 2.35.3 From nobody Fri May 3 06:37:33 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=1658322721; cv=none; d=zohomail.com; s=zohoarc; b=O2yNQDr8+/HiULz/i55y48Hg0LnV3xjh2PMMP3sPUeZzEKzfsQO+00fdO+PBt+A/2/GPd9LsAiK5m9AfUAz6m+m0lPwzEP28hT86fEwd4DplLR+2h0zT5uTizB/0Oda+cywxz6NdnkXnc6HvW90U8vkeu+x/eJnqlgzeaPKGpug= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322721; 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=xTlqfHE84a1pFxRCoMSDB9a4MkPQ+yvIDAyM7EGCTH0=; b=XZel49ZfI9Zu0+xNXPIPgx2n/rFDocUWPrQ40/+arVKh+pll/xSF0aiTBb5BzWhPJ2J3APzxS9aejGX/k/DzVlDk2nvljdZGJYwSmdSTktabDugdwP+bsySZYnczTjZIt83jYXSKPrPIWwjNxZ5sQ5sbtJ3URvBsP4CaArNqEwU= 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 1658322721311439.11646089339854; Wed, 20 Jul 2022 06:12:01 -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-252-5KQA88LVP9qWmlwyny1gQw-1; Wed, 20 Jul 2022 09:11:55 -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 35FF01035342; Wed, 20 Jul 2022 13:11:53 +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 229FC141511A; Wed, 20 Jul 2022 13:11:53 +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 B8BF8194707F; Wed, 20 Jul 2022 13:11:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 21A211947066 for ; Wed, 20 Jul 2022 13:11:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0582F40D296B; Wed, 20 Jul 2022 13:11:23 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4B6F40D2962 for ; Wed, 20 Jul 2022 13:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322718; 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=xTlqfHE84a1pFxRCoMSDB9a4MkPQ+yvIDAyM7EGCTH0=; b=bCqIOUJ4+ja6SuBJCPLXoZ/MLUGVHUH52NFTNv38QkACwrnWUF0y7CqPuLULX6by82243n pomTIIf+CmIRH9lgsHzIrPUA2cgS7GGda6fKe+wbEyd6sukK79GSztVRcMoA7o3YVXbuBw kcS9AmWEbmuKi6E3ztfle8oLOjnrN5o= X-MC-Unique: 5KQA88LVP9qWmlwyny1gQw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 7/9] domain_conf: use early return in virDomainObjAssignDef() Date: Wed, 20 Jul 2022 15:11:10 +0200 Message-Id: <605a1b3f4da6bfb8ff45ddc9a99a02902a16b623.1658322264.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: 1658322721883100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova --- 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 88d50d27f5..1c29a2d929 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3918,22 +3918,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 Fri May 3 06:37:33 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=1658322788; cv=none; d=zohomail.com; s=zohoarc; b=V41l5oTCPHs550kzj1KmpM/2hkeTxOO6bs2sPS9yNcmNofok3kwjcJJJrUKUeQErU9hDyhL5p+PIPvba3IFwoy1LupvMUp5JhnBwhgUt11Nfn0vNlCzhimVl6fkMi5LnCFM4LkHkA2ZaTjz8Auo+O3qZ3G5fhDKHmH0Q5tcqKpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322788; 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=tMF4Zn8k5v6uSuyjG20HanhGovAs1K1ms0xxVVm5+VE=; b=QHNq2WycPMJuB2VOMHLRYqhoevMXArZ2Xa+QsB1w3mxZfMwn31bFW+Jtfj8ok7T/VJ0dY6qPnBplRIX0whHvFecusx9lBoQ0tf5jLS9tHOdsYfzOzcFmk6ATuN3ulzYDP6I8cfD2VAuIeUdSSY15aHovKsBYEW4IOZVmKizuVTU= 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 1658322788772817.1259852293299; Wed, 20 Jul 2022 06:13:08 -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-9-mudLugXXMCOfO7aeavr96w-1; Wed, 20 Jul 2022 09:13:03 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0491494E6EE; Wed, 20 Jul 2022 13:13:00 +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 E509F2026D64; Wed, 20 Jul 2022 13:12:59 +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 3FD551923CA3; Wed, 20 Jul 2022 13:12:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B85731947066 for ; Wed, 20 Jul 2022 13:11:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 91EAF40D296B; Wed, 20 Jul 2022 13:11:23 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C82B40D2962 for ; Wed, 20 Jul 2022 13:11:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322787; 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=tMF4Zn8k5v6uSuyjG20HanhGovAs1K1ms0xxVVm5+VE=; b=LQrb5AlCFjs0CBYZD2H0yWacV1vK1bUTtqp7SOp8gf5kc8+bZI1rgyWHa3ZuVLhQGk7a2H ucN5HEQSg7GcLs8uR9+entPsiEjDVYT7+t6+rd5GKPh2SCztWmPApcQ1EO2Xr06fYLrOIZ S5i+mPYzt+CsiCNcanysCfhPBEMTGL8= X-MC-Unique: mudLugXXMCOfO7aeavr96w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 8/9] domain_conf: rewrite conditions in virDomainObjWaitUntil() Date: Wed, 20 Jul 2022 15:11:11 +0200 Message-Id: <0892e8f93ec408bab448571c3bc70e66098fd81a.1658322264.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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.4 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: 1658322790665100003 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 --- 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 1c29a2d929..e52f39c809 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3999,15 +3999,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 Fri May 3 06:37:33 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=1658322726; cv=none; d=zohomail.com; s=zohoarc; b=aYuHc4mwJxjU0olw839n6/eElad4Ves2UFY6Regtux7QTomlnwJrmhu8r1Xj1sW8IBxcYZG45lxhuT/2OtcE44pMt/rHLfSPuimuZyHnjFvgNV2AxVAYLBTqcZw7m5gZWCZQKnvJRZEkoFCznBQwDOelgsJolPEMumfGKtxFIcE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658322726; 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=UXT8t7WPH4vwUJ9UfV0izl/1kkGWdXnyJFolK6p67+s=; b=jWvvTfNWEAqsNH3UrCU9OHjfxlVdCLykXSmua6dBRFg3UiM9Rs9SjWl3Bi4xj7oa5wT3cf3nDazhmNOhJnUu/+1qo83vlfS25S3pPpkdS3g8Qimy7uTgNI+Axo728MZlSt2M0oT8gOg53nsPCJk4HUFxnx9VOG//jPvgccV/cB8= 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 1658322726913567.583914896691; Wed, 20 Jul 2022 06:12:06 -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-xmL8woaPOqaQwzYhpIaeXw-1; Wed, 20 Jul 2022 09:11:44 -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 6A9852806AB9; Wed, 20 Jul 2022 13:11:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1DF5404C6C0; Wed, 20 Jul 2022 13:11:39 +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 7B51D194706C; Wed, 20 Jul 2022 13:11:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4BF181947066 for ; Wed, 20 Jul 2022 13:11:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 296D840D296B; Wed, 20 Jul 2022 13:11:24 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8CDB40D2962 for ; Wed, 20 Jul 2022 13:11:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658322725; 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=UXT8t7WPH4vwUJ9UfV0izl/1kkGWdXnyJFolK6p67+s=; b=RE8i46I2Rn3T+K1qQXKRcfkyITjsKZP42HnBKzZ6x5IhuTKJ6Uklesa7T4tUFb5b5XAUP2 pVoWWHpG5etVWqFbKr5ukRBAhXyPyq6TDdg+Vz4aY7OW3BcvmAMEf9mT2QTIrgILon5afo 3EvwWX845D+3HpQmEBpaMYGty6rzl24= X-MC-Unique: xmL8woaPOqaQwzYhpIaeXw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 9/9] domain_conf: rewrite variable setting to ternary operator Date: Wed, 20 Jul 2022 15:11:12 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: 1658322727691100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Kristina Hanicova --- 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 e52f39c809..b600bfec31 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4206,12 +4206,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) ? true : false; =20 if (virDomainObjIsActive(vm) && flags & VIR_DOMAIN_AFFECT_CONFIG) return vm->newDef; --=20 2.35.3