From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj51b-0005o1-Qt for qemu-devel@nongnu.org; Thu, 13 Dec 2012 04:24:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tj51W-0005Fa-HC for qemu-devel@nongnu.org; Thu, 13 Dec 2012 04:24:15 -0500 Received: from greensocs.com ([87.106.252.221]:53070 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj51W-0005FS-Ac for qemu-devel@nongnu.org; Thu, 13 Dec 2012 04:24:10 -0500 Message-ID: <50C99EB5.6090808@greensocs.com> Date: Thu, 13 Dec 2012 10:24:05 +0100 From: =?UTF-8?B?S09OUkFEIEZyw6lkw6lyaWM=?= MIME-Version: 1.0 References: <1355157952-2321-1-git-send-email-fred.konrad@greensocs.com> <1355157952-2321-8-git-send-email-fred.konrad@greensocs.com> <50C8C4A2.7010709@suse.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH v7 7/8] virtio-pci-blk : Switch to new API. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: aliguori@us.ibm.com, e.voevodin@samsung.com, "Michael S. Tsirkin" , mark.burton@greensocs.com, qemu-devel@nongnu.org, Alexander Graf , stefanha@redhat.com, cornelia.huck@de.ibm.com, Paolo Bonzini , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= On 12/12/2012 18:58, Peter Maydell wrote: > On 12 December 2012 17:53, Andreas F=C3=A4rber wrote= : >> Am 12.12.2012 15:25, schrieb Peter Maydell: >>> How will the PCI transport's PCI vendor/device/class IDs be >>> set (a) when a virtio-blk backend is created and separately >>> plugged into a virtio-pci transport (b) for the legacy >>> virtio-pci-blk? [ideally the answer to (b) should be "in the >>> same way as for (a)"] >> The obvious answer would be that PCI properties need to be set on the >> PCI device, not an a VirtioDevice sitting on a virtio-bus. >> >> I.e., with the proposed refactoring we'd have on the virtio-bus: >> >> - VirtioDevice >> + VirtioBlockDevice >> + VirtioSCSIDevice - has-a scsi-bus >> ... >> >> In turn that means that every VirtioDevice to be exposed as PCI device >> to the guest needs it own PCIDevice exposing a private virtio-bus. >> >> - PCIDevice >> - VirtioPCIDevice - has-a virtio-bus >> + virtio-blk-pci - has-a VirtioBlockDevice on its virtio-bus >> + virtio-scsi-pci - has-a VirtioSCSIDevice on its virtio-bus >> ... > ...this bit is only for legacy back-compat. It should be equally > valid to just use the PCI transport plugged into a VirtioDevice, > both of which were created by the user with -device [and for > new transports, separate transport and backend should be the > standard]. That means the virtio-bus interface needs a way for > the backend to announce to the transport what it is so that > the PCI transport can set the right PCI IDs. > > -- PMM Yes, it's done with uint16_t get_virtio_device_id(VirtioBusState *bus)=20 function from second step.