Skip to contentSkip to conversation

virtio-blk: Drop x-data-plane option

PATCH In review Fam Zheng 5 participants 9 messages Dec 7, 2015 – Dec 9, 2015

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 virtio-blk: Drop x-data-plane option

The official way of enabling dataplane is through the "iothread" property that references an iothread object created by "-object iothread". Since the old "x-data-plane=on" way now even crashes, it's probably easier to just drop it:

$ qemu-system-x86_64 -drive file=null-co://,id=d0,if=none \
    -device virtio-blk-pci,drive=d0,x-data-plane=on

ERROR:/home/fam/work/qemu/qom/object.c:1515:
object_get_canonical_path_component: assertion failed: (obj->parent != NULL) Aborted

---
 hw/block/dataplane/virtio-blk.c | 15 ++-------------
 hw/block/virtio-blk.c           |  1 -
 include/hw/virtio/virtio-blk.h  |  1 -
 3 files changed, 2 insertions(+), 15 deletions(-)
hw/block/dataplane/virtio-blk.c +2 -13
index c42ddeb..c57f293 100644
@@ -45,7 +45,6 @@ struct VirtIOBlockDataPlane {
      * use it).
      */
     IOThread *iothread;
-    IOThread internal_iothread_obj;
     AioContext *ctx;
     EventNotifier host_notifier;    /* doorbell */
 
@@ -149,14 +148,14 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf,
 
     *dataplane = NULL;
 
