From nobody Mon Feb 9 01:21:56 2026 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1564561957; cv=none; d=zoho.com; s=zohoarc; b=BwYVAWikbqC5N9dLiPtgg9HCHoNefGlY+qXfmaKgRYVDmJ1i5tdZwJtHzqaNrgAT1QZWwc6CS24gE6/tb/gKPrquEOJoIbsVxpOrFiuMPcxo8IMa4foUnycdNGWWSV60cIXfpyejgu2bOxs1bJI10t6Fu/IaRxu15XkYOeIRdAg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564561957; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=/1sdpPrELF1WP5CrR4LrZueKMDkIvZe/sMkXlRfE+Ak=; b=YFqUJXWycyELWX3X4BglT5RXTw5HTOhZ8hNHCWfO2Ye3Ah9SVbfLZitZ+962eC+cxPGLUYfBOgKus2R9BRvOUBPF/o6UE+KjsB+W/y0b3yoqMUUO0/CKxTkbdOsExwr91H6gCc11H1dREdhGxvNVDR6LJdjmrkTFEVVZHJTAiFg= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1564561957104473.6400376136272; Wed, 31 Jul 2019 01:32:37 -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 81F243B71F; Wed, 31 Jul 2019 08:32:35 +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 54472600D1; Wed, 31 Jul 2019 08:32: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 1E0233FA9A; Wed, 31 Jul 2019 08:32: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 x6V8WTPu027366 for ; Wed, 31 Jul 2019 04:32:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id DB16D5D712; Wed, 31 Jul 2019 08:32:29 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41AC85D70D for ; Wed, 31 Jul 2019 08:32:29 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 31 Jul 2019 10:32:19 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/6] qemuBuildPCIHostdevDevStr: Always format PCI domain onto cmd line 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: , 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.30]); Wed, 31 Jul 2019 08:32:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" QEMU is perfectly capable of dealing with fully expanded PCI address. Format PCI domain always as it will simplify next commits. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 8 ++++---- tests/qemuxml2argvdata/hostdev-pci-address-device.args | 2 +- tests/qemuxml2argvdata/hostdev-pci-address.args | 2 +- .../qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args | 2 +- tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args | 2 +- tests/qemuxml2argvdata/hostdev-vfio-zpci.args | 2 +- tests/qemuxml2argvdata/hostdev-vfio.args | 2 +- tests/qemuxml2argvdata/net-hostdev-bootorder.args | 3 ++- tests/qemuxml2argvdata/net-hostdev-vfio.args | 2 +- tests/qemuxml2argvdata/net-hostdev.args | 2 +- tests/qemuxml2argvdata/pci-rom.args | 4 ++-- 11 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fee51158a9..1871c6ef81 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4933,10 +4933,10 @@ qemuBuildPCIHostdevDevStr(const virDomainDef *def, } =20 virBufferAddLit(&buf, ",host=3D"); - if (pcisrc->addr.domain) - virBufferAsprintf(&buf, "%.4x:", pcisrc->addr.domain); - virBufferAsprintf(&buf, "%.2x:%.2x.%.1x", - pcisrc->addr.bus, pcisrc->addr.slot, + virBufferAsprintf(&buf, "%.4x:%.2x:%.2x.%.1x", + pcisrc->addr.domain, + pcisrc->addr.bus, + pcisrc->addr.slot, pcisrc->addr.function); virBufferAsprintf(&buf, ",id=3D%s", dev->info->alias); if (dev->info->bootIndex) diff --git a/tests/qemuxml2argvdata/hostdev-pci-address-device.args b/tests= /qemuxml2argvdata/hostdev-pci-address-device.args index 4763e1a147..5159b00ef1 100644 --- a/tests/qemuxml2argvdata/hostdev-pci-address-device.args +++ b/tests/qemuxml2argvdata/hostdev-pci-address-device.args @@ -27,5 +27,5 @@ server,nowait \ -usb \ -drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --device pci-assign,host=3D06:12.5,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x3 \ +-device pci-assign,host=3D0000:06:12.5,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x= 3 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 diff --git a/tests/qemuxml2argvdata/hostdev-pci-address.args b/tests/qemuxm= l2argvdata/hostdev-pci-address.args index d90fb2c085..fe6acaaf62 100644 --- a/tests/qemuxml2argvdata/hostdev-pci-address.args +++ b/tests/qemuxml2argvdata/hostdev-pci-address.args @@ -27,4 +27,4 @@ server,nowait \ -usb \ -drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --device pci-assign,host=3D06:12.5,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x3 +-device pci-assign,host=3D0000:06:12.5,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args b/t= ests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args index 1861811e8b..963d508066 100644 --- a/tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args +++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args @@ -24,6 +24,6 @@ server,nowait \ -rtc base=3Dutc \ -no-shutdown \ -device zpci,uid=3D1,fid=3D0,target=3Dhostdev0,id=3Dzpci1 \ --device vfio-pci,host=3D00:00.0,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x1 \ +-device vfio-pci,host=3D0000:00:00.0,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x1 \ -device zpci,uid=3D2,fid=3D1,target=3Dballoon0,id=3Dzpci2 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args b/tes= ts/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args index 4a58a1eb8d..2fc4200c23 100644 --- a/tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args +++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args @@ -28,6 +28,6 @@ server,nowait \ -device zpci,uid=3D65535,fid=3D4294967295,target=3Dhostdev0,id=3Dzpci65535= \ -device vfio-pci,host=3Dffff:00:00.0,id=3Dhostdev0,bus=3Dpci.1,addr=3D0x1f= \ -device zpci,uid=3D1,fid=3D0,target=3Dhostdev1,id=3Dzpci1 \ --device vfio-pci,host=3D00:00.0,id=3Dhostdev1,bus=3Dpci.0,addr=3D0x2 \ +-device vfio-pci,host=3D0000:00:00.0,id=3Dhostdev1,bus=3Dpci.0,addr=3D0x2 \ -device zpci,uid=3D2,fid=3D1,target=3Dballoon0,id=3Dzpci2 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci.args b/tests/qemuxml2= argvdata/hostdev-vfio-zpci.args index 07405c7c14..d3a762e5d4 100644 --- a/tests/qemuxml2argvdata/hostdev-vfio-zpci.args +++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci.args @@ -24,6 +24,6 @@ server,nowait \ -rtc base=3Dutc \ -no-shutdown \ -device zpci,uid=3D25,fid=3D31,target=3Dhostdev0,id=3Dzpci25 \ --device vfio-pci,host=3D00:00.0,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x8 \ +-device vfio-pci,host=3D0000:00:00.0,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x8 \ -device zpci,uid=3D1,fid=3D0,target=3Dballoon0,id=3Dzpci1 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x1 diff --git a/tests/qemuxml2argvdata/hostdev-vfio.args b/tests/qemuxml2argvd= ata/hostdev-vfio.args index b86181e267..79654f44bb 100644 --- a/tests/qemuxml2argvdata/hostdev-vfio.args +++ b/tests/qemuxml2argvdata/hostdev-vfio.args @@ -27,5 +27,5 @@ server,nowait \ -usb \ -drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --device vfio-pci,host=3D06:12.5,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x3 \ +-device vfio-pci,host=3D0000:06:12.5,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x3 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 diff --git a/tests/qemuxml2argvdata/net-hostdev-bootorder.args b/tests/qemu= xml2argvdata/net-hostdev-bootorder.args index 700ed5366b..eefc247eed 100644 --- a/tests/qemuxml2argvdata/net-hostdev-bootorder.args +++ b/tests/qemuxml2argvdata/net-hostdev-bootorder.args @@ -27,4 +27,5 @@ server,nowait \ -usb \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D2 \ --device pci-assign,host=3D03:07.1,id=3Dhostdev0,bootindex=3D1,bus=3Dpci.0,= addr=3D0x3 +-device pci-assign,host=3D0000:03:07.1,id=3Dhostdev0,bootindex=3D1,bus=3Dp= ci.0,\ +addr=3D0x3 diff --git a/tests/qemuxml2argvdata/net-hostdev-vfio.args b/tests/qemuxml2a= rgvdata/net-hostdev-vfio.args index fcc8716fdf..aa9e91db82 100644 --- a/tests/qemuxml2argvdata/net-hostdev-vfio.args +++ b/tests/qemuxml2argvdata/net-hostdev-vfio.args @@ -27,5 +27,5 @@ server,nowait \ -usb \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --device vfio-pci,host=3D03:07.1,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x3 \ +-device vfio-pci,host=3D0000:03:07.1,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x3 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 diff --git a/tests/qemuxml2argvdata/net-hostdev.args b/tests/qemuxml2argvda= ta/net-hostdev.args index 75f6934d0d..94eac176f3 100644 --- a/tests/qemuxml2argvdata/net-hostdev.args +++ b/tests/qemuxml2argvdata/net-hostdev.args @@ -27,5 +27,5 @@ server,nowait \ -usb \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --device pci-assign,host=3D03:07.1,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x3 \ +-device pci-assign,host=3D0000:03:07.1,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x= 3 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 diff --git a/tests/qemuxml2argvdata/pci-rom.args b/tests/qemuxml2argvdata/p= ci-rom.args index 5f33b20b4e..7235642ee8 100644 --- a/tests/qemuxml2argvdata/pci-rom.args +++ b/tests/qemuxml2argvdata/pci-rom.args @@ -33,7 +33,7 @@ addr=3D0x3,rombar=3D1 \ -netdev user,id=3Dhostnet1 \ -device virtio-net-pci,netdev=3Dhostnet1,id=3Dnet1,mac=3D52:54:00:24:a5:9e= ,bus=3Dpci.0,\ addr=3D0x4,romfile=3D/etc/fake/bootrom.bin \ --device pci-assign,host=3D06:12.5,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x5,rom= bar=3D0 \ --device pci-assign,host=3D06:12.6,id=3Dhostdev1,bus=3Dpci.0,addr=3D0x6,rom= bar=3D1,\ +-device pci-assign,host=3D0000:06:12.5,id=3Dhostdev0,bus=3Dpci.0,addr=3D0x= 5,rombar=3D0 \ +-device pci-assign,host=3D0000:06:12.6,id=3Dhostdev1,bus=3Dpci.0,addr=3D0x= 6,rombar=3D1,\ romfile=3D/etc/fake/bootrom.bin \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x7 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list