From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBBtv-000509-V7 for qemu-devel@nongnu.org; Mon, 21 Dec 2015 20:38:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBBts-00082P-Nu for qemu-devel@nongnu.org; Mon, 21 Dec 2015 20:38:07 -0500 Received: from [59.151.112.132] (port=2502 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBBts-00081Q-C9 for qemu-devel@nongnu.org; Mon, 21 Dec 2015 20:38:04 -0500 References: <1450436632-23980-1-git-send-email-caoj.fnst@cn.fujitsu.com> <1450436632-23980-6-git-send-email-caoj.fnst@cn.fujitsu.com> From: Cao jin Message-ID: <5678A63A.1020102@cn.fujitsu.com> Date: Tue, 22 Dec 2015 09:24:10 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/5] xen-pvdevice: convert to realize() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: ehabkost@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com, leon.alrae@imgtec.com, aurelien@aurel32.net, rth@twiddle.net On 12/21/2015 11:15 PM, Stefano Stabellini wrote: > On Fri, 18 Dec 2015, Cao jin wrote: >> Signed-off-by: Cao jin >> --- >> hw/i386/xen/xen_pvdevice.c | 12 ++++++------ >> 1 file changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c >> index c218947..a6c93d0 100644 >> --- a/hw/i386/xen/xen_pvdevice.c >> +++ b/hw/i386/xen/xen_pvdevice.c >> @@ -69,14 +69,16 @@ static const MemoryRegionOps xen_pv_mmio_ops = { >> .endianness = DEVICE_LITTLE_ENDIAN, >> }; >> >> -static int xen_pv_init(PCIDevice *pci_dev) >> +static void xen_pv_realize(PCIDevice *pci_dev, Error **errp) >> { >> XenPVDevice *d = XEN_PV_DEVICE(pci_dev); >> uint8_t *pci_conf; >> >> /* device-id property must always be supplied */ >> - if (d->device_id == 0xffff) >> - return -1; >> + if (d->device_id == 0xffff) { >> + error_setg(errp, "Device ID invalid, it must always be supplied") > > This doesn't even compile: you are missing a ';' > > Please at least build test patches. > Yup...sorry for the silly mistake...but weird, I did build and didn`t got error... > >> + return; > > I realize that there was a tab before there, but please use spaces for > indentation. > surprised that I didn`t recognized the tab...V2 is coming soon. > >> + } >> >> pci_conf = pci_dev->config; >> >> @@ -97,8 +99,6 @@ static int xen_pv_init(PCIDevice *pci_dev) >> >> pci_register_bar(pci_dev, 1, PCI_BASE_ADDRESS_MEM_PREFETCH, >> &d->mmio); >> - >> - return 0; >> } >> >> static Property xen_pv_props[] = { >> @@ -114,7 +114,7 @@ static void xen_pv_class_init(ObjectClass *klass, void *data) >> DeviceClass *dc = DEVICE_CLASS(klass); >> PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); >> >> - k->init = xen_pv_init; >> + k->realize = xen_pv_realize; >> k->class_id = PCI_CLASS_SYSTEM_OTHER; >> dc->desc = "Xen PV Device"; >> dc->props = xen_pv_props; >> -- >> 2.1.0 >> >> >> >> > > > . > -- Yours Sincerely, Cao Jin