-    if (!conf->data_plane && !conf->iothread) {
+    if (!conf->iothread) {
         return;
     }
 
     /* Don't try if transport does not support notifiers. */
     if (!k->set_guest_notifiers || !k->set_host_notifier) {
         error_setg(errp,
-                   "device is incompatible with x-data-plane "
+                   "device is incompatible with dataplane "
                    "(transport does not support notifiers)");
         return;
     }
@@ -179,16 +178,6 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf,
     if (conf->iothread) {
         s->iothread = conf->iothread;
         object_ref(OBJECT(s->iothread));
-    } else {
-        /* Create per-device IOThread if none specified.  This is for
-         * x-data-plane option compatibility.  If x-data-plane is removed we
-         * can drop this.
-         */
-        object_initialize(&s->internal_iothread_obj,
-                          sizeof(s->internal_iothread_obj),
-                          TYPE_IOTHREAD);
-        user_creatable_complete(OBJECT(&s->internal_iothread_obj), &error_abort);
-        s->iothread = &s->internal_iothread_obj;
     }
     s->ctx = iothread_get_aio_context(s->iothread);
     s->bh = aio_bh_new(s->ctx, notify_guest_bh, s);
hw/block/virtio-blk.c +0 -1
index 756ae5c..b88b726 100644
@@ -986,7 +986,6 @@ static Property virtio_blk_properties[] = {
 #endif
     DEFINE_PROP_BIT("request-merging", VirtIOBlock, conf.request_merging, 0,
                     true),
-    DEFINE_PROP_BIT("x-data-plane", VirtIOBlock, conf.data_plane, 0, false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
include/hw/virtio/virtio-blk.h +0 -1
index 6bf5905..ae11a63 100644
@@ -37,7 +37,6 @@ struct VirtIOBlkConf
     char *serial;
     uint32_t scsi;
     uint32_t config_wce;
-    uint32_t data_plane;
     uint32_t request_merging;
 };
 
Signature · 1 line
2.4.3
#1 lore raw
Quoted 11 lines · On Mon, 7 Dec 2015 18:59:27 +0800 Fam Zheng <[email protected]> wrote:

The official way of enabling dataplane is through the "iothread" property that references an iothread object created by "-object iothread". Since the old "x-data-plane=on" way now even crashes, it's probably easier to just drop it:

$ qemu-system-x86_64 -drive file=null-co://,id=d0,if=none \
    -device virtio-blk-pci,drive=d0,x-data-plane=on

ERROR:/home/fam/work/qemu/qom/object.c:1515:
object_get_canonical_path_component: assertion failed: (obj->parent != NULL) Aborted

Do we understand yet why this crashes, btw?

Quoted 8 lines
---
 hw/block/dataplane/virtio-blk.c | 15 ++-------------
 hw/block/virtio-blk.c           |  1 -
 include/hw/virtio/virtio-blk.h  |  1 -
 3 files changed, 2 insertions(+), 15 deletions(-)

No general objection to removing x-data-plane; but this probably wants a mention on the changelog as x-data-plane has been described in various howtos etc. over the years.

author
#2 lore raw
Quoted 8 lines · Cornelia Huck
Quoted 5 lines · On Mon, 7 Dec 2015 18:59:27 +0800 Fam Zheng <[email protected]> wrote:

The official way of enabling dataplane is through the "iothread" property that references an iothread object created by "-object iothread". Since the old "x-data-plane=on" way now even crashes, it's probably easier to just drop it:

Quoted 8 lines
Quoted 6 lines
$ qemu-system-x86_64 -drive file=null-co://,id=d0,if=none \
    -device virtio-blk-pci,drive=d0,x-data-plane=on

ERROR:/home/fam/work/qemu/qom/object.c:1515:
object_get_canonical_path_component: assertion failed: (obj->parent != NULL) Aborted

Do we understand yet why this crashes, btw?

I think it's because with x-data-plane=on, virtio-blk initialize an object that doesn't have a parent, therefore it doesn't have a valid "canonical path component" thing, which is different from objects created with "-object" CLI. I'm not very familiar with the QOM semantics here.

Quoted 10 lines
Quoted 9 lines
---
 hw/block/dataplane/virtio-blk.c | 15 ++-------------
 hw/block/virtio-blk.c           |  1 -
 include/hw/virtio/virtio-blk.h  |  1 -
 3 files changed, 2 insertions(+), 15 deletions(-)
Quoted 4 lines

No general objection to removing x-data-plane; but this probably wants a mention on the changelog as x-data-plane has been described in various howtos etc. over the years.

Yes, that is a good point. I don't know if it's too rushing in removing it for 2.5 (this is just posted as one option) and we'll have to count on QOM experts for the fix, if it is.

Fam

#3 lore raw
Quoted 33 lines · Fam Zheng
Quoted 8 lines · Cornelia Huck
Quoted 5 lines · On Mon, 7 Dec 2015 18:59:27 +0800 Fam Zheng <[email protected]> wrote:

The official way of enabling dataplane is through the "iothread" property that references an iothread object created by "-object iothread". Since the old "x-data-plane=on" way now even crashes, it's probably easier to just drop it:

Quoted 8 lines
Quoted 6 lines
$ qemu-system-x86_64 -drive file=null-co://,id=d0,if=none \
    -device virtio-blk-pci,drive=d0,x-data-plane=on

ERROR:/home/fam/work/qemu/qom/object.c:1515:
object_get_canonical_path_component: assertion failed: (obj->parent != NULL) Aborted

Do we understand yet why this crashes, btw?

I think it's because with x-data-plane=on, virtio-blk initialize an object that doesn't have a parent, therefore it doesn't have a valid "canonical path component" thing, which is different from objects created with "-object" CLI. I'm not very familiar with the QOM semantics here.

Quoted 10 lines
Quoted 9 lines
---
 hw/block/dataplane/virtio-blk.c | 15 ++-------------
 hw/block/virtio-blk.c           |  1 -
 include/hw/virtio/virtio-blk.h  |  1 -
 3 files changed, 2 insertions(+), 15 deletions(-)
Quoted 7 lines
Quoted 3 lines

No general objection to removing x-data-plane; but this probably wants a mention on the changelog as x-data-plane has been described in various howtos etc. over the years.

Yes, that is a good point. I don't know if it's too rushing in removing it for 2.5 (this is just posted as one option) and we'll have to count on QOM experts for the fix, if it is.

The solution would be to add object_property_add_child to virtio_blk_data_plane_create, between object_initialize and user_creatable_complete. But I think this patch is ok for 2.5.

Paolo

#4 lore raw
Quoted 3 lines · On Mon, 7 Dec 2015 16:19:07 +0100 Paolo Bonzini <[email protected]> wrote:

The solution would be to add object_property_add_child to virtio_blk_data_plane_create, between object_initialize and user_creatable_complete. But I think this patch is ok for 2.5.

Just sent a patch that does this. If it is correct, I'd prefer it over either removing x-data-plane or reverting the iothread patch.

#5 lore raw
In reply to Paolo Bonzini
Quoted 40 lines · Paolo Bonzini
Quoted 37 lines · Fam Zheng
Quoted 8 lines · Cornelia Huck
Quoted 5 lines · On Mon, 7 Dec 2015 18:59:27 +0800 Fam Zheng <[email protected]> wrote:

The official way of enabling dataplane is through the "iothread" property that references an iothread object created by "-object iothread". Since the old "x-data-plane=on" way now even crashes, it's probably easier to just drop it:

Quoted 8 lines
Quoted 6 lines
$ qemu-system-x86_64 -drive file=null-co://,id=d0,if=none \
    -device virtio-blk-pci,drive=d0,x-data-plane=on

ERROR:/home/fam/work/qemu/qom/object.c:1515:
object_get_canonical_path_component: assertion failed: (obj->parent != NULL) Aborted

Do we understand yet why this crashes, btw?

I think it's because with x-data-plane=on, virtio-blk initialize an object that doesn't have a parent, therefore it doesn't have a valid "canonical path component" thing, which is different from objects created with "-object" CLI. I'm not very familiar with the QOM semantics here.

Quoted 13 lines
Quoted 9 lines
---
 hw/block/dataplane/virtio-blk.c | 15 ++-------------
 hw/block/virtio-blk.c           |  1 -
 include/hw/virtio/virtio-blk.h  |  1 -
 3 files changed, 2 insertions(+), 15 deletions(-)

No general objection to removing x-data-plane; but this probably wants a mention on the changelog as x-data-plane has been described in various howtos etc. over the years.

Quoted 7 lines
Quoted 3 lines

Yes, that is a good point. I don't know if it's too rushing in removing it for 2.5 (this is just posted as one option) and we'll have to count on QOM experts for the fix, if it is.

The solution would be to add object_property_add_child to virtio_blk_data_plane_create, between object_initialize and user_creatable_complete. But I think this patch is ok for 2.5.

Paolo asked me to apply this to master, so I have done so.

thanks
-- PMM

#6 lore raw
Quoted 45 lines · Peter Maydell
Quoted 44 lines · Paolo Bonzini
Quoted 40 lines · Fam Zheng
Quoted 8 lines · Cornelia Huck
Quoted 5 lines · On Mon, 7 Dec 2015 18:59:27 +0800 Fam Zheng <[email protected]> wrote:

The official way of enabling dataplane is through the "iothread" property that references an iothread object created by "-object iothread". Since the old "x-data-plane=on" way now even crashes, it's probably easier to just drop it:

Quoted 8 lines
Quoted 6 lines
$ qemu-system-x86_64 -drive file=null-co://,id=d0,if=none \
    -device virtio-blk-pci,drive=d0,x-data-plane=on

ERROR:/home/fam/work/qemu/qom/object.c:1515:
object_get_canonical_path_component: assertion failed: (obj->parent != NULL) Aborted

Do we understand yet why this crashes, btw?

I think it's because with x-data-plane=on, virtio-blk initialize an object that doesn't have a parent, therefore it doesn't have a valid "canonical path component" thing, which is different from objects created with "-object" CLI. I'm not very familiar with the QOM semantics here.

Quoted 10 lines
Quoted 9 lines
---
 hw/block/dataplane/virtio-blk.c | 15 ++-------------
 hw/block/virtio-blk.c           |  1 -
 include/hw/virtio/virtio-blk.h  |  1 -
 3 files changed, 2 insertions(+), 15 deletions(-)
Quoted 3 lines

No general objection to removing x-data-plane; but this probably wants a mention on the changelog as x-data-plane has been described in various howtos etc. over the years.

Yes, that is a good point. I don't know if it's too rushing in removing it for 2.5 (this is just posted as one option) and we'll have to count on QOM experts for the fix, if it is.

Quoted 5 lines
Quoted 3 lines

The solution would be to add object_property_add_child to virtio_blk_data_plane_create, between object_initialize and user_creatable_complete. But I think this patch is ok for 2.5.

Paolo asked me to apply this to master, so I have done so.

Okay. I will do my best to communicate that x-data-plane is gone.

Stefan

#8 lore raw
Quoted 11 lines · On Tue, 8 Dec 2015 09:56:14 +0800 Fam Zheng <[email protected]> wrote:
Quoted 4 lines · Fam Zheng
Quoted 3 lines · Cornelia Huck

No general objection to removing x-data-plane; but this probably wants a mention on the changelog as x-data-plane has been described in various howtos etc. over the years.

Add a changelog line,

http://wiki.qemu.org/ChangeLog/2.5#Block_devices_and_tools

please review.

Looks sane, although I'd probably add a line to "Incompatible changes" as well.