Received: from eggs.gnu.org ([2001:4830:134:3::10]:35315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ximct-0002EV-2g for qemu-devel@nongnu.org; Mon, 27 Oct 2014 11:54:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ximcm-00010K-Q6 for qemu-devel@nongnu.org; Mon, 27 Oct 2014 11:54:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ximcm-000101-HZ for qemu-devel@nongnu.org; Mon, 27 Oct 2014 11:54:28 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9RFsRZw012527 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 27 Oct 2014 11:54:27 -0400 From: Markus Armbruster References: <1414417444-32158-1-git-send-email-marcel.a@redhat.com> <87tx2p5zk7.fsf@blackfin.pond.sub.org> <1414422298.29756.57.camel@localhost.localdomain> Date: Mon, 27 Oct 2014 16:54:25 +0100 In-Reply-To: <1414422298.29756.57.camel@localhost.localdomain> (Marcel Apfelbaum's message of "Mon, 27 Oct 2014 17:04:58 +0200") Message-ID: <87r3xt4ifi.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2] hw/pci: fixed crash when using rombar=0 with romfile=path for hotplugged devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: pbonzini@redhat.com, alex.williamson@redhat.com, qemu-devel@nongnu.org, mst@redhat.com Marcel Apfelbaum writes: > On Mon, 2014-10-27 at 15:59 +0100, Markus Armbruster wrote: >> Marcel Apfelbaum writes: >> >> > Combining rombar=0 with romfile= is an user error, >> > silently dropping the romfile is a reasonable thing to do. >> > >> > Signed-off-by: Marcel Apfelbaum >> > --- >> > v1 -> v2: >> > After a discussion with Michael, Paolo and Alex, this >> > patch silent drops the romfile instead of not allowing >> > the hotplug. >> > >> > An OK from libvirt will be nice. >> > >> > hw/pci/pci.c | 16 +++++++++++++++- >> > 1 file changed, 15 insertions(+), 1 deletion(-) >> > >> > diff --git a/hw/pci/pci.c b/hw/pci/pci.c >> > index 6ce75aa..cd7a403 100644 >> > --- a/hw/pci/pci.c >> > +++ b/hw/pci/pci.c >> > @@ -1776,7 +1776,12 @@ static int pci_qdev_init(DeviceState *qdev) >> > pci_dev->romfile = g_strdup(pc->romfile); >> > is_default_rom = true; >> > } >> > - pci_add_option_rom(pci_dev, is_default_rom); >> > + >> > + rc = pci_add_option_rom(pci_dev, is_default_rom); >> > + if (rc != 0) { >> > + pci_unregister_device(DEVICE(pci_dev)); >> > + return rc; >> > + } >> > >> > return 0; >> > } >> >> Looks like this part isn't covered by the commit message. >> >> Before: errors in pci_add_option_rom() are reported, but the function >> succeeds anyway. After: it fails. Is this a silent bug fix? > Yes, it made sense for V1, less for V2, but I wanted to keep it. > Should I split in 2 patches? Yes, please. [...]