From nobody Sun Feb 8 10:33:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578594902; cv=none; d=zohomail.com; s=zohoarc; b=NGdrp7iKruU7WaKcPz8zae0Ybo9v0ExvI5CysaOr4e7f8AaFzxaFHcoNrIcgx5UWLNUy1xIVIzQegyCUxlXuw3Q367ZAVK+ymoe+T+40MGxCHWHsgKTqXAuQszArfYV5VGtMB63n1gu5qYPLKWFXBLXu95gryuMpu3XXC0DvucQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578594902; h=Content-Type:Content-Transfer-Encoding:Cc: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=lXlt3wJQwpWhR5t7PSAENuX2ZaUrH+WDcCioOYLbZGw=; b=GcxN4NoINFV9w6Oo4M7VvSbRgt7wuD/haJaelG1X+VBgg4npDH0SV7g4jXWFsfsJZLyOiTaWXNk2Xrv4h5RwLnBKjVNmkrZ1ujChLalHp2MzKCWGCaAzuA3eD0wuCLW4K4m+E5RpflCKATtLoSeX8Zj0BVm09BVtx5awLtdUcqE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1578594902990218.32581348733004; Thu, 9 Jan 2020 10:35:02 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-altm_pgCNzWZbu0Son8Ufg-1; Thu, 09 Jan 2020 13:34:22 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A565318A6ECA; Thu, 9 Jan 2020 18:34:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BBFA272A6; Thu, 9 Jan 2020 18:34:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3ADA2503D0; Thu, 9 Jan 2020 18:34:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 009IY8td019853 for ; Thu, 9 Jan 2020 13:34:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 574AA13BBAE; Thu, 9 Jan 2020 18:34:08 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51DBA13BBA8 for ; Thu, 9 Jan 2020 18:34:08 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 345548C092C for ; Thu, 9 Jan 2020 18:34:08 +0000 (UTC) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-130-k9TUSzf3Ny6im9RbfQ7Q4w-1; Thu, 09 Jan 2020 13:34:06 -0500 Received: by mail-qt1-f196.google.com with SMTP id i13so1883136qtr.3 for ; Thu, 09 Jan 2020 10:34:05 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:541e:7a5e:37ad:989b:4530]) by smtp.gmail.com with ESMTPSA id g52sm3902267qta.58.2020.01.09.10.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2020 10:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578594901; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=lXlt3wJQwpWhR5t7PSAENuX2ZaUrH+WDcCioOYLbZGw=; b=htPRykEaw17G5pw80BQHZA4DaF9aa9gLnJhLQ25msbzEQ06Pfy+w46EDVU5lLi4kQ1qu3U ZVIfr/vrnMCUqc1ntF9mE4pj0tcnpgDX2p4RRS+sWpLp9ZcexmEw9aMH8If1DWGRTiUJ3q Ry9oVQqvCNEvqIN2P+JO29sAX9AZ/KU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F4WPWcCHdw8NVKT2wwILojtBOCyMtA9uBSXU3WeMLDQ=; b=VG9PRbt3oyz34zDvOeKWDt9xMsZ1vFQjzEZ7xEQ0+T7rywH/CRts2eKoZMEv3sF+qb 7P5FpUM+4HvzSb1Dwry13yPpNjB/tJduYPsjpx++fYjCbRVJqFOxK+dNcCwMgGZctT61 n7qIS5al44TUQvMaempo+b/fvr5GKcajjxl1FBlXfKFugvp6uDUr1lZzH/x6dUwbxk91 KtS55ZN8KMtyw4J6WOh4kVjDWz1nhv0aGJqWvvee/qM2eE7juq2cyc8WAymxN+1qs2eN cBRnviatD31vh0dT9CH4pkDpY+igl/16xg7FLE5xYGlRFG02BKfhQrizwdLTkwQFRHY7 OtsA== X-Gm-Message-State: APjAAAVIlNsxA0SH9qq7Fa20bUCq7wFPZSCjHag4F2Tl+qd/hLo3Pa04 SKIGV4M8yC0hAlrL24ub9xzlOUpaSZg= X-Google-Smtp-Source: APXvYqx+LkvsZ055yHNu6b36SGMNIyRbdH6PI4QwhkZ2jWcdBfzi/y8147N6C04HOJA+u4aib6t8vQ== X-Received: by 2002:aed:2c03:: with SMTP id f3mr8998404qtd.80.1578594845391; Thu, 09 Jan 2020 10:34:05 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Thu, 9 Jan 2020 15:33:47 -0300 Message-Id: <20200109183348.1362138-8-danielhb413@gmail.com> In-Reply-To: <20200109183348.1362138-1-danielhb413@gmail.com> References: <20200109183348.1362138-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: k9TUSzf3Ny6im9RbfQ7Q4w-1 X-MC-Unique: altm_pgCNzWZbu0Son8Ufg-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 009IY8td019853 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 7/8] qemu_domain.c: turn qemuDomainChrDefDropDefaultPath to void X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" qemuDomainChrDefDropDefaultPath() returns an int, but it's always returning 0. Callers are checking for result < 0 to run their cleanup code needlessly. Turn the function to 'void' and adjust the callers. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_domain.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 931554eeb6..153f5897bc 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8468,20 +8468,19 @@ qemuDomainDefaultNetModel(const virDomainDef *def, * This function clears the path for migration as well, so we need to clear * the path even if we are not storing it in the XML. */ -static int +static void qemuDomainChrDefDropDefaultPath(virDomainChrDefPtr chr, virQEMUDriverPtr driver) { g_autoptr(virQEMUDriverConfig) cfg =3D NULL; virBuffer buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *regexp =3D NULL; - int ret =3D -1; =20 if (chr->deviceType !=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL || chr->targetType !=3D VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO || chr->source->type !=3D VIR_DOMAIN_CHR_TYPE_UNIX || !chr->source->data.nix.path) { - return 0; + return; } =20 cfg =3D virQEMUDriverGetConfig(driver); @@ -8494,9 +8493,6 @@ qemuDomainChrDefDropDefaultPath(virDomainChrDefPtr ch= r, =20 if (virStringMatch(chr->source->data.nix.path, regexp)) VIR_FREE(chr->source->data.nix.path); - - ret =3D 0; - return ret; } =20 =20 @@ -8758,8 +8754,7 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, =20 /* clear auto generated unix socket path for inactive definitions */ if (parseFlags & VIR_DOMAIN_DEF_PARSE_INACTIVE) { - if (qemuDomainChrDefDropDefaultPath(chr, driver) < 0) - return -1; + qemuDomainChrDefDropDefaultPath(chr, driver); =20 /* For UNIX chardev if no path is provided we generate one. * This also implies that the mode is 'bind'. */ @@ -10118,10 +10113,8 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr dr= iver, } } =20 - for (i =3D 0; i < def->nchannels; i++) { - if (qemuDomainChrDefDropDefaultPath(def->channels[i], driver) = < 0) - goto cleanup; - } + for (i =3D 0; i < def->nchannels; i++) + qemuDomainChrDefDropDefaultPath(def->channels[i], driver); =20 for (i =3D 0; i < def->nserials; i++) { virDomainChrDefPtr serial =3D def->serials[i]; --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list