From nobody Mon Feb 9 08:34:12 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=1578594869; cv=none; d=zohomail.com; s=zohoarc; b=Mtnl8fe1/bA3RppR7rvu1F/n0j/j2gcHgdc+vPjU3jKDzmU6uAQ3fW7Jk7EnbeU6wFDhsAyUx7qtakP4ZwIYsCJLH8EUFNnmW5qUZiAOJFV2ixNtsgZjUPFS7q/shV7hI506utnS8izzrfEp7WB/jkXckLepNLqVH9MXOeLdeCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578594869; 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=8Zm6Zvs0p6g591MjyzPWOYEe4qGWkEl/fjdvtj1et64=; b=kG23K1jk73xvDKpXIjGeDtq1c3O9S9o5Clxq6yP1gdg3ROEg6eVsJtWFJtgXadiFZzj4jMhQ9nHh6TRH7MJ+lyERlHhTbPHx08yxkDFDwiolixYteYzzGtGODEgcHWMO1c8RP7geeoM6ijZfci2swj5r93OcomANusf3r9RZH5g= 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 157859486926813.972484897327604; Thu, 9 Jan 2020 10:34:29 -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-414-AKE0lpTTNauep6RZ-08CKg-1; Thu, 09 Jan 2020 13:34:25 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2542B801E67; Thu, 9 Jan 2020 18:34:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EEEDC5DA2C; Thu, 9 Jan 2020 18:34:18 +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 A082B18089D8; Thu, 9 Jan 2020 18:34:18 +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 009IY9XO019860 for ; Thu, 9 Jan 2020 13:34:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6586D13AF61; Thu, 9 Jan 2020 18:34:09 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 606E013BBAE for ; Thu, 9 Jan 2020 18:34:09 +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 42064803015 for ; Thu, 9 Jan 2020 18:34:09 +0000 (UTC) Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-eNFFDrxGOFuQZ9U1oNmaKw-1; Thu, 09 Jan 2020 13:34:07 -0500 Received: by mail-qk1-f194.google.com with SMTP id a203so6957685qkc.3 for ; Thu, 09 Jan 2020 10:34:07 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2020 10:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578594868; 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=8Zm6Zvs0p6g591MjyzPWOYEe4qGWkEl/fjdvtj1et64=; b=J+aeh66GzcZzxFi5Yn2bNmX5TCZwFpA1b61VAu2U6xgHsz+1ucypxkTwSKNq/tA3mjHmyF edYF7wRcUJ+a9qXkOEWNi3BXWCsP87tWp6IxTial3tCsOUtqUiY9UFb57bVmMgMZzhnBNh j5RARo1jKMI8IYmfNhbLlpTGpTUXNZE= 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=8jdcM1BFg7SpO1VDkG9DCwz6Jy9XNotq5IiohhW1CDM=; b=OOhbvrmu9D+zHAZTHC6kp5wGKSk6PehFEftB/MARkGh+GCguPXKQ9+CPeWmmvf4jKd e8S8oI0Kfuz53l7KqWEnNGFPstLpXVx1Mb+1ST+i71bNmunxDQN6gm1pEihcfIFjcUDu Qv8eZivFnIAvP2DQsIT0BkfrQAbSEVWnNPPsJWzZ0v1fT1sfvfXxGtsUMNG++V6uUCvG LcuCo+R2vxIjHfXkDuaiCZNFHnG1Om8ef+MHIEYcldVwt6a7i3iNfOYuqXFWBFqNVuLL qC2+zDjDze6mD+C2IpKlJf/KkhaeCrR4H3SEBK76UndoDSGlQAhVm91c35rHArZUWcZx dCtg== X-Gm-Message-State: APjAAAUOmcv0wiCkST2mOJR0FpvFYlgNqEerWjDhsKoAZ/L/LXTxVWzE LgdYjuj133H9fpdoigUnWYYm7XOdIP0= X-Google-Smtp-Source: APXvYqyRYsE453JZVVs6ZqdDY4xe16bNSAOzYpMV5XOEzHxmLsSf9TOIT7L1LT2MgrWfxyf5qaCJZg== X-Received: by 2002:a37:664d:: with SMTP id a74mr10746132qkc.4.1578594846558; Thu, 09 Jan 2020 10:34:06 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Thu, 9 Jan 2020 15:33:48 -0300 Message-Id: <20200109183348.1362138-9-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: eNFFDrxGOFuQZ9U1oNmaKw-1 X-MC-Unique: AKE0lpTTNauep6RZ-08CKg-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 009IY9XO019860 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 8/8] qemu_domain_address.c: turn qemuDomainFillDeviceIsolationGroup 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.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Starting on commit 1f43393283ff, qemuDomainFillDeviceIsolationGroup() returns 0 in all circunstances. Let's turn it to 'void' make it clearer that the function will not fail. This also spares a check for < 0 return in qemu_hotplug.c. The qemuDomainFillDeviceIsolationGroupIter() callback now returns 0 at all times - which is already happening anyway. Refer to 1f43393283ff commit message for more details on why the function was changed to never return an error. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_domain_address.c | 20 ++++++++++---------- src/qemu/qemu_domain_address.h | 2 +- src/qemu/qemu_hotplug.c | 6 ++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 9e3bcc434d..4fb9db1e14 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1252,7 +1252,7 @@ qemuDomainFindUnusedIsolationGroup(virDomainDefPtr de= f) * * Return: 0 on success, <0 on failure * */ -int +void qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, virDomainDeviceDefPtr dev) { @@ -1270,7 +1270,7 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr de= f, /* Only PCI host devices are subject to isolation */ if (hostdev->mode !=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS || hostdev->source.subsys.type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYP= E_PCI) { - return 0; + return; } =20 hostAddr =3D &hostdev->source.subsys.u.pci.addr; @@ -1278,7 +1278,7 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr de= f, /* If a non-default isolation has already been assigned to the * device, we can avoid looking up the information again */ if (info->isolationGroup > 0) - return 0; + return; =20 /* The isolation group depends on the IOMMU group assigned by the = host */ tmp =3D virPCIDeviceAddressGetIOMMUGroupNum(hostAddr); @@ -1288,7 +1288,7 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr de= f, "%04x:%02x:%02x.%x, device won't be isolated", hostAddr->domain, hostAddr->bus, hostAddr->slot, hostAddr->function); - return 0; + return; } =20 /* The isolation group for a host device is its IOMMU group, @@ -1314,13 +1314,13 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr = def, * require us to isolate the guest device, so we can skip them */ if (iface->type !=3D VIR_DOMAIN_NET_TYPE_NETWORK || virDomainNetResolveActualType(iface) !=3D VIR_DOMAIN_NET_TYPE_= HOSTDEV) { - return 0; + return; } =20 /* If a non-default isolation has already been assigned to the * device, we can avoid looking up the information again */ if (info->isolationGroup > 0) - return 0; + return; =20 /* Obtain a synthetic isolation group for the device, since at this * point in time we don't have access to the IOMMU group of the ho= st @@ -1332,7 +1332,7 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr de= f, "configured to use hostdev-backed network '%s', " "device won't be isolated", iface->data.network.name); - return 0; + return; } =20 info->isolationGroup =3D tmp; @@ -1341,8 +1341,6 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr de= f, "hostdev-backed network '%s' is %u", iface->data.network.name, info->isolationGroup); } - - return 0; } =20 =20 @@ -1364,7 +1362,9 @@ qemuDomainFillDeviceIsolationGroupIter(virDomainDefPt= r def, virDomainDeviceInfoPtr info G_GNUC_= UNUSED, void *opaque G_GNUC_UNUSED) { - return qemuDomainFillDeviceIsolationGroup(def, dev); + qemuDomainFillDeviceIsolationGroup(def, dev); + + return 0; } =20 =20 diff --git a/src/qemu/qemu_domain_address.h b/src/qemu/qemu_domain_address.h index bf04e6bfdb..7ef3308246 100644 --- a/src/qemu/qemu_domain_address.h +++ b/src/qemu/qemu_domain_address.h @@ -49,7 +49,7 @@ int qemuDomainEnsurePCIAddress(virDomainObjPtr obj, virQEMUDriverPtr driver) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); =20 -int qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, +void qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, virDomainDeviceDefPtr dev) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 31d455505b..cb5d587940 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1598,11 +1598,9 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr drive= r, if (qemuAssignDeviceHostdevAlias(vm->def, &info->alias, -1) < 0) goto error; =20 - if (qemuDomainIsPSeries(vm->def)) { + if (qemuDomainIsPSeries(vm->def)) /* Isolation groups are only relevant for pSeries guests */ - if (qemuDomainFillDeviceIsolationGroup(vm->def, &dev) < 0) - goto error; - } + qemuDomainFillDeviceIsolationGroup(vm->def, &dev); =20 if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0) goto error; --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list