From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230248902282.0893425884616; Fri, 23 Jun 2017 08:04:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A99D47A176; Fri, 23 Jun 2017 15:04:02 +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 7CDA317561; Fri, 23 Jun 2017 15:04:02 +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 21FF4264; Fri, 23 Jun 2017 15:04:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF3dnK004113 for ; Fri, 23 Jun 2017 11:03:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 964336E8D7; Fri, 23 Jun 2017 15:03:39 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9941D6E8D3 for ; Fri, 23 Jun 2017 15:03:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A99D47A176 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A99D47A176 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:03 +0800 Message-Id: <1498230208-14144-2-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 01/26] conf: Remove obsolete comment 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 23 Jun 2017 15:04:03 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The virDomainDeviceInfoIsSet() function no longer exists. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- src/conf/device_conf.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index 48782be..14be2e3 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -134,10 +134,6 @@ struct _virDomainDeviceDimmAddress { typedef struct _virDomainDeviceInfo virDomainDeviceInfo; typedef virDomainDeviceInfo *virDomainDeviceInfoPtr; struct _virDomainDeviceInfo { - /* If adding to this struct, ensure that - * virDomainDeviceInfoIsSet() is updated - * to consider the new fields - */ char *alias; int type; /* virDomainDeviceAddressType */ union { --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230562320221.64844423301145; Fri, 23 Jun 2017 08:09:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF9F87C842; Fri, 23 Jun 2017 15:09:15 +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 58F796EC9C; Fri, 23 Jun 2017 15:09:15 +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 66EFF262; Fri, 23 Jun 2017 15:09:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF3f7S004125 for ; Fri, 23 Jun 2017 11:03:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 576A36E8D7; Fri, 23 Jun 2017 15:03:41 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E7346E8D3 for ; Fri, 23 Jun 2017 15:03:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DF9F87C842 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DF9F87C842 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:04 +0800 Message-Id: <1498230208-14144-3-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 02/26] conf: Make virDomainPCIAddressSetGrow() private 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 23 Jun 2017 15:09:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There are no external users. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- src/conf/domain_addr.c | 2 +- src/conf/domain_addr.h | 5 ----- src/libvirt_private.syms | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 639168e..9c809e8 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -362,7 +362,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPt= r bus, * 0 =3D no action performed * >0 =3D number of buses added */ -int +static int virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs, virPCIDeviceAddressPtr addr, virDomainPCIConnectFlags flags) diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index f884b8a..efa97ca 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -145,11 +145,6 @@ bool virDomainPCIAddressSlotInUse(virDomainPCIAddressS= etPtr addrs, virPCIDeviceAddressPtr addr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 -int virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, - virDomainPCIConnectFlags flags) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - int virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs, virPCIDeviceAddressPtr addr, virDomainPCIConnectFlags flags) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index c1e9471..175370e 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -115,7 +115,6 @@ virDomainPCIAddressReserveNextAddr; virDomainPCIAddressSetAllMulti; virDomainPCIAddressSetAlloc; virDomainPCIAddressSetFree; -virDomainPCIAddressSetGrow; virDomainPCIAddressSlotInUse; virDomainPCIAddressValidate; virDomainPCIControllerModelToConnectType; --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230231887742.5156256602451; Fri, 23 Jun 2017 08:03:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 741D4163485; Fri, 23 Jun 2017 15:03:47 +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 3D8D56EC94; Fri, 23 Jun 2017 15:03:47 +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 692D01853E2C; Fri, 23 Jun 2017 15:03:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF3iNP004140 for ; Fri, 23 Jun 2017 11:03:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 822C06E8D3; Fri, 23 Jun 2017 15:03:44 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9BDD76E8D7 for ; Fri, 23 Jun 2017 15:03:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 741D4163485 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 741D4163485 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:05 +0800 Message-Id: <1498230208-14144-4-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 03/26] conf: Make virDomainPCIAddressFlagsCompatible() private 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 23 Jun 2017 15:03:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There are no external users. Signed-off-by: Andrea Bolognani Reviewed-by tags have been collected, so figuring out which Reviewed-by: Laine Stump --- src/conf/domain_addr.c | 2 +- src/conf/domain_addr.h | 8 -------- src/libvirt_private.syms | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 9c809e8..0a7cb00 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -103,7 +103,7 @@ virDomainPCIControllerConnectTypeToModel(virDomainPCICo= nnectFlags flags) } =20 =20 -bool +static bool virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr, const char *addrStr, virDomainPCIConnectFlags busFlags, diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index efa97ca..0c7905b 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -121,14 +121,6 @@ virDomainPCIAddressSetPtr virDomainPCIAddressSetAlloc(= unsigned int nbuses); =20 void virDomainPCIAddressSetFree(virDomainPCIAddressSetPtr addrs); =20 -bool virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr, - const char *addrStr, - virDomainPCIConnectFlags busFlags, - virDomainPCIConnectFlags devFlags, - bool reportError, - bool fromConfig) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - bool virDomainPCIAddressValidate(virDomainPCIAddressSetPtr addrs, virPCIDeviceAddressPtr addr, const char *addrStr, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 175370e..c8862a2 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -108,7 +108,6 @@ virDomainGetBlkioParametersAssignFromDef; virDomainPCIAddressAsString; virDomainPCIAddressBusSetModel; virDomainPCIAddressEnsureAddr; -virDomainPCIAddressFlagsCompatible; virDomainPCIAddressReleaseAddr; virDomainPCIAddressReserveAddr; virDomainPCIAddressReserveNextAddr; --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230253193298.174806145448; Fri, 23 Jun 2017 08:04:13 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6E45F30AF6E; Fri, 23 Jun 2017 15:04:06 +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 330326C53C; Fri, 23 Jun 2017 15:04:06 +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 E3C441853E2E; Fri, 23 Jun 2017 15:04:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF3kAG004150 for ; Fri, 23 Jun 2017 11:03:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 119DC6F9C8; Fri, 23 Jun 2017 15:03:46 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2232E6F9C5 for ; Fri, 23 Jun 2017 15:03:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6E45F30AF6E Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6E45F30AF6E From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:06 +0800 Message-Id: <1498230208-14144-5-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 04/26] conf: Tweak virDomainPCIAddressGetNextAddr() signature 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 23 Jun 2017 15:04:07 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Move @function after @flags to match other functions in the same module like virDomainPCIAddressReserveNextAddr(). Also move virDomainPCIAddressReserveNextAddr() closer to virDomainPCIAddressReserveAddr() in the header file. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- src/conf/domain_addr.c | 6 +++--- src/conf/domain_addr.h | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 0a7cb00..b588b36 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -738,8 +738,8 @@ virDomainPCIAddressFindUnusedFunctionOnBus(virDomainPCI= AddressBusPtr bus, static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, virPCIDeviceAddressPtr next_addr, - int function, - virDomainPCIConnectFlags flags) + virDomainPCIConnectFlags flags, + int function) { /* default to starting the search for a free slot from * the first slot of domain 0 bus 0... @@ -845,7 +845,7 @@ virDomainPCIAddressReserveNextAddr(virDomainPCIAddressS= etPtr addrs, { virPCIDeviceAddress addr; =20 - if (virDomainPCIAddressGetNextAddr(addrs, &addr, function, flags) < 0) + if (virDomainPCIAddressGetNextAddr(addrs, &addr, flags, function) < 0) return -1; =20 if (virDomainPCIAddressReserveAddrInternal(addrs, &addr, flags, false)= < 0) diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 0c7905b..dbef4b1 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -142,6 +142,12 @@ int virDomainPCIAddressReserveAddr(virDomainPCIAddress= SetPtr addrs, virDomainPCIConnectFlags flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 +int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, + virDomainDeviceInfoPtr dev, + virDomainPCIConnectFlags flags, + int function) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + int virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs, virDomainDeviceInfoPtr dev, virDomainPCIConnectFlags flags) @@ -151,12 +157,6 @@ int virDomainPCIAddressReleaseAddr(virDomainPCIAddress= SetPtr addrs, virPCIDeviceAddressPtr addr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 -int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, - virDomainDeviceInfoPtr dev, - virDomainPCIConnectFlags flags, - int function) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - void virDomainPCIAddressSetAllMulti(virDomainDefPtr def) ATTRIBUTE_NONNULL(1); =20 --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 149823025796563.78347085062194; Fri, 23 Jun 2017 08:04:17 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 0B5AAC04F4A8; Fri, 23 Jun 2017 15:04:11 +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 D616E6C93C; Fri, 23 Jun 2017 15:04:10 +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 7086F1853E36; Fri, 23 Jun 2017 15:04:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF3mMa004160 for ; Fri, 23 Jun 2017 11:03:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 46D016F9C8; Fri, 23 Jun 2017 15:03:48 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 562E76F9CF for ; Fri, 23 Jun 2017 15:03:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0B5AAC04F4A8 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0B5AAC04F4A8 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:07 +0800 Message-Id: <1498230208-14144-6-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 05/26] qemu: Clean up qemuDomainAttachHostPCIDevice() 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 23 Jun 2017 15:04:11 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We use hostdev->info frequently enough that having a shorter name for it makes the code more readable. We will also be adding even more uses later on. Signed-off-by: Andrea Bolognani Reviewed-by tags have been collected, so figuring out which Reviewed-by: Laine Stump --- src/qemu/qemu_hotplug.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index a486fb4..d9259ab 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1390,6 +1390,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, qemuDomainObjPrivatePtr priv =3D vm->privateData; virDomainDeviceDef dev =3D { VIR_DOMAIN_DEVICE_HOSTDEV, { .hostdev =3D hostdev } }; + virDomainDeviceInfoPtr info =3D hostdev->info; int ret; char *devstr =3D NULL; int configfd =3D -1; @@ -1462,7 +1463,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, if (backend !=3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) teardownlabel =3D true; =20 - if (qemuAssignDeviceHostdevAlias(vm->def, &hostdev->info->alias, -1) <= 0) + if (qemuAssignDeviceHostdevAlias(vm->def, &info->alias, -1) < 0) goto error; if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0) goto error; @@ -1471,8 +1472,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PCI_CONFIGFD)) { configfd =3D qemuOpenPCIConfig(hostdev); if (configfd >=3D 0) { - if (virAsprintf(&configfd_name, "fd-%s", - hostdev->info->alias) < 0) + if (virAsprintf(&configfd_name, "fd-%s", info->alias) < 0) goto error; } } @@ -1517,7 +1517,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, VIR_WARN("Unable to remove host device from /dev"); =20 if (releaseaddr) - qemuDomainReleaseDeviceAddress(vm, hostdev->info, NULL); + qemuDomainReleaseDeviceAddress(vm, info, NULL); =20 qemuHostdevReAttachPCIDevices(driver, vm->def->name, &hostdev, 1); =20 --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230258999663.2668023210166; Fri, 23 Jun 2017 08:04:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5564B8159; Fri, 23 Jun 2017 15:04:15 +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 AAEF16F9EA; Fri, 23 Jun 2017 15:04:15 +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 4504D1853E36; Fri, 23 Jun 2017 15:04:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF3nj5004175 for ; Fri, 23 Jun 2017 11:03:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id B82776F9C4; Fri, 23 Jun 2017 15:03:49 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3C4E6E8D7 for ; Fri, 23 Jun 2017 15:03:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D5564B8159 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D5564B8159 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:08 +0800 Message-Id: <1498230208-14144-7-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 06/26] tests: Update qemumemlock data 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 23 Jun 2017 15:04:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use 0001:01:00.0 instead of 0000:04:02.0 as the source address for the host device. This doesn't change anything at the moment, but it will make a difference later on. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- tests/qemumemlockdata/qemumemlock-pc-hardlimit+hostdev.xml | 2= +- tests/qemumemlockdata/qemumemlock-pc-hardlimit+locked+hostdev.xml | 2= +- tests/qemumemlockdata/qemumemlock-pc-hostdev.xml | 2= +- tests/qemumemlockdata/qemumemlock-pc-locked+hostdev.xml | 2= +- tests/qemumemlockdata/qemumemlock-pseries-hardlimit+hostdev.xml | 2= +- tests/qemumemlockdata/qemumemlock-pseries-hardlimit+locked+hostdev.xml | 2= +- tests/qemumemlockdata/qemumemlock-pseries-hostdev.xml | 2= +- tests/qemumemlockdata/qemumemlock-pseries-locked+hostdev.xml | 2= +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/qemumemlockdata/qemumemlock-pc-hardlimit+hostdev.xml b/t= ests/qemumemlockdata/qemumemlock-pc-hardlimit+hostdev.xml index 5443145..e03f5a5 100644 --- a/tests/qemumemlockdata/qemumemlock-pc-hardlimit+hostdev.xml +++ b/tests/qemumemlockdata/qemumemlock-pc-hardlimit+hostdev.xml @@ -13,7 +13,7 @@ -
+
diff --git a/tests/qemumemlockdata/qemumemlock-pc-hardlimit+locked+hostdev.= xml b/tests/qemumemlockdata/qemumemlock-pc-hardlimit+locked+hostdev.xml index 8184eef..7070e5a 100644 --- a/tests/qemumemlockdata/qemumemlock-pc-hardlimit+locked+hostdev.xml +++ b/tests/qemumemlockdata/qemumemlock-pc-hardlimit+locked+hostdev.xml @@ -16,7 +16,7 @@ -
+
diff --git a/tests/qemumemlockdata/qemumemlock-pc-hostdev.xml b/tests/qemum= emlockdata/qemumemlock-pc-hostdev.xml index 6c058a9..cd517ee 100644 --- a/tests/qemumemlockdata/qemumemlock-pc-hostdev.xml +++ b/tests/qemumemlockdata/qemumemlock-pc-hostdev.xml @@ -10,7 +10,7 @@ -
+
diff --git a/tests/qemumemlockdata/qemumemlock-pc-locked+hostdev.xml b/test= s/qemumemlockdata/qemumemlock-pc-locked+hostdev.xml index fbc1dc3..da79cb5 100644 --- a/tests/qemumemlockdata/qemumemlock-pc-locked+hostdev.xml +++ b/tests/qemumemlockdata/qemumemlock-pc-locked+hostdev.xml @@ -13,7 +13,7 @@ -
+
diff --git a/tests/qemumemlockdata/qemumemlock-pseries-hardlimit+hostdev.xm= l b/tests/qemumemlockdata/qemumemlock-pseries-hardlimit+hostdev.xml index ddd3b47..baf0649 100644 --- a/tests/qemumemlockdata/qemumemlock-pseries-hardlimit+hostdev.xml +++ b/tests/qemumemlockdata/qemumemlock-pseries-hardlimit+hostdev.xml @@ -13,7 +13,7 @@ -
+
diff --git a/tests/qemumemlockdata/qemumemlock-pseries-hardlimit+locked+hos= tdev.xml b/tests/qemumemlockdata/qemumemlock-pseries-hardlimit+locked+hostd= ev.xml index 73c28c1..04ae4e9 100644 --- a/tests/qemumemlockdata/qemumemlock-pseries-hardlimit+locked+hostdev.xml +++ b/tests/qemumemlockdata/qemumemlock-pseries-hardlimit+locked+hostdev.xml @@ -16,7 +16,7 @@ -
+
diff --git a/tests/qemumemlockdata/qemumemlock-pseries-hostdev.xml b/tests/= qemumemlockdata/qemumemlock-pseries-hostdev.xml index daf70a4..a52768c 100644 --- a/tests/qemumemlockdata/qemumemlock-pseries-hostdev.xml +++ b/tests/qemumemlockdata/qemumemlock-pseries-hostdev.xml @@ -10,7 +10,7 @@ -
+
diff --git a/tests/qemumemlockdata/qemumemlock-pseries-locked+hostdev.xml b= /tests/qemumemlockdata/qemumemlock-pseries-locked+hostdev.xml index 74212f1..f5abef0 100644 --- a/tests/qemumemlockdata/qemumemlock-pseries-locked+hostdev.xml +++ b/tests/qemumemlockdata/qemumemlock-pseries-locked+hostdev.xml @@ -13,7 +13,7 @@ -
+
--=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230566982784.2364808160105; Fri, 23 Jun 2017 08:09:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1874B14286A; Fri, 23 Jun 2017 15:09:21 +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 E0EBC53C6C; Fri, 23 Jun 2017 15:09:20 +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 99867265; Fri, 23 Jun 2017 15:09:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF3pZY004186 for ; Fri, 23 Jun 2017 11:03:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id AFD2F6F9CE; Fri, 23 Jun 2017 15:03:51 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A2096E8D7 for ; Fri, 23 Jun 2017 15:03:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1874B14286A Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1874B14286A From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:09 +0800 Message-Id: <1498230208-14144-8-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 07/26] tests: Mock IOMMU groups 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 23 Jun 2017 15:09:21 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Later on we're going to need access to information about IOMMU groups for host devices. Implement the support in virpcimock, and start using that mock library in a few QEMU test cases. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- tests/qemumemlocktest.c | 21 ++++++++++++++++++++- tests/qemuxml2argvtest.c | 25 ++++++++++++++++++++++--- tests/qemuxml2xmltest.c | 21 ++++++++++++++++++++- tests/virpcimock.c | 43 +++++++++++++++++++++++++++++++++++++------ 4 files changed, 99 insertions(+), 11 deletions(-) diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c index 6cf17a4..c0f1dc3 100644 --- a/tests/qemumemlocktest.c +++ b/tests/qemumemlocktest.c @@ -56,11 +56,25 @@ testCompareMemLock(const void *data) return ret; } =20 +# define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX" =20 static int mymain(void) { int ret =3D 0; + char *fakerootdir; + + if (VIR_STRDUP_QUIET(fakerootdir, FAKEROOTDIRTEMPLATE) < 0) { + fprintf(stderr, "Out of memory\n"); + abort(); + } + + if (!mkdtemp(fakerootdir)) { + fprintf(stderr, "Cannot create fakerootdir"); + abort(); + } + + setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); =20 abs_top_srcdir =3D getenv("abs_top_srcdir"); if (!abs_top_srcdir) @@ -124,12 +138,17 @@ mymain(void) DO_TEST("pseries-hardlimit+locked+hostdev", 2147483648); DO_TEST("pseries-locked+hostdev", VIR_DOMAIN_MEMORY_PARAM_UNLIMITED); =20 + if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) + virFileDeleteTree(fakerootdir); + qemuTestDriverFree(&driver); + VIR_FREE(fakerootdir); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN(mymain) +VIR_TEST_MAIN_PRELOAD(mymain, + abs_builddir "/.libs/virpcimock.so") =20 #else =20 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 27eea70..01c0a65 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -534,13 +534,27 @@ testCompareXMLToArgv(const void *data) return ret; } =20 +# define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX" =20 static int mymain(void) { int ret =3D 0; + char *fakerootdir; bool skipLegacyCPUs =3D false; =20 + if (VIR_STRDUP_QUIET(fakerootdir, FAKEROOTDIRTEMPLATE) < 0) { + fprintf(stderr, "Out of memory\n"); + abort(); + } + + if (!mkdtemp(fakerootdir)) { + fprintf(stderr, "Cannot create fakerootdir"); + abort(); + } + + setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); + abs_top_srcdir =3D getenv("abs_top_srcdir"); if (!abs_top_srcdir) abs_top_srcdir =3D abs_srcdir "/.."; @@ -2621,15 +2635,20 @@ mymain(void) DO_TEST_PARSE_ERROR("cpu-cache-passthrough3", QEMU_CAPS_KVM); DO_TEST_PARSE_ERROR("cpu-cache-passthrough-l3", QEMU_CAPS_KVM); =20 + if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) + virFileDeleteTree(fakerootdir); + qemuTestDriverFree(&driver); + VIR_FREE(fakerootdir); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 VIR_TEST_MAIN_PRELOAD(mymain, - abs_builddir "/.libs/qemuxml2argvmock.so", - abs_builddir "/.libs/virrandommock.so", - abs_builddir "/.libs/qemucpumock.so") + abs_builddir "/.libs/qemuxml2argvmock.so", + abs_builddir "/.libs/virrandommock.so", + abs_builddir "/.libs/qemucpumock.so", + abs_builddir "/.libs/virpcimock.so") =20 #else =20 diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 1307299..c74614c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -303,14 +303,28 @@ testInfoSet(struct testInfo *info, return -1; } =20 +# define FAKEROOTDIRTEMPLATE abs_builddir "/fakerootdir-XXXXXX" =20 static int mymain(void) { int ret =3D 0; + char *fakerootdir; struct testInfo info; virQEMUDriverConfigPtr cfg =3D NULL; =20 + if (VIR_STRDUP_QUIET(fakerootdir, FAKEROOTDIRTEMPLATE) < 0) { + fprintf(stderr, "Out of memory\n"); + abort(); + } + + if (!mkdtemp(fakerootdir)) { + fprintf(stderr, "Cannot create fakerootdir"); + abort(); + } + + setenv("LIBVIRT_FAKE_ROOT_DIR", fakerootdir, 1); + memset(&info, 0, sizeof(info)); =20 if (qemuTestDriverInit(&driver) < 0) @@ -1145,12 +1159,17 @@ mymain(void) DO_TEST("cpu-check-default-partial", NONE); DO_TEST("cpu-check-default-partial2", NONE); =20 + if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) + virFileDeleteTree(fakerootdir); + qemuTestDriverFree(&driver); + VIR_FREE(fakerootdir); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 -VIR_TEST_MAIN(mymain) +VIR_TEST_MAIN_PRELOAD(mymain, + abs_builddir "/.libs/virpcimock.so") =20 #else =20 diff --git a/tests/virpcimock.c b/tests/virpcimock.c index e9408aa..19b10f4 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -127,6 +127,7 @@ struct pciDevice { int vendor; int device; int class; + int iommuGroup; struct pciDriver *driver; /* Driver attached. NULL if attached to no= driver */ }; =20 @@ -190,6 +191,22 @@ make_file(const char *path, VIR_FREE(filepath); } =20 +static void +make_symlink(const char *path, + const char *name, + const char *target) +{ + char *filepath =3D NULL; + + if (virAsprintfQuiet(&filepath, "%s/%s", path, name) < 0) + ABORT_OOM(); + + if (symlink(target, filepath) < 0) + ABORT("Unable to create symlink filepath -> target"); + + VIR_FREE(filepath); +} + static int pci_read_file(const char *path, char *buf, @@ -322,7 +339,7 @@ pci_device_new_from_stub(const struct pciDevice *data) char *id; char *c; char *configSrc; - char tmp[32]; + char tmp[256]; struct stat sb; =20 if (VIR_STRDUP_QUIET(id, data->id) < 0) @@ -386,6 +403,20 @@ pci_device_new_from_stub(const struct pciDevice *data) ABORT("@tmp overflow"); make_file(devpath, "class", tmp, -1); =20 + if (snprintf(tmp, sizeof(tmp), + "%s/../../../kernel/iommu_groups/%d", + devpath, dev->iommuGroup) < 0) { + ABORT("@tmp overflow"); + } + if (virFileMakePath(tmp) < 0) + ABORT("Unable to create %s", tmp); + + if (snprintf(tmp, sizeof(tmp), + "../../../kernel/iommu_groups/%d", dev->iommuGroup) < 0) { + ABORT("@tmp overflow"); + } + make_symlink(devpath, "iommu_group", tmp); + if (pci_device_autobind(dev) < 0) ABORT("Unable to bind: %s", data->id); =20 @@ -821,12 +852,12 @@ init_env(void) MAKE_PCI_DEVICE("0000:00:02.0", 0x8086, 0x0046); MAKE_PCI_DEVICE("0000:00:03.0", 0x8086, 0x0048); MAKE_PCI_DEVICE("0001:00:00.0", 0x1014, 0x03b9, .class =3D 0x060400); - MAKE_PCI_DEVICE("0001:01:00.0", 0x8086, 0x105e); - MAKE_PCI_DEVICE("0001:01:00.1", 0x8086, 0x105e); + MAKE_PCI_DEVICE("0001:01:00.0", 0x8086, 0x105e, .iommuGroup =3D 2); + MAKE_PCI_DEVICE("0001:01:00.1", 0x8086, 0x105e, .iommuGroup =3D 2); MAKE_PCI_DEVICE("0005:80:00.0", 0x10b5, 0x8112, .class =3D 0x060400); - MAKE_PCI_DEVICE("0005:90:01.0", 0x1033, 0x0035); - MAKE_PCI_DEVICE("0005:90:01.1", 0x1033, 0x0035); - MAKE_PCI_DEVICE("0005:90:01.2", 0x1033, 0x00e0); + MAKE_PCI_DEVICE("0005:90:01.0", 0x1033, 0x0035, .iommuGroup =3D 3); + MAKE_PCI_DEVICE("0005:90:01.1", 0x1033, 0x0035, .iommuGroup =3D 3); + MAKE_PCI_DEVICE("0005:90:01.2", 0x1033, 0x00e0, .iommuGroup =3D 3); MAKE_PCI_DEVICE("0000:0a:01.0", 0x8086, 0x0047); MAKE_PCI_DEVICE("0000:0a:02.0", 0x8286, 0x0048); MAKE_PCI_DEVICE("0000:0a:03.0", 0x8386, 0x0048); --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230250783866.2038795563102; Fri, 23 Jun 2017 08:04:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88A9E65744; Fri, 23 Jun 2017 15:04:03 +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 2E2A480E70; Fri, 23 Jun 2017 15:04:03 +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 457AB1853E32; Fri, 23 Jun 2017 15:04:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF3xFO004200 for ; Fri, 23 Jun 2017 11:03:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1E0656E8D3; Fri, 23 Jun 2017 15:03:59 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 545126F9DB for ; Fri, 23 Jun 2017 15:03:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 88A9E65744 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 88A9E65744 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:10 +0800 Message-Id: <1498230208-14144-9-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 08/26] conf: Simplify slot allocation 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 23 Jun 2017 15:04:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The current algorithm for slot allocation tries to be clever and avoid looking at buses / slots more than once unless it's necessary. Unfortunately that makes the code more complex, and it will cause problem later on in some situations unless even more complex code is added. Since the performance gains are going to be pretty modest anyway, we can just get rid of the extra complexity and use a completely straighforward implementation instead. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- src/conf/domain_addr.c | 47 +++++++++-------------------------------------- src/conf/domain_addr.h | 2 -- 2 files changed, 9 insertions(+), 40 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index b588b36..86b1367 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -741,46 +741,34 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSet= Ptr addrs, virDomainPCIConnectFlags flags, int function) { - /* default to starting the search for a free slot from - * the first slot of domain 0 bus 0... - */ virPCIDeviceAddress a =3D { 0 }; - bool found =3D false; =20 if (addrs->nbuses =3D=3D 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("No PCI buses available"= )); goto error; } =20 - /* ...unless this search is for the exact same type of device as - * last time, then continue the search from the slot where we - * found the previous match (it's possible there will still be a - * function available on that slot). - */ - if (flags =3D=3D addrs->lastFlags) - a =3D addrs->lastaddr; - else - a.slot =3D addrs->buses[0].minSlot; - /* if the caller asks for "any function", give them function 0 */ if (function =3D=3D -1) a.function =3D 0; else a.function =3D function; =20 - while (a.bus < addrs->nbuses) { - if (virDomainPCIAddressFindUnusedFunctionOnBus(&addrs->buses[a.bus= ], - &a, function, + /* "Begin at the beginning," the King said, very gravely, "and go on + * till you come to the end: then stop." */ + for (a.bus =3D 0; a.bus < addrs->nbuses; a.bus++) { + virDomainPCIAddressBusPtr bus =3D &addrs->buses[a.bus]; + bool found =3D false; + + a.slot =3D bus->minSlot; + + if (virDomainPCIAddressFindUnusedFunctionOnBus(bus, &a, function, flags, &found) < 0)= { goto error; } =20 if (found) goto success; - - /* nothing on this bus, go to the next bus */ - if (++a.bus < addrs->nbuses) - a.slot =3D addrs->buses[a.bus].minSlot; } =20 /* There were no free slots after the last used one */ @@ -791,20 +779,6 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetP= tr addrs, /* this device will use the first slot of the new bus */ a.slot =3D addrs->buses[a.bus].minSlot; goto success; - } else if (flags =3D=3D addrs->lastFlags) { - /* Check the buses from 0 up to the last used one */ - for (a.bus =3D 0; a.bus <=3D addrs->lastaddr.bus; a.bus++) { - a.slot =3D addrs->buses[a.bus].minSlot; - - if (virDomainPCIAddressFindUnusedFunctionOnBus(&addrs->buses[a= .bus], - &a, function, - flags, &found) = < 0) { - goto error; - } - - if (found) - goto success; - } } =20 virReportError(VIR_ERR_INTERNAL_ERROR, @@ -851,9 +825,6 @@ virDomainPCIAddressReserveNextAddr(virDomainPCIAddressS= etPtr addrs, if (virDomainPCIAddressReserveAddrInternal(addrs, &addr, flags, false)= < 0) return -1; =20 - addrs->lastaddr =3D addr; - addrs->lastFlags =3D flags; - if (!addrs->dryRun) { dev->type =3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; dev->addr.pci =3D addr; diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index dbef4b1..c98a228 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -106,8 +106,6 @@ typedef virDomainPCIAddressBus *virDomainPCIAddressBusP= tr; struct _virDomainPCIAddressSet { virDomainPCIAddressBus *buses; size_t nbuses; - virPCIDeviceAddress lastaddr; - virDomainPCIConnectFlags lastFlags; bool dryRun; /* on a dry run, new buses are auto-added and addresses aren't saved in device infos */ }; --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 149823028856062.76738688395062; Fri, 23 Jun 2017 08:04:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 81B09569A; Fri, 23 Jun 2017 15:04:43 +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 C824A53CC9; Fri, 23 Jun 2017 15:04:42 +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 953551853E36; Fri, 23 Jun 2017 15:04:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF42Qo004212 for ; Fri, 23 Jun 2017 11:04:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id EF8116F9D1; Fri, 23 Jun 2017 15:04:02 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 116636F9E4 for ; Fri, 23 Jun 2017 15:03:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 81B09569A Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 81B09569A From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:11 +0800 Message-Id: <1498230208-14144-10-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 09/26] qemu: Allow qemuBuildControllerDevStr() to return NULL 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 23 Jun 2017 15:04:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We will soon need to be able to return a NULL pointer without the caller considering that an error: to make it possible, change the return type to int and use an out parameter for the string instead. Add some documentation for the function as well. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- src/qemu/qemu_command.c | 55 ++++++++++++++++++++++++++++++++++++---------= ---- src/qemu/qemu_command.h | 9 ++++---- src/qemu/qemu_hotplug.c | 5 ++++- 3 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c53ab97..ea2e63b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2704,23 +2704,46 @@ qemuCheckSCSIControllerIOThreads(const virDomainDef= *domainDef, } =20 =20 -char * +/** + * qemuBuildControllerDevStr: + * @domainDef: domain definition + * @def: controller definition + * @qemuCaps: QEMU binary capabilities + * @devstr: device string + * @nusbcontroller: number of USB controllers + * + * Turn @def into a description of the controller that QEMU will understan= d, + * to be used either on the command line or through the monitor. + * + * The description will be returned in @devstr and can be NULL, eg. when + * passing in one of the built-in controllers. The returned string must be + * freed by the caller. + * + * The number pointed to by @nusbcontroller will be increased by one every + * time the description for a USB controller has been generated successful= ly. + * + * Returns: 0 on success, <0 on failure + */ +int qemuBuildControllerDevStr(const virDomainDef *domainDef, virDomainControllerDefPtr def, virQEMUCapsPtr qemuCaps, + char **devstr, int *nusbcontroller) { virBuffer buf =3D VIR_BUFFER_INITIALIZER; int model =3D def->model; const char *modelName =3D NULL; =20 + *devstr =3D NULL; + if (!qemuCheckCCWS390AddressSupport(domainDef, def->info, qemuCaps, "controller")) - return NULL; + return -1; =20 if (def->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { if ((qemuDomainSetSCSIControllerModel(domainDef, qemuCaps, &model)= ) < 0) - return NULL; + return -1; } =20 if (!(def->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_SCSI && @@ -2728,22 +2751,22 @@ qemuBuildControllerDevStr(const virDomainDef *domai= nDef, if (def->queues) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("'queues' is only supported by virtio-scsi co= ntroller")); - return NULL; + return -1; } if (def->cmd_per_lun) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("'cmd_per_lun' is only supported by virtio-sc= si controller")); - return NULL; + return -1; } if (def->max_sectors) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("'max_sectors' is only supported by virtio-sc= si controller")); - return NULL; + return -1; } if (def->ioeventfd) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("'ioeventfd' is only supported by virtio-scsi= controller")); - return NULL; + return -1; } } =20 @@ -3158,11 +3181,12 @@ qemuBuildControllerDevStr(const virDomainDef *domai= nDef, if (virBufferCheckError(&buf) < 0) goto error; =20 - return virBufferContentAndReset(&buf); + *devstr =3D virBufferContentAndReset(&buf); + return 0; =20 error: virBufferFreeAndReset(&buf); - return NULL; + return -1; } =20 =20 @@ -3257,12 +3281,15 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, continue; } =20 - virCommandAddArg(cmd, "-device"); - if (!(devstr =3D qemuBuildControllerDevStr(def, cont, qemuCaps, - &usbcontroller))) + if (qemuBuildControllerDevStr(def, cont, qemuCaps, + &devstr, &usbcontroller) < 0) return -1; - virCommandAddArg(cmd, devstr); - VIR_FREE(devstr); + + if (devstr) { + virCommandAddArg(cmd, "-device"); + virCommandAddArg(cmd, devstr); + VIR_FREE(devstr); + } } } =20 diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index f5e3e5f..6fbfb3e 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -119,10 +119,11 @@ char *qemuBuildDriveDevStr(const virDomainDef *def, virQEMUCapsPtr qemuCaps); =20 /* Current, best practice */ -char *qemuBuildControllerDevStr(const virDomainDef *domainDef, - virDomainControllerDefPtr def, - virQEMUCapsPtr qemuCaps, - int *nusbcontroller); +int qemuBuildControllerDevStr(const virDomainDef *domainDef, + virDomainControllerDefPtr def, + virQEMUCapsPtr qemuCaps, + char **devstr, + int *nusbcontroller); =20 int qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps, const char **backendType, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d9259ab..8ca5054 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -523,7 +523,10 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr = driver, if (qemuAssignDeviceControllerAlias(vm->def, priv->qemuCaps, controlle= r) < 0) goto cleanup; =20 - if (!(devstr =3D qemuBuildControllerDevStr(vm->def, controller, priv->= qemuCaps, NULL))) + if (qemuBuildControllerDevStr(vm->def, controller, priv->qemuCaps, &de= vstr, NULL) < 0) + goto cleanup; + + if (!devstr) goto cleanup; =20 if (VIR_REALLOC_N(vm->def->controllers, vm->def->ncontrollers+1) < 0) --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230253956697.0433696431326; Fri, 23 Jun 2017 08:04:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B26E490904; Fri, 23 Jun 2017 15:04:08 +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 7FC6269727; Fri, 23 Jun 2017 15:04:08 +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 3B321266; Fri, 23 Jun 2017 15:04:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF46MT004226 for ; Fri, 23 Jun 2017 11:04:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 857576F9E9; Fri, 23 Jun 2017 15:04:06 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 999D56F9E5 for ; Fri, 23 Jun 2017 15:04:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B26E490904 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B26E490904 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:12 +0800 Message-Id: <1498230208-14144-11-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 10/26] qemu: Tweak index number checking 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 23 Jun 2017 15:04:09 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Moving the check and rewriting it this way doesn't alter the current behavior, but will allow us to special-case pci-root down the line. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- src/qemu/qemu_command.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ea2e63b..f79fbfc 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2874,6 +2874,26 @@ qemuBuildControllerDevStr(const virDomainDef *domain= Def, case VIR_DOMAIN_CONTROLLER_TYPE_PCI: switch ((virDomainControllerModelPCI) def->model) { case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: + case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE: + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT: + case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS: + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS: + if (def->idx =3D=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("index for pci controllers of model '%s' = must be > 0"), + virDomainControllerModelPCITypeToString(def= ->model)); + goto error; + } + break; + case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: + case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: + break; + } + switch ((virDomainControllerModelPCI) def->model) { + case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: if (def->opts.pciopts.modelName =3D=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE || def->opts.pciopts.chassisNr =3D=3D -1) { @@ -3132,12 +3152,6 @@ qemuBuildControllerDevStr(const virDomainDef *domain= Def, _("wrong function called")); goto error; } - if (def->idx =3D=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("index for pci controllers of model '%s' must= be > 0"), - virDomainControllerModelPCITypeToString(def->mo= del)); - goto error; - } break; =20 case VIR_DOMAIN_CONTROLLER_TYPE_IDE: --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230570985888.224915478093; Fri, 23 Jun 2017 08:09:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD7F17A177; Fri, 23 Jun 2017 15:09:25 +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 9B7446EC8B; Fri, 23 Jun 2017 15:09:25 +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 572A01800C88; Fri, 23 Jun 2017 15:09:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF4Jmw004248 for ; Fri, 23 Jun 2017 11:04:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 59DEE6F9ED; Fri, 23 Jun 2017 15:04:19 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8824F6F9EA for ; Fri, 23 Jun 2017 15:04:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CD7F17A177 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CD7F17A177 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:13 +0800 Message-Id: <1498230208-14144-12-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 11/26] conf: Move index number checking to drivers 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 23 Jun 2017 15:09:26 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" pSeries guests will soon be allowed to have multiple PHBs (pci-root controllers), which of course means that all but one of them will have a non-zero index; hence, we'll need to relax the current check. However, right now the check is performed in the conf module, which is generic rather than tied to the QEMU driver, and where we don't have information such as the guest machine type available. To make this change of behavior possible down the line, we need to move the check from the XML parser to the drivers. Luckily, only QEMU and bhyve are using PCI controllers, so this doesn't result in much duplication. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- src/bhyve/bhyve_domain.c | 15 +++++++++++++++ src/conf/domain_conf.c | 6 ------ src/qemu/qemu_domain.c | 9 +++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 20c8293..7176455 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -122,6 +122,21 @@ bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr de= v, bhyveDomainDiskDefAssignAddress(driver, disk, def) < 0) return -1; } + + if (dev->type =3D=3D VIR_DOMAIN_DEVICE_CONTROLLER) { + virDomainControllerDefPtr cont =3D dev->data.controller; + + if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI && + (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || + cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) && + cont->idx !=3D 0) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("pci-root and pcie-root controllers " + "should have index 0")); + return -1; + } + } + return 0; } =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fdf85d5..29268a9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9252,12 +9252,6 @@ virDomainControllerDefParseXML(xmlNodePtr node, "have an address")); goto error; } - if (def->idx > 0) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("pci-root and pcie-root controllers " - "should have index 0")); - goto error; - } if ((rc =3D virDomainParseScaledValue("./pcihole64", NULL, ctxt, &bytes, 1024, 1024ULL * ULONG_MAX, false= )) < 0) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 8e7404d..928f121 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3425,6 +3425,15 @@ qemuDomainControllerDefPostParse(virDomainController= DefPtr cont, break; =20 case VIR_DOMAIN_CONTROLLER_TYPE_PCI: + if ((cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || + cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) && + cont->idx !=3D 0) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("pci-root and pcie-root controllers " + "should have index 0")); + return -1; + } + if (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BU= S && !qemuDomainIsI440FX(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230573138855.9356649803818; Fri, 23 Jun 2017 08:09:33 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 034A97D4E0; Fri, 23 Jun 2017 15:09:29 +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 CDCBA5DD65; Fri, 23 Jun 2017 15:09:28 +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 8B0B1267; Fri, 23 Jun 2017 15:09:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF4TFA004306 for ; Fri, 23 Jun 2017 11:04:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id F3F606F9C4; Fri, 23 Jun 2017 15:04:28 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 173CD6F9E8 for ; Fri, 23 Jun 2017 15:04:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 034A97D4E0 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 034A97D4E0 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:14 +0800 Message-Id: <1498230208-14144-13-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 12/26] qemu: Relax pci-root index requirement for pSeries guests 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 23 Jun 2017 15:09:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" pSeries guests will soon be allowed to have multiple PHBs (pci-root controllers), meaning the current check on the controller index no longer applies to them. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- src/qemu/qemu_domain.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 928f121..a3ce10a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3425,9 +3425,14 @@ qemuDomainControllerDefPostParse(virDomainController= DefPtr cont, break; =20 case VIR_DOMAIN_CONTROLLER_TYPE_PCI: - if ((cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || - cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) && - cont->idx !=3D 0) { + + /* pSeries guests can have multiple pci-root controllers, + * but other machine types only support a single one */ + if (!qemuDomainIsPSeries(def) && + cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI && + (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || + cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) && + cont->idx !=3D 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("pci-root and pcie-root controllers " "should have index 0")); --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230578017731.2495344908496; Fri, 23 Jun 2017 08:09:38 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C96BA0B49; Fri, 23 Jun 2017 15:09:32 +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 632A46928C; Fri, 23 Jun 2017 15:09:32 +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 1BDC226A; Fri, 23 Jun 2017 15:09:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF4dvU004365 for ; Fri, 23 Jun 2017 11:04:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 686CB6E8D7; Fri, 23 Jun 2017 15:04:39 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 797236F9CA for ; Fri, 23 Jun 2017 15:04:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8C96BA0B49 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8C96BA0B49 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:15 +0800 Message-Id: <1498230208-14144-14-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 13/26] conf: Parse and format 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 23 Jun 2017 15:09:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by tags have been collected, so figuring out which --- docs/formatdomain.html.in | 5 +++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 24 ++++++++++++++++++++++++ src/conf/domain_conf.h | 1 + 4 files changed, 35 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index a55a9e1..159c243 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -3768,6 +3768,11 @@ libvirt API to attach host devices to the correct pci-expander-bus when assigning them to the domain). +
index
+
+ pci-root controllers for pSeries guests will use this attribute to + record the order they will show up in the guest. +

For machine types which provide an implicit PCI bus, the pci-root diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index e259e3e..39eff46 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1997,6 +1997,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 29268a9..1538747 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1866,6 +1866,7 @@ virDomainControllerDefNew(virDomainControllerType typ= e) def->opts.pciopts.chassis =3D -1; def->opts.pciopts.port =3D -1; def->opts.pciopts.busNr =3D -1; + def->opts.pciopts.idx =3D -1; def->opts.pciopts.numaNode =3D -1; break; case VIR_DOMAIN_CONTROLLER_TYPE_IDE: @@ -9099,6 +9100,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, goto error; } def->idx =3D idxVal; + VIR_FREE(idx); } =20 cur =3D node->children; @@ -9130,6 +9132,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, chassis =3D virXMLPropString(cur, "chassis"); port =3D virXMLPropString(cur, "port"); busNr =3D virXMLPropString(cur, "busNr"); + idx =3D virXMLPropString(cur, "index"); processedTarget =3D true; } } @@ -9348,6 +9351,23 @@ virDomainControllerDefParseXML(xmlNodePtr node, goto error; } } + if (idx) { + if (virStrToLong_i(idx, NULL, 0, + &def->opts.pciopts.idx) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("Invalid target index '%s' in PCI control= ler"), + idx); + goto error; + } + if (def->opts.pciopts.idx < 0 || + def->opts.pciopts.idx > 31) { + virReportError(VIR_ERR_XML_ERROR, + _("PCI controller target index '%s' out of " + "range - must be 0-31"), + idx); + goto error; + } + } if (numaNode >=3D 0) def->opts.pciopts.numaNode =3D numaNode; break; @@ -21748,6 +21768,7 @@ virDomainControllerDefFormat(virBufferPtr buf, def->opts.pciopts.chassis !=3D -1 || def->opts.pciopts.port !=3D -1 || def->opts.pciopts.busNr !=3D -1 || + def->opts.pciopts.idx !=3D -1 || def->opts.pciopts.numaNode !=3D -1) { virBufferAddLit(&childBuf, "opts.pciopts.chassisNr !=3D -1) @@ -21762,6 +21783,9 @@ virDomainControllerDefFormat(virBufferPtr buf, if (def->opts.pciopts.busNr !=3D -1) virBufferAsprintf(&childBuf, " busNr=3D'%d'", def->opts.pciopts.busNr); + if (def->opts.pciopts.idx !=3D -1) + virBufferAsprintf(&childBuf, " index=3D'%d'", + def->opts.pciopts.idx); if (def->opts.pciopts.numaNode =3D=3D -1) { virBufferAddLit(&childBuf, "/>\n"); } else { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 6d9ee97..53a10db 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -785,6 +785,7 @@ struct _virDomainPCIControllerOpts { int chassis; int port; int busNr; /* used by pci-expander-bus, -1 =3D=3D unspecified */ + int idx; /* used by spapr-pci-host-bridge, -1 =3D=3D unspecified */ /* numaNode is a *subelement* of target (to match existing * item in memory target config) -1 =3D=3D unspecified */ --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230582228943.6901639898177; Fri, 23 Jun 2017 08:09:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC0091E2E2; Fri, 23 Jun 2017 15:09:35 +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 B55F46EC9F; Fri, 23 Jun 2017 15:09:35 +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 59ADA184383F; Fri, 23 Jun 2017 15:09:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF4jka004378 for ; Fri, 23 Jun 2017 11:04:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 594816E8D7; Fri, 23 Jun 2017 15:04:45 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 649CD6F9CA for ; Fri, 23 Jun 2017 15:04:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EC0091E2E2 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com EC0091E2E2 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:16 +0800 Message-Id: <1498230208-14144-15-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 14/26] conf: Add 'spapr-pci-host-bridge' controller model 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 23 Jun 2017 15:09:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Adding it to the virDomainControllerPCIModelName enumeration is enough for existing code to handle it, so parsing and formatting will work without further tweaking. Signed-off-by: Andrea Bolognani Reviewed-by tags have been collected, so figuring out which --- docs/schemas/domaincommon.rng | 2 ++ src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + 3 files changed, 4 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 39eff46..73343a5 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1954,6 +1954,8 @@ + + spapr-pci-host-bridge pci-bridge diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1538747..6afcbe7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -349,6 +349,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName, "pxb", "pxb-pcie", "pcie-root-port", + "spapr-pci-host-bridge", ); =20 VIR_ENUM_IMPL(virDomainControllerModelSCSI, VIR_DOMAIN_CONTROLLER_MODEL_SC= SI_LAST, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 53a10db..b3699e7 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -710,6 +710,7 @@ typedef enum { VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB_PCIE, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT, + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE, =20 VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST } virDomainControllerPCIModelName; --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230304891137.4183766238176; Fri, 23 Jun 2017 08:05:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF0A8C062D15; Fri, 23 Jun 2017 15:04:58 +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 84D3753CCE; Fri, 23 Jun 2017 15:04:58 +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 3B80B262; Fri, 23 Jun 2017 15:04:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF4vnW004394 for ; Fri, 23 Jun 2017 11:04:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1969E6E8D7; Fri, 23 Jun 2017 15:04:57 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 18D416F9E3 for ; Fri, 23 Jun 2017 15:04:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CF0A8C062D15 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CF0A8C062D15 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:17 +0800 Message-Id: <1498230208-14144-16-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 15/26] qemu: Automatically pick target index and model for pci-root controllers 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 23 Jun 2017 15:04:59 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" pSeries guests will soon need the new information; luckily, we can figure it out automatically most of the time, so users won't have to worry about it. Signed-off-by: Andrea Bolognani Reviewed-by tags have been collected, so figuring out which Reviewed-by: Laine Stump --- src/qemu/qemu_domain_address.c | 88 ++++++++++++++++++= +++- .../qemuargv2xmldata/qemuargv2xml-pseries-disk.xml | 5 +- .../qemuargv2xml-pseries-nvram.xml | 5 +- .../qemuxml2xmlout-panic-pseries.xml | 5 +- .../qemuxml2xmlout-ppc64-usb-controller-legacy.xml | 5 +- .../qemuxml2xmlout-ppc64-usb-controller.xml | 5 +- .../qemuxml2xmlout-pseries-nvram.xml | 5 +- .../qemuxml2xmlout-pseries-panic-missing.xml | 5 +- .../qemuxml2xmlout-pseries-panic-no-address.xml | 5 +- 9 files changed, 118 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index b5b863f..960ea04 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1861,6 +1861,7 @@ qemuDomainSupportsPCI(virDomainDefPtr def, =20 static void qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont, + virDomainDefPtr def, virQEMUCapsPtr qemuCaps) { int *modelName =3D &cont->opts.pciopts.modelName; @@ -1897,6 +1898,9 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainC= ontrollerDefPtr cont, *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB_PCIE; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: + if (qemuDomainIsPSeries(def)) + *modelName =3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_= HOST_BRIDGE; + break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: break; @@ -1904,6 +1908,63 @@ qemuDomainPCIControllerSetDefaultModelName(virDomain= ControllerDefPtr cont, } =20 =20 +/** + * qemuDomainAddressFindNewTargetIndex: + * @def: domain definition + * + * Find a target index that can be used for a PCI controller. + * + * Returns: an unused target index, or -1 if all available target + * indexes are already taken. + */ +static int +qemuDomainAddressFindNewTargetIndex(virDomainDefPtr def) +{ + int idx; + int ret =3D -1; + + /* Try all indexes between 1 and 31 - QEMU only supports 32 + * PHBs, and 0 is reserved for the default, implicit one */ + for (idx =3D 1; idx <=3D 31; idx++) { + bool found =3D false; + size_t i; + + for (i =3D 0; i < def->ncontrollers; i++) { + virDomainControllerDefPtr cont =3D def->controllers[i]; + virDomainPCIControllerOptsPtr opts; + + /* We only care about pci-root controllers */ + if (cont->type !=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI || + cont->model !=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { + continue; + } + + opts =3D &cont->opts.pciopts; + + /* More specifically, we only care about PHBs */ + if (opts->modelName !=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_= SPAPR_PCI_HOST_BRIDGE) + continue; + + /* Stop looking as soon as we find a PHB that's + * already using this specific target index */ + if (opts->idx =3D=3D idx) { + found =3D true; + break; + } + } + + /* If no existing PCI controller uses this index, great, + * it means it's free and we can return it to the caller */ + if (!found) { + ret =3D idx; + break; + } + } + + return ret; +} + + static int qemuDomainAddressFindNewBusNr(virDomainDefPtr def) { @@ -2164,7 +2225,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, * device in qemu) for any controller that doesn't yet * have it set. */ - qemuDomainPCIControllerSetDefaultModelName(cont, qemuCaps); + qemuDomainPCIControllerSetDefaultModelName(cont, def, qemuCaps= ); =20 /* set defaults for any other auto-generated config * options for this controller that haven't been @@ -2201,9 +2262,32 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, goto cleanup; } break; + case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: + if (!qemuDomainIsPSeries(def)) + break; + if (options->idx =3D=3D -1) { + if (cont->idx =3D=3D 0) { + /* The pci-root controller with controller index 0 + * must always be assigned target index 0, because + * it represents the implicit PHB which is treated + * differently than all other PHBs */ + options->idx =3D 0; + } else { + /* For all other PHBs the target index doesn't need + * to match the controller index or have any + * particular value, really */ + options->idx =3D qemuDomainAddressFindNewTargetInd= ex(def); + } + } + if (options->idx =3D=3D -1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("No usable target index found for %d"= ), + addr->bus); + goto cleanup; + } + break; case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: - case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: break; diff --git a/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml b/tests/q= emuargv2xmldata/qemuargv2xml-pseries-disk.xml index 1bad8ee..601d0f7 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml @@ -30,7 +30,10 @@

