From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEZc7-0008RA-FQ for qemu-devel@nongnu.org; Fri, 23 Jan 2015 03:29:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEZc6-0006A5-Gb for qemu-devel@nongnu.org; Fri, 23 Jan 2015 03:29:11 -0500 Message-ID: <54C20637.1030506@redhat.com> Date: Fri, 23 Jan 2015 10:28:39 +0200 From: Marcel Apfelbaum MIME-Version: 1.0 References: <1421956363-23502-1-git-send-email-marcel@redhat.com> <1421956363-23502-11-git-send-email-marcel@redhat.com> <20150123075752.GB26711@redhat.com> In-Reply-To: <20150123075752.GB26711@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 10/17] hw/pci: removed 'rootbus nr is 0' assumption from qmp_pci_query List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: kraxel@redhat.com, quintela@redhat.com, seabios@seabios.org, qemu-devel@nongnu.org, agraf@suse.de, alex.williamson@redhat.com, kevin@koconnor.net, qemu-ppc@nongnu.org, hare@suse.de, imammedo@redhat.com, amit.shah@redhat.com, pbonzini@redhat.com, leon.alrae@imgtec.com, aurelien@aurel32.net, rth@twiddle.net On 01/23/2015 09:57 AM, Michael S. Tsirkin wrote: > On Thu, Jan 22, 2015 at 09:52:36PM +0200, Marcel Apfelbaum wrote: >> From: Marcel Apfelbaum >> >> Use the newer pci_bus_num to correctly get the root bus number. >> >> Signed-off-by: Marcel Apfelbaum > > > OK for now, but really bus numbers are a wrong thing to > use for QMP. In particular they are often guest-assigned. Hi Michael, Thank you for the review. This implementation requires user to input the bus number for host bridge's bus. -pxb-device,bus_nr=,... Thank you, Marcel > >> --- >> hw/pci/pci.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/hw/pci/pci.c b/hw/pci/pci.c >> index dccb3d1..bf31168 100644 >> --- a/hw/pci/pci.c >> +++ b/hw/pci/pci.c >> @@ -1251,7 +1251,8 @@ PciInfoList *qmp_query_pci(Error **errp) >> >> QLIST_FOREACH(host_bridge, &pci_host_bridges, next) { >> info = g_malloc0(sizeof(*info)); >> - info->value = qmp_query_pci_bus(host_bridge->bus, 0); >> + info->value = qmp_query_pci_bus(host_bridge->bus, >> + pci_bus_num(host_bridge->bus)); >> >> /* XXX: waiting for the qapi to support GSList */ >> if (!cur_item) { >> -- >> 2.1.0