qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 06/20] virtio-blk: Convert to DEFINE_PROP_LINK
Date: Fri, 14 Jul 2017 09:07:15 +0800	[thread overview]
Message-ID: <20170714010715.GB18687@lemon> (raw)
In-Reply-To: <7e4168ac-896b-1927-a98e-839d3b99cacc@redhat.com>

On Thu, 07/13 15:42, Paolo Bonzini wrote:
> On 04/07/2017 08:43, Fam Zheng wrote:
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  hw/block/dataplane/virtio-blk.c | 2 +-
> >  hw/block/virtio-blk.c           | 5 +----
> >  hw/s390x/virtio-ccw.c           | 2 --
> >  hw/virtio/virtio-pci.c          | 2 --
> >  include/hw/virtio/virtio-blk.h  | 3 ++-
> >  5 files changed, 4 insertions(+), 10 deletions(-)
> > 
> > diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
> > index 5556f0e..6fdc6f6 100644
> > --- a/hw/block/dataplane/virtio-blk.c
> > +++ b/hw/block/dataplane/virtio-blk.c
> > @@ -116,7 +116,7 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf,
> >      s->conf = conf;
> >  
> >      if (conf->iothread) {
> > -        s->iothread = conf->iothread;
> > +        s->iothread = IOTHREAD(conf->iothread);
> >          object_ref(OBJECT(s->iothread));
> >          s->ctx = iothread_get_aio_context(s->iothread);
> >      } else {
> > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> > index c0bd247..8146306 100644
> > --- a/hw/block/virtio-blk.c
> > +++ b/hw/block/virtio-blk.c
> > @@ -983,10 +983,6 @@ static void virtio_blk_instance_init(Object *obj)
> >  {
> >      VirtIOBlock *s = VIRTIO_BLK(obj);
> >  
> > -    object_property_add_link(obj, "iothread", TYPE_IOTHREAD,
> > -                             (Object **)&s->conf.iothread,
> > -                             qdev_prop_allow_set_link_before_realize,
> > -                             OBJ_PROP_LINK_UNREF_ON_RELEASE, NULL);
> >      device_add_bootindex_property(obj, &s->conf.conf.bootindex,
> >                                    "bootindex", "/disk@0,0",
> >                                    DEVICE(obj), NULL);
> > @@ -1014,6 +1010,7 @@ static Property virtio_blk_properties[] = {
> >      DEFINE_PROP_BIT("request-merging", VirtIOBlock, conf.request_merging, 0,
> >                      true),
> >      DEFINE_PROP_UINT16("num-queues", VirtIOBlock, conf.num_queues, 1),
> > +    DEFINE_PROP_LINK("iothread", VirtIOBlock, conf.iothread, TYPE_IOTHREAD),
> >      DEFINE_PROP_END_OF_LIST(),
> >  };
> >  
> > diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
> > index 90d37cb..a17ce84 100644
> > --- a/hw/s390x/virtio-ccw.c
> > +++ b/hw/s390x/virtio-ccw.c
> > @@ -789,8 +789,6 @@ static void virtio_ccw_blk_instance_init(Object *obj)
> >  
> >      virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
> >                                  TYPE_VIRTIO_BLK);
> > -    object_property_add_alias(obj, "iothread", OBJECT(&dev->vdev),"iothread",
> > -                              &error_abort);
> >      object_property_add_alias(obj, "bootindex", OBJECT(&dev->vdev),
> >                                "bootindex", &error_abort);
> >  }
> > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> > index 301920e..984baf8 100644
> > --- a/hw/virtio/virtio-pci.c
> > +++ b/hw/virtio/virtio-pci.c
> > @@ -1996,8 +1996,6 @@ static void virtio_blk_pci_instance_init(Object *obj)
> >  
> >      virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
> >                                  TYPE_VIRTIO_BLK);
> > -    object_property_add_alias(obj, "iothread", OBJECT(&dev->vdev),"iothread",
> > -                              &error_abort);
> >      object_property_add_alias(obj, "bootindex", OBJECT(&dev->vdev),
> >                                "bootindex", &error_abort);
> >  }
> > diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
> > index d3c8a6f..2452074 100644
> > --- a/include/hw/virtio/virtio-blk.h
> > +++ b/include/hw/virtio/virtio-blk.h
> > @@ -33,7 +33,8 @@ struct virtio_blk_inhdr
> >  struct VirtIOBlkConf
> >  {
> >      BlockConf conf;
> > -    IOThread *iothread;
> > +    /* IOThread pointer to be filled by link property */
> > +    Object *iothread;
> 
> Is this necessary?  Can we instead add a type argument to the
> DEFINE_PROP_LINK macro, or just cast something to void*?
> 
> I understand this means the series risks missing 2.10 (but I can send a
> second pull request just for it tomorrow too).

OK, will send v4 today.

Fam

  reply	other threads:[~2017-07-14  1:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04  6:43 [Qemu-devel] [PATCH v3 00/20] qdev: Introduce DEFINE_PROP_LINK Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 01/20] qom: enforce readonly nature of link's check callback Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 02/20] qdev: Introduce PropertyInfo.create Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 03/20] qdev: Introduce DEFINE_PROP_LINK Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 04/20] qmp: Use ObjectProperty.type if present Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 05/20] qdev: Add const qualifier to PropertyInfo definitions Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 06/20] virtio-blk: Convert to DEFINE_PROP_LINK Fam Zheng
2017-07-13 13:42   ` Paolo Bonzini
2017-07-14  1:07     ` Fam Zheng [this message]
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 07/20] virtio-scsi: " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 08/20] virtio-rng: " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 09/20] virtio-crypto: " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 10/20] dimm: " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 11/20] ivshmem: " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 12/20] armv7m: Convert bitband.source-mamory " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 13/20] armv7m: Convert armv7m.memory " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 14/20] gicv3: Convert " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 15/20] xlnx_zynqmp: " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 16/20] xilinx_axienet: " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 17/20] xilinx_axidma: " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 18/20] mips_cmgcr: " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 19/20] cpu: " Fam Zheng
2017-07-04  6:43 ` [Qemu-devel] [PATCH v3 20/20] spapr_rng: " Fam Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170714010715.GB18687@lemon \
    --to=famz@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).