- + + + +
diff --git a/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml b/tests/= qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml index 7e9f864..7787847 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml @@ -17,7 +17,10 @@
- + + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml index 1ed11ce..7fb49fe 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-panic-pseries.xml @@ -17,7 +17,10 @@
- + + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller-l= egacy.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller-le= gacy.xml index b7bde24..673b81d 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller-legacy.x= ml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller-legacy.x= ml @@ -22,7 +22,10 @@
- + + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller.x= ml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller.xml index 82aaaca..68995a9 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-ppc64-usb-controller.xml @@ -22,7 +22,10 @@
- + + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-nvram.xml b/te= sts/qemuxml2xmloutdata/qemuxml2xmlout-pseries-nvram.xml index 713f31c..f89b23b 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-nvram.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-nvram.xml @@ -17,7 +17,10 @@
- + + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.= xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml index 1ed11ce..7fb49fe 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-missing.xml @@ -17,7 +17,10 @@
- + + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-addre= ss.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.x= ml index 1ed11ce..7fb49fe 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-panic-no-address.xml @@ -17,7 +17,10 @@
- + + + +
--=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230586540651.757634410282; Fri, 23 Jun 2017 08:09:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F53B4025D; Fri, 23 Jun 2017 15:09:39 +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 31E246EC94; Fri, 23 Jun 2017 15:09:39 +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 D81A226C; Fri, 23 Jun 2017 15:09:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF52M7004410 for ; Fri, 23 Jun 2017 11:05:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7262F6E8D7; Fri, 23 Jun 2017 15:05:02 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89D8B6F9E4 for ; Fri, 23 Jun 2017 15:04:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6F53B4025D Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6F53B4025D From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:18 +0800 Message-Id: <1498230208-14144-17-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 16/26] qemu: Introduce QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 23 Jun 2017 15:09:40 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This new capability can be used to detect whether a QEMU binary supports the spapr-pci-host-bridge controller. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump Reviewed-by tags have been collected, so figuring out which --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 + 3 files changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 61c9a10..dc87b5d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -430,6 +430,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "virtio.iommu_platform", "virtio.ats", "loadparm", + "spapr-pci-host-bridge", ); =20 =20 @@ -1679,6 +1680,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "nvdimm", QEMU_CAPS_DEVICE_NVDIMM }, { "pcie-root-port", QEMU_CAPS_DEVICE_PCIE_ROOT_PORT }, { "qemu-xhci", QEMU_CAPS_DEVICE_QEMU_XHCI }, + { "spapr-pci-host-bridge", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[]= =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 6e95876..fd6de28 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -416,6 +416,7 @@ typedef enum { QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM, /* virtio-*-pci.iommu_platform */ QEMU_CAPS_VIRTIO_PCI_ATS, /* virtio-*-pci.ats */ QEMU_CAPS_LOADPARM, /* -machine loadparm */ + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, /* -device spapr-pci-host-brid= ge */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml b/tests/qemu= capabilitiesdata/caps_2.6.0.ppc64le.xml index 425992f..7fa652a 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml @@ -164,6 +164,7 @@ + 2006000 0 --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230312289889.5301270717237; Fri, 23 Jun 2017 08:05:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3533A7A170; Fri, 23 Jun 2017 15:05:09 +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 F2A106C428; Fri, 23 Jun 2017 15:05:08 +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 A5F09266; Fri, 23 Jun 2017 15:05:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF573c004424 for ; Fri, 23 Jun 2017 11:05:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5BF116F9D8; Fri, 23 Jun 2017 15:05:07 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68C156F9DA for ; Fri, 23 Jun 2017 15:05:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3533A7A170 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3533A7A170 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:19 +0800 Message-Id: <1498230208-14144-18-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 17/26] qemu: Deal with PHB naming conventions 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 23 Jun 2017 15:05:09 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Usually, a controller with alias 'x' will create a bus with the same name; however, the bus created by a PHBs with alias 'x' will be named 'x.0' instead, so we need to account for that. As an exception to the exception, the implicit PHB that's added automatically to every pSeries guest creates the 'pci.0' bus. Signed-off-by: Andrea Bolognani Reviewed-by tags have been collected, so figuring out which Reviewed-by: Laine Stump --- src/qemu/qemu_command.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f79fbfc..dba2519 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -302,6 +302,9 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, int ret =3D -1; char *devStr =3D NULL; const char *contAlias =3D NULL; + virDomainControllerModelPCI contModel; + virDomainControllerPCIModelName contModelName; + int contIndex; =20 if (info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { size_t i; @@ -314,6 +317,9 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI && cont->idx =3D=3D info->addr.pci.bus) { contAlias =3D cont->info.alias; + contModel =3D cont->model; + contModelName =3D cont->opts.pciopts.modelName; + contIndex =3D cont->opts.pciopts.idx; if (!contAlias) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Device alias was not set for PCI " @@ -349,7 +355,19 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, } } =20 - virBufferAsprintf(buf, ",bus=3D%s", contAlias); + if (contModel =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT && + contModelName =3D=3D VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAP= R_PCI_HOST_BRIDGE && + contIndex > 0) { + /* The PCI bus created by a spapr-pci-host-bridge device with + * alias 'x' will be called 'x.0' rather than 'x'; however, + * this does not apply to the implicit PHB in a pSeries guest, + * which always has the hardcoded name 'pci.0' */ + virBufferAsprintf(buf, ",bus=3D%s.0", contAlias); + } else { + /* For all other controllers, the bus name matches the alias + * of the corresponding controller */ + virBufferAsprintf(buf, ",bus=3D%s", contAlias); + } =20 if (info->addr.pci.multi =3D=3D VIR_TRISTATE_SWITCH_ON) virBufferAddLit(buf, ",multifunction=3Don"); --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230587588318.5749793801906; Fri, 23 Jun 2017 08:09:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 92F1BC001F3B; Fri, 23 Jun 2017 15:09:42 +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 7132A6C422; Fri, 23 Jun 2017 15:09:42 +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 33A1426E; Fri, 23 Jun 2017 15:09:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF5MIl004461 for ; Fri, 23 Jun 2017 11:05:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id E89746E8D7; Fri, 23 Jun 2017 15:05:22 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F33276F9E1 for ; Fri, 23 Jun 2017 15:05:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 92F1BC001F3B Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 92F1BC001F3B From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:20 +0800 Message-Id: <1498230208-14144-19-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 18/26] qemu: Use multiple PHBs for pSeries guests 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 23 Jun 2017 15:09:43 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Additional PHBs (pci-root controllers) will be created for the guest using the spapr-pci-host-bridge QEMU device, if available; the implicit default PHB, while present in the guest configuration, will be skipped. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1431193 Signed-off-by: Andrea Bolognani Reviewed-by tags have been collected, so figuring out which Reviewed-by: Laine Stump --- src/qemu/qemu_command.c | 47 ++++++++++++++++++++++++++++++++++++++++++++-= -- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index dba2519..fb0beed 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3164,6 +3164,40 @@ qemuBuildControllerDevStr(const virDomainDef *domain= Def, def->opts.pciopts.numaNode); break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: + if (def->opts.pciopts.modelName =3D=3D VIR_DOMAIN_CONTROLLER_P= CI_MODEL_NAME_NONE || + def->opts.pciopts.idx =3D=3D -1) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("autogenerated pci-root options not set")= ); + goto error; + } + + /* Skip the implicit one */ + if (def->opts.pciopts.idx =3D=3D 0) + goto done; + + modelName =3D virDomainControllerPCIModelNameTypeToString(def-= >opts.pciopts.modelName); + if (!modelName) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown pci-root model name value %d"), + def->opts.pciopts.modelName); + goto error; + } + if (def->opts.pciopts.modelName !=3D VIR_DOMAIN_CONTROLLER_PCI= _MODEL_NAME_SPAPR_PCI_HOST_BRIDGE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("PCI controller model name '%s' is not va= lid for a pci-root"), + modelName); + goto error; + } + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_= BRIDGE)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("the spapr-pci-host-bridge controller " + "is not supported in this QEMU binary")); + goto error; + } + virBufferAsprintf(&buf, "%s,index=3D%d,id=3D%s", + modelName, def->opts.pciopts.idx, + def->info.alias); + break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -3213,6 +3247,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainD= ef, if (virBufferCheckError(&buf) < 0) goto error; =20 + done: *devstr =3D virBufferContentAndReset(&buf); return 0; =20 @@ -3270,10 +3305,16 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, continue; } =20 - /* skip pci-root/pcie-root */ + /* skip pcie-root */ if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI && - (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || - cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT)) + cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) + continue; + + /* Skip pci-root, except for pSeries guests (which actually + * support more than one PCI Host Bridge per guest) */ + if (!qemuDomainIsPSeries(def) && + cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_PCI && + cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) continue; =20 /* first SATA controller on Q35 machines is implicit */ --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230334213207.0664906388729; Fri, 23 Jun 2017 08:05:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0AB7CC057FA7; Fri, 23 Jun 2017 15:05:32 +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 C1B7317557; Fri, 23 Jun 2017 15:05:31 +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 3012618437C6; Fri, 23 Jun 2017 15:05:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF5ULS004484 for ; Fri, 23 Jun 2017 11:05:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id CF08E6F9CF; Fri, 23 Jun 2017 15:05:29 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D74126F9D1 for ; Fri, 23 Jun 2017 15:05:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0AB7CC057FA7 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0AB7CC057FA7 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:21 +0800 Message-Id: <1498230208-14144-20-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 19/26] tests: Add tests for pSeries guests with multiple PHBs 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 23 Jun 2017 15:05:32 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani Reviewed-by tags have been collected, so figuring out which Reviewed-by: Laine Stump --- .../qemuxml2argv-pseries-phb-default-missing.args | 22 +++++++++++++++ .../qemuxml2argv-pseries-phb-default-missing.xml | 16 +++++++++++ .../qemuxml2argv-pseries-phb-simple.args | 22 +++++++++++++++ .../qemuxml2argv-pseries-phb-simple.xml | 17 +++++++++++ tests/qemuxml2argvtest.c | 8 ++++++ .../qemuxml2xmlout-pseries-phb-default-missing.xml | 33 ++++++++++++++++++= ++++ .../qemuxml2xmlout-pseries-phb-simple.xml | 33 ++++++++++++++++++= ++++ tests/qemuxml2xmltest.c | 7 +++++ 8 files changed, 158 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default= -missing.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default= -missing.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.= args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.= xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-def= ault-missing.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-sim= ple.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default-missin= g.args b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default-missing.ar= gs new file mode 100644 index 0000000..009f5a8 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default-missing.args @@ -0,0 +1,22 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name QEMUGuest1 \ +-S \ +-M pseries \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-device spapr-pci-host-bridge,index=3D1,id=3Dpci.1 \ +-device spapr-pci-host-bridge,index=3D2,id=3Dpci.2 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default-missin= g.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default-missing.xml new file mode 100644 index 0000000..d0b45bf --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-default-missing.xml @@ -0,0 +1,16 @@ + + QEMUGuest1 + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.args b/= tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.args new file mode 100644 index 0000000..009f5a8 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.args @@ -0,0 +1,22 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name QEMUGuest1 \ +-S \ +-M pseries \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-device spapr-pci-host-bridge,index=3D1,id=3Dpci.1 \ +-device spapr-pci-host-bridge,index=3D2,id=3Dpci.2 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.xml b/t= ests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.xml new file mode 100644 index 0000000..b1c6ff3 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-simple.xml @@ -0,0 +1,17 @@ + + QEMUGuest1 + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 01c0a65..ff68884 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1709,6 +1709,14 @@ mymain(void) QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); DO_TEST_FAILURE("pseries-panic-address", QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG); + + DO_TEST("pseries-phb-simple", + QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CHARDEV, + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); + DO_TEST("pseries-phb-default-missing", + QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CHARDEV, + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); + DO_TEST("disk-ide-drive-split", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_IDE_CD); diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-default-mi= ssing.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-default-mis= sing.xml new file mode 100644 index 0000000..62708b4 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-default-missing.x= ml @@ -0,0 +1,33 @@ + + QEMUGuest1 + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 524288 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-simple.xml= b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-simple.xml new file mode 100644 index 0000000..2c1e64e --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-phb-simple.xml @@ -0,0 +1,33 @@ + + QEMUGuest1 + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 524288 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index c74614c..a0a846c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -676,6 +676,13 @@ mymain(void) DO_TEST("pseries-panic-missing", NONE); DO_TEST("pseries-panic-no-address", NONE); =20 + DO_TEST("pseries-phb-simple", + QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CHARDEV, + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); + DO_TEST("pseries-phb-default-missing", + QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CHARDEV, + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE); + DO_TEST("balloon-device-auto", NONE); DO_TEST("balloon-device-period", NONE); DO_TEST("channel-virtio-auto", NONE); --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 00:58:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1498230338787112.88771375407327; Fri, 23 Jun 2017 08:05:38 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 763DCC06020E; Fri, 23 Jun 2017 15:05:36 +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 48C206C52A; Fri, 23 Jun 2017 15:05:36 +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 F31C8264; Fri, 23 Jun 2017 15:05:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF5Y7A004500 for ; Fri, 23 Jun 2017 11:05:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id B283E6E8D3; Fri, 23 Jun 2017 15:05:34 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F62E6FB7F for ; Fri, 23 Jun 2017 15:05:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 763DCC06020E Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 763DCC06020E From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:22 +0800 Message-Id: <1498230208-14144-21-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 20/26] tests: Add baseline tests for automatic PHB usage 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 23 Jun 2017 15:05:37 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" These tests demonstrate that, while it's now possible for the user to create PHB explicitly and manually assign devices to them, libvirt still defaults to extending the guest PCI topology using PCI bridges and making suboptimal device placement choices. The next few commits will improve on these behaviors and the tests outputs will automatically be updated to reflect this. Signed-off-by: Andrea Bolognani Reviewed-by tags have been collected, so figuring out which Reviewed-by: Laine Stump --- .../qemuxml2argv-pseries-hostdevs-1.args | 23 ++++ .../qemuxml2argv-pseries-hostdevs-1.xml | 38 +++++++ .../qemuxml2argv-pseries-hostdevs-2.args | 24 ++++ .../qemuxml2argv-pseries-hostdevs-2.xml | 37 ++++++ .../qemuxml2argv-pseries-hostdevs-3.args | 24 ++++ .../qemuxml2argv-pseries-hostdevs-3.xml | 31 +++++ .../qemuxml2argv-pseries-many-buses-1.args | 22 ++++ .../qemuxml2argv-pseries-many-buses-1.xml | 19 ++++ .../qemuxml2argv-pseries-many-buses-2.args | 22 ++++ .../qemuxml2argv-pseries-many-buses-2.xml | 18 +++ .../qemuxml2argv-pseries-many-devices.args | 53 +++++++++ .../qemuxml2argv-pseries-many-devices.xml | 48 ++++++++ tests/qemuxml2argvtest.c | 36 ++++++ .../qemuxml2xmlout-pseries-hostdevs-1.xml | 46 ++++++++ .../qemuxml2xmlout-pseries-hostdevs-2.xml | 47 ++++++++ .../qemuxml2xmlout-pseries-hostdevs-3.xml | 49 ++++++++ .../qemuxml2xmlout-pseries-many-buses-1.xml | 33 ++++++ .../qemuxml2xmlout-pseries-many-buses-2.xml | 34 ++++++ .../qemuxml2xmlout-pseries-many-devices.xml | 126 +++++++++++++++++= ++++ tests/qemuxml2xmltest.c | 36 ++++++ 20 files changed, 766 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.= args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.= xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.= args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.= xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.= args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.= xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-= 1.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-= 1.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-= 2.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-= 2.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-device= s.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-many-device= s.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdev= s-1.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdev= s-2.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-hostdev= s-3.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-bu= ses-1.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-bu= ses-2.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-pseries-many-de= vices.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.args b/= tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.args new file mode 100644 index 0000000..88eb081 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.args @@ -0,0 +1,23 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest \ +-S \ +-M pseries \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-device vfio-pci,host=3D0001:01:00.0,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x1 \ +-device vfio-pci,host=3D0005:90:01.0,id=3Dhostdev1,bus=3Dpci.0,addr=3D0x2 \ +-device vfio-pci,host=3D0001:01:00.1,id=3Dhostdev2,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.xml b/t= ests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.xml new file mode 100644 index 0000000..87fe145 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-1.xml @@ -0,0 +1,38 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args b/= tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args new file mode 100644 index 0000000..c43e15d --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.args @@ -0,0 +1,24 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest \ +-S \ +-M pseries \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-device pci-bridge,chassis_nr=3D1,id=3Dpci.1,bus=3Dpci.0,addr=3D0x1 \ +-device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.1,addr=3D0x1 \ +-device vfio-pci,host=3D0001:01:00.0,id=3Dhostdev0,bus=3Dpci.1,addr=3D0x2 \ +-device vfio-pci,host=3D0005:90:01.0,id=3Dhostdev1,bus=3Dpci.0,addr=3D0x2 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.xml b/t= ests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.xml new file mode 100644 index 0000000..551b588 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-2.xml @@ -0,0 +1,37 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + +
+ + + + + +
+ +
+ + + + + +
+ + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args b/= tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args new file mode 100644 index 0000000..99df2e7 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.args @@ -0,0 +1,24 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest \ +-S \ +-M pseries \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-device pci-bridge,chassis_nr=3D1,id=3Dpci.1,bus=3Dpci.0,addr=3D0x1 \ +-device pci-bridge,chassis_nr=3D2,id=3Dpci.2,bus=3Dpci.0,addr=3D0x2 \ +-device vfio-pci,host=3D0001:01:00.0,id=3Dhostdev0,bus=3Dpci.2,addr=3D0x1 \ +-device vfio-pci,host=3D0001:01:00.1,id=3Dhostdev1,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.xml b/t= ests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.xml new file mode 100644 index 0000000..0e61a17 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-hostdevs-3.xml @@ -0,0 +1,31 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + +
+ +
+ + + + + +
+ + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.args = b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.args new file mode 100644 index 0000000..bf78fc1 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.args @@ -0,0 +1,22 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest \ +-S \ +-M pseries \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-device pci-bridge,chassis_nr=3D1,id=3Dpci.1,bus=3Dpci.0,addr=3D0x1 \ +-device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.1,addr=3D0x1 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.xml b= /tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.xml new file mode 100644 index 0000000..c52349d --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-buses-1.xml @@ -0,0 +1,19 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 + + + + + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.args = b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.args new file mode 100644 index 0000000..1db4533 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.args @@ -0,0 +1,53 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest \ +-S \ +-M pseries \ +-m 512 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-guest/monitor.s= ock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dreadline \ +-boot c \ +-device pci-bridge,chassis_nr=3D1,id=3Dpci.1,bus=3Dpci.0,addr=3D0x1 \ +-device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.0,addr=3D0x2 \ +-device virtio-scsi-pci,id=3Dscsi1,bus=3Dpci.0,addr=3D0x3 \ +-device virtio-scsi-pci,id=3Dscsi2,bus=3Dpci.0,addr=3D0x4 \ +-device virtio-scsi-pci,id=3Dscsi3,bus=3Dpci.0,addr=3D0x5 \ +-device virtio-scsi-pci,id=3Dscsi4,bus=3Dpci.0,addr=3D0x6 \ +-device virtio-scsi-pci,id=3Dscsi5,bus=3Dpci.0,addr=3D0x7 \ +-device virtio-scsi-pci,id=3Dscsi6,bus=3Dpci.0,addr=3D0x8 \ +-device virtio-scsi-pci,id=3Dscsi7,bus=3Dpci.0,addr=3D0x9 \ +-device virtio-scsi-pci,id=3Dscsi8,bus=3Dpci.0,addr=3D0xa \ +-device virtio-scsi-pci,id=3Dscsi9,bus=3Dpci.0,addr=3D0xb \ +-device virtio-scsi-pci,id=3Dscsi10,bus=3Dpci.0,addr=3D0xc \ +-device virtio-scsi-pci,id=3Dscsi11,bus=3Dpci.0,addr=3D0xd \ +-device virtio-scsi-pci,id=3Dscsi12,bus=3Dpci.0,addr=3D0xe \ +-device virtio-scsi-pci,id=3Dscsi13,bus=3Dpci.0,addr=3D0xf \ +-device virtio-scsi-pci,id=3Dscsi14,bus=3Dpci.0,addr=3D0x10 \ +-device virtio-scsi-pci,id=3Dscsi15,bus=3Dpci.0,addr=3D0x11 \ +-device virtio-scsi-pci,id=3Dscsi16,bus=3Dpci.0,addr=3D0x12 \ +-device virtio-scsi-pci,id=3Dscsi17,bus=3Dpci.0,addr=3D0x13 \ +-device virtio-scsi-pci,id=3Dscsi18,bus=3Dpci.0,addr=3D0x14 \ +-device virtio-scsi-pci,id=3Dscsi19,bus=3Dpci.0,addr=3D0x15 \ +-device virtio-scsi-pci,id=3Dscsi20,bus=3Dpci.0,addr=3D0x16 \ +-device virtio-scsi-pci,id=3Dscsi21,bus=3Dpci.0,addr=3D0x17 \ +-device virtio-scsi-pci,id=3Dscsi22,bus=3Dpci.0,addr=3D0x18 \ +-device virtio-scsi-pci,id=3Dscsi23,bus=3Dpci.0,addr=3D0x19 \ +-device virtio-scsi-pci,id=3Dscsi24,bus=3Dpci.0,addr=3D0x1a \ +-device virtio-scsi-pci,id=3Dscsi25,bus=3Dpci.0,addr=3D0x1b \ +-device virtio-scsi-pci,id=3Dscsi26,bus=3Dpci.0,addr=3D0x1c \ +-device virtio-scsi-pci,id=3Dscsi27,bus=3Dpci.0,addr=3D0x1d \ +-device virtio-scsi-pci,id=3Dscsi28,bus=3Dpci.0,addr=3D0x1e \ +-device virtio-scsi-pci,id=3Dscsi29,bus=3Dpci.0,addr=3D0x1f \ +-device virtio-scsi-pci,id=3Dscsi30,bus=3Dpci.1,addr=3D0x1 \ +-device virtio-scsi-pci,id=3Dscsi31,bus=3Dpci.1,addr=3D0x2 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.xml b= /tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.xml new file mode 100644 index 0000000..f3daba4 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-many-devices.xml @@ -0,0 +1,48 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 524288 + 1 + + hvm + + + /usr/bin/qemu-system-ppc64 +