All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] xen-pvdevice: convert to realize()
@ 2015-12-22  2:43 Cao jin
  2015-12-22 11:51 ` Stefano Stabellini
  0 siblings, 1 reply; 4+ messages in thread
From: Cao jin @ 2015-12-22  2:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefano.stabellini

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
 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..9abcf25 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");
+        return;
+    }
 
     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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] xen-pvdevice: convert to realize()
  2015-12-22  2:43 [Qemu-devel] [PATCH v2] xen-pvdevice: convert to realize() Cao jin
@ 2015-12-22 11:51 ` Stefano Stabellini
  2016-01-21 13:28   ` Cao jin
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Stabellini @ 2015-12-22 11:51 UTC (permalink / raw)
  To: Cao jin; +Cc: qemu-devel, stefano.stabellini

On Tue, 22 Dec 2015, Cao jin wrote:
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


>  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..9abcf25 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");
> +        return;
> +    }
>  
>      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
> 
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] xen-pvdevice: convert to realize()
  2015-12-22 11:51 ` Stefano Stabellini
@ 2016-01-21 13:28   ` Cao jin
  2016-01-21 15:45     ` Stefano Stabellini
  0 siblings, 1 reply; 4+ messages in thread
From: Cao jin @ 2016-01-21 13:28 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: qemu-devel

Hi Stefano,

     just want to make sure: is this picked up?

On 12/22/2015 07:51 PM, Stefano Stabellini wrote:
> On Tue, 22 Dec 2015, Cao jin wrote:
>> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
>
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>
>
>>   hw/i386/xen/xen_pvdevice.c | 12 ++++++------
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>


-- 
Yours Sincerely,

Cao jin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] xen-pvdevice: convert to realize()
  2016-01-21 13:28   ` Cao jin
@ 2016-01-21 15:45     ` Stefano Stabellini
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2016-01-21 15:45 UTC (permalink / raw)
  To: Cao jin; +Cc: qemu-devel, Stefano Stabellini

Yes, it is in my "next" branch, I am waiting for your larger series to be
fully acked to commit it, then I'll send a pull request with everything
outstanding in it.

On Thu, 21 Jan 2016, Cao jin wrote:
> Hi Stefano,
> 
>     just want to make sure: is this picked up?
> 
> On 12/22/2015 07:51 PM, Stefano Stabellini wrote:
> > On Tue, 22 Dec 2015, Cao jin wrote:
> > > Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> > 
> > Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > 
> > 
> > >   hw/i386/xen/xen_pvdevice.c | 12 ++++++------
> > >   1 file changed, 6 insertions(+), 6 deletions(-)
> > > 
> 
> 
> -- 
> Yours Sincerely,
> 
> Cao jin
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-21 15:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-22  2:43 [Qemu-devel] [PATCH v2] xen-pvdevice: convert to realize() Cao jin
2015-12-22 11:51 ` Stefano Stabellini
2016-01-21 13:28   ` Cao jin
2016-01-21 15:45     ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.