vhost-user-fs: add the "bootindex" property
PATCH 1/1 vhost-user-fs: add the "bootindex" property
virtio-fs qualifies as a bootable device minimally under OVMF, but currently the necessary "bootindex" property is missing (fw_cfg kernel boot notwithstanding).
Add the property. For completeness, add it to the CCW device as well; other virtio-ccw devices seem to have "bootindex" properties too.
Example OpenFirmware device path for the "vhost-user-fs-pci" device in the "bootorder" fw_cfg file:
/pci@i0cf8/pci-bridge@1,6/pci1af4,105a@0/filesystem@0
--- include/hw/virtio/vhost-user-fs.h | 1 + hw/s390x/vhost-user-fs-ccw.c | 2 ++ hw/virtio/vhost-user-fs-pci.c | 2 ++ hw/virtio/vhost-user-fs.c | 10 ++++++++++ 4 files changed, 15 insertions(+)
include/hw/virtio/vhost-user-fs.h +1 -0
@@ -39,6 +39,7 @@ struct VHostUserFS {VhostUserState vhost_user;VirtQueue **req_vqs;VirtQueue *hiprio_vq; +int32_t bootindex;/*< public >*/ };
hw/s390x/vhost-user-fs-ccw.c +2 -0
@@ -47,6 +47,8 @@ static void vhost_user_fs_ccw_instance_init(Object *obj) ccw_dev->force_revision_1 = true;virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VHOST_USER_FS ); +object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev), +"bootindex" ); }static void vhost_user_fs_ccw_class_init (ObjectClass *klass,void *data)
hw/virtio/vhost-user-fs-pci.c +2 -0
@@ -68,6 +68,8 @@ static void vhost_user_fs_pci_instance_init(Object *obj)virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VHOST_USER_FS ); +object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev), +"bootindex" ); }static const VirtioPCIDeviceTypeInfo vhost_user_fs_pci_info = {
hw/virtio/vhost-user-fs.c +10 -0
@@ -22,6 +22,7 @@#include "qemu/error-report.h" #include "hw/virtio/vhost-user-fs.h" #include "monitor/monitor.h" +#include "sysemu/sysemu.h" static void vuf_get_config (VirtIODevice *vdev,uint8_t *config) {
@@ -279,6 +280,14 @@ static Property vuf_properties[] = { DEFINE_PROP_END_OF_LIST(), }; +static void vuf_instance_init (Object *obj) +{ +VHostUserFS *fs =VHOST_USER_FS (obj); + +device_add_bootindex_property (obj, &fs->bootindex,"bootindex" , +"/filesystem@0" ,DEVICE (obj)); +} +static void vuf_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);
@@ -300,6 +309,7 @@ static const TypeInfo vuf_info = { .name = TYPE_VHOST_USER_FS, .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VHostUserFS), + .instance_init = vuf_instance_init, .class_init = vuf_class_init, };
Signature · 1 line
2.19.1.3.g30247aa5d201
Ping
Quoted 102 lines · Laszlo Ersek
virtio-fs qualifies as a bootable device minimally under OVMF, but currently the necessary "bootindex" property is missing (
fw_cfgkernel boot notwithstanding).Add the property. For completeness, add it to the CCW device as well; other virtio-ccw devices seem to have "bootindex" properties too.
Example OpenFirmware device path for the "vhost-user-fs-pci" device in the "bootorder"
fw_cfgfile:/pci@i0cf8/pci-bridge@1,6/pci1af4,105a@0/filesystem@0
Cc "Dr. David Alan Gilbert" <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>Cc Christian Borntraeger <[email protected]>Cc Cornelia Huck <[email protected]>Cc Halil Pasic <[email protected]>Cc Stefan Hajnoczi <[email protected]>Signed-off-by Laszlo Ersek <[email protected]>--- include/hw/virtio/vhost-user-fs.h | 1 + hw/s390x/vhost-user-fs-ccw.c | 2 ++ hw/virtio/vhost-user-fs-pci.c | 2 ++ hw/virtio/vhost-user-fs.c | 10 ++++++++++ 4 files changed, 15 insertions(+)include/hw/virtio/vhost-user-fs.h +1
-0@@ -39,6 +39,7 @@ struct VHostUserFS {VhostUserState vhost_user;VirtQueue **req_vqs;VirtQueue *hiprio_vq; +int32_t bootindex;/*< public >*/ };hw/s390x/vhost-user-fs-ccw.c +2
-0@@ -47,6 +47,8 @@ static void vhost_user_fs_ccw_instance_init(Object *obj) ccw_dev->force_revision_1 = true;virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VHOST_USER_FS ); +object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev), +"bootindex" ); }static void vhost_user_fs_ccw_class_init (ObjectClass *klass,void *data)hw/virtio/vhost-user-fs-pci.c +2
-0@@ -68,6 +68,8 @@ static void vhost_user_fs_pci_instance_init(Object *obj)virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VHOST_USER_FS ); +object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev), +"bootindex" ); }static const VirtioPCIDeviceTypeInfo vhost_user_fs_pci_info = {hw/virtio/vhost-user-fs.c +10
-0@@ -22,6 +22,7 @@#include "qemu/error-report.h" #include "hw/virtio/vhost-user-fs.h" #include "monitor/monitor.h" +#include "sysemu/sysemu.h" static void vuf_get_config (VirtIODevice *vdev,uint8_t *config) {@@ -279,6 +280,14 @@ static Property vuf_properties[] = { DEFINE_PROP_END_OF_LIST(), }; +static void vuf_instance_init (Object *obj) +{ +VHostUserFS *fs =VHOST_USER_FS (obj); + +device_add_bootindex_property (obj, &fs->bootindex,"bootindex" , +"/filesystem@0" ,DEVICE (obj)); +} +static void vuf_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);@@ -300,6 +309,7 @@ static const TypeInfo vuf_info = { .name = TYPE_VHOST_USER_FS, .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VHostUserFS), + .instance_init = vuf_instance_init, .class_init = vuf_class_init, };
Quoted 6 lines · Laszlo Ersek
virtio-fs qualifies as a bootable device minimally under OVMF, but currently the necessary "bootindex" property is missing (
fw_cfgkernel boot notwithstanding).Add the property. For completeness, add it to the CCW device as well; other virtio-ccw devices seem to have "bootindex" properties too.
Currently we do not have boot support for virtiofs on s390x (ccw) Not sure if it is better if we should add the property now or whenever boot support is implemented.
As of today we do have bootindex for block and net. Maybe it is better to defer bootindex for virtio-fs-ccw until we can boot from it? In that way management software can detect if this is bootable or not?
Quoted 96 lines
Example OpenFirmware device path for the "vhost-user-fs-pci" device in the "bootorder"
fw_cfgfile:/pci@i0cf8/pci-bridge@1,6/pci1af4,105a@0/filesystem@0
Cc "Dr. David Alan Gilbert" <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>Cc Christian Borntraeger <[email protected]>Cc Cornelia Huck <[email protected]>Cc Halil Pasic <[email protected]>Cc Stefan Hajnoczi <[email protected]>Signed-off-by Laszlo Ersek <[email protected]>--- include/hw/virtio/vhost-user-fs.h | 1 + hw/s390x/vhost-user-fs-ccw.c | 2 ++ hw/virtio/vhost-user-fs-pci.c | 2 ++ hw/virtio/vhost-user-fs.c | 10 ++++++++++ 4 files changed, 15 insertions(+)include/hw/virtio/vhost-user-fs.h +1
-0@@ -39,6 +39,7 @@ struct VHostUserFS {VhostUserState vhost_user;VirtQueue **req_vqs;VirtQueue *hiprio_vq; +int32_t bootindex;/*< public >*/ };hw/s390x/vhost-user-fs-ccw.c +2
-0@@ -47,6 +47,8 @@ static void vhost_user_fs_ccw_instance_init(Object *obj) ccw_dev->force_revision_1 = true;virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VHOST_USER_FS ); +object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev), +"bootindex" ); }static void vhost_user_fs_ccw_class_init (ObjectClass *klass,void *data)hw/virtio/vhost-user-fs-pci.c +2
-0@@ -68,6 +68,8 @@ static void vhost_user_fs_pci_instance_init(Object *obj)virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VHOST_USER_FS ); +object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev), +"bootindex" ); }static const VirtioPCIDeviceTypeInfo vhost_user_fs_pci_info = {hw/virtio/vhost-user-fs.c +10
-0@@ -22,6 +22,7 @@#include "qemu/error-report.h" #include "hw/virtio/vhost-user-fs.h" #include "monitor/monitor.h" +#include "sysemu/sysemu.h" static void vuf_get_config (VirtIODevice *vdev,uint8_t *config) {@@ -279,6 +280,14 @@ static Property vuf_properties[] = { DEFINE_PROP_END_OF_LIST(), }; +static void vuf_instance_init (Object *obj) +{ +VHostUserFS *fs =VHOST_USER_FS (obj); + +device_add_bootindex_property (obj, &fs->bootindex,"bootindex" , +"/filesystem@0" ,DEVICE (obj)); +} +static void vuf_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);@@ -300,6 +309,7 @@ static const TypeInfo vuf_info = { .name = TYPE_VHOST_USER_FS, .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VHostUserFS), + .instance_init = vuf_instance_init, .class_init = vuf_class_init, };
Quoted 10 lines · Christian Borntraeger
Quoted 6 lines · Laszlo Ersek
virtio-fs qualifies as a bootable device minimally under OVMF, but currently the necessary "bootindex" property is missing (
fw_cfgkernel boot notwithstanding).Add the property. For completeness, add it to the CCW device as well; other virtio-ccw devices seem to have "bootindex" properties too.
Quoted 6 lines
Currently we do not have boot support for virtiofs on s390x (ccw) Not sure if it is better if we should add the property now or whenever boot support is implemented.
As of today we do have bootindex for block and net. Maybe it is better to defer bootindex for virtio-fs-ccw until we can boot from it? In that way management software can detect if this is bootable or not?
Sure, I can drop the "vhost-user-fs-ccw.c hunk".
(I guess I could even lift the property itself (replacing the alias) to "vhost-user-fs-pci.c", for now -- what's everyone's take on that?)
Thanks
Laszlo
Quoted 98 lines
Quoted 97 lines
Example OpenFirmware device path for the "vhost-user-fs-pci" device in the "bootorder"
fw_cfgfile:/pci@i0cf8/pci-bridge@1,6/pci1af4,105a@0/filesystem@0
Cc "Dr. David Alan Gilbert" <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>Cc Christian Borntraeger <[email protected]>Cc Cornelia Huck <[email protected]>Cc Halil Pasic <[email protected]>Cc Stefan Hajnoczi <[email protected]>Signed-off-by Laszlo Ersek <[email protected]>--- include/hw/virtio/vhost-user-fs.h | 1 + hw/s390x/vhost-user-fs-ccw.c | 2 ++ hw/virtio/vhost-user-fs-pci.c | 2 ++ hw/virtio/vhost-user-fs.c | 10 ++++++++++ 4 files changed, 15 insertions(+)include/hw/virtio/vhost-user-fs.h +1
-0@@ -39,6 +39,7 @@ struct VHostUserFS {VhostUserState vhost_user;VirtQueue **req_vqs;VirtQueue *hiprio_vq; +int32_t bootindex;/*< public >*/ };hw/s390x/vhost-user-fs-ccw.c +2
-0@@ -47,6 +47,8 @@ static void vhost_user_fs_ccw_instance_init(Object *obj) ccw_dev->force_revision_1 = true;virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VHOST_USER_FS ); +object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev), +"bootindex" ); }static void vhost_user_fs_ccw_class_init (ObjectClass *klass,void *data)hw/virtio/vhost-user-fs-pci.c +2
-0@@ -68,6 +68,8 @@ static void vhost_user_fs_pci_instance_init(Object *obj)virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VHOST_USER_FS ); +object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev), +"bootindex" ); }static const VirtioPCIDeviceTypeInfo vhost_user_fs_pci_info = {hw/virtio/vhost-user-fs.c +10
-0@@ -22,6 +22,7 @@#include "qemu/error-report.h" #include "hw/virtio/vhost-user-fs.h" #include "monitor/monitor.h" +#include "sysemu/sysemu.h" static void vuf_get_config (VirtIODevice *vdev,uint8_t *config) {@@ -279,6 +280,14 @@ static Property vuf_properties[] = { DEFINE_PROP_END_OF_LIST(), }; +static void vuf_instance_init (Object *obj) +{ +VHostUserFS *fs =VHOST_USER_FS (obj); + +device_add_bootindex_property (obj, &fs->bootindex,"bootindex" , +"/filesystem@0" ,DEVICE (obj)); +} +static void vuf_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);@@ -300,6 +309,7 @@ static const TypeInfo vuf_info = { .name = TYPE_VHOST_USER_FS, .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VHostUserFS), + .instance_init = vuf_instance_init, .class_init = vuf_class_init, };
Quoted 18 lines · Laszlo Ersek
Quoted 10 lines · Christian Borntraeger
Quoted 6 lines · Laszlo Ersek
virtio-fs qualifies as a bootable device minimally under OVMF, but currently the necessary "bootindex" property is missing (
fw_cfgkernel boot notwithstanding).Add the property. For completeness, add it to the CCW device as well; other virtio-ccw devices seem to have "bootindex" properties too.
Quoted 6 lines
Currently we do not have boot support for virtiofs on s390x (ccw) Not sure if it is better if we should add the property now or whenever boot support is implemented.
As of today we do have bootindex for block and net. Maybe it is better to defer bootindex for virtio-fs-ccw until we can boot from it? In that way management software can detect if this is bootable or not?
Quoted 4 lines
Sure, I can drop the "
vhost-user-fs-ccw.chunk".(I guess I could even lift the property itself (replacing the alias) to "
vhost-user-fs-pci.c", for now -- what's everyone's take on that?)
Keep it as is. This would simplify a later addition to ccw.
Quoted 21 lines · Christian Borntraeger
Quoted 18 lines · Laszlo Ersek
Quoted 16 lines · Christian Borntraeger
Quoted 6 lines · Laszlo Ersek
virtio-fs qualifies as a bootable device minimally under OVMF, but currently the necessary "bootindex" property is missing (
fw_cfgkernel boot notwithstanding).Add the property. For completeness, add it to the CCW device as well; other virtio-ccw devices seem to have "bootindex" properties too.
Currently we do not have boot support for virtiofs on s390x (ccw) Not sure if it is better if we should add the property now or whenever boot support is implemented.
As of today we do have bootindex for block and net. Maybe it is better to defer bootindex for virtio-fs-ccw until we can boot from it? In that way management software can detect if this is bootable or not?
Quoted 7 lines
Quoted 4 lines
Sure, I can drop the "
vhost-user-fs-ccw.chunk".(I guess I could even lift the property itself (replacing the alias) to "
vhost-user-fs-pci.c", for now -- what's everyone's take on that?)Keep it as is. This would simplify a later addition to ccw.
Thanks!
I'll wait for some feedback from the other reviewers, before posting v2.
Laszlo
Quoted 21 lines · On Mon, 4 Jan 2021 14:24:01 +0100 Laszlo Ersek <[email protected]> wrote:
virtio-fs qualifies as a bootable device minimally under OVMF, but currently the necessary "bootindex" property is missing (
fw_cfgkernel boot notwithstanding).Add the property. For completeness, add it to the CCW device as well; other virtio-ccw devices seem to have "bootindex" properties too.
Example OpenFirmware device path for the "vhost-user-fs-pci" device in the "bootorder"
fw_cfgfile:/pci@i0cf8/pci-bridge@1,6/pci1af4,105a@0/filesystem@0
Cc "Dr. David Alan Gilbert" <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>Cc Christian Borntraeger <[email protected]>Cc Cornelia Huck <[email protected]>Cc Halil Pasic <[email protected]>Cc Stefan Hajnoczi <[email protected]>Signed-off-by Laszlo Ersek <[email protected]>
Quoted 7 lines
--- include/hw/virtio/vhost-user-fs.h | 1 + hw/s390x/vhost-user-fs-ccw.c | 2 ++ hw/virtio/vhost-user-fs-pci.c | 2 ++ hw/virtio/vhost-user-fs.c | 10 ++++++++++ 4 files changed, 15 insertions(+)
I agree that you should just drop the ccw hunk for now. The rest of the patch looks good to me.
Quoted 32 lines · Cornelia Huck
Quoted 21 lines · On Mon, 4 Jan 2021 14:24:01 +0100 Laszlo Ersek <[email protected]> wrote:
virtio-fs qualifies as a bootable device minimally under OVMF, but currently the necessary "bootindex" property is missing (
fw_cfgkernel boot notwithstanding).Add the property. For completeness, add it to the CCW device as well; other virtio-ccw devices seem to have "bootindex" properties too.
Example OpenFirmware device path for the "vhost-user-fs-pci" device in the "bootorder"
fw_cfgfile:/pci@i0cf8/pci-bridge@1,6/pci1af4,105a@0/filesystem@0
Cc "Dr. David Alan Gilbert" <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>Cc Christian Borntraeger <[email protected]>Cc Cornelia Huck <[email protected]>Cc Halil Pasic <[email protected]>Cc Stefan Hajnoczi <[email protected]>Signed-off-by Laszlo Ersek <[email protected]>Quoted 7 lines
--- include/hw/virtio/vhost-user-fs.h | 1 + hw/s390x/vhost-user-fs-ccw.c | 2 ++ hw/virtio/vhost-user-fs-pci.c | 2 ++ hw/virtio/vhost-user-fs.c | 10 ++++++++++ 4 files changed, 15 insertions(+)
Quoted 3 lines
I agree that you should just drop the ccw hunk for now. The rest of the patch looks good to me.
Thank you as well -- with the ccw hunk gone, I guess the CC list will be shorter in v2, too :)
Dave, Stefan, Michael -- can you please comment? For the files to remain in v2, "get_maintainer.pl" gives me:
"Dr. David Alan Gilbert" <[email protected]> (supporter:virtiofs) "Michael S. Tsirkin" <[email protected]> (supporter:vhost) "Michael S. Tsirkin" <[email protected]> (supporter:virtio) Stefan Hajnoczi <[email protected]> (supporter:virtiofs)
Thanks
Laszlo
Quoted 21 lines · * Laszlo Ersek ([email protected]) wrote:
virtio-fs qualifies as a bootable device minimally under OVMF, but currently the necessary "bootindex" property is missing (
fw_cfgkernel boot notwithstanding).Add the property. For completeness, add it to the CCW device as well; other virtio-ccw devices seem to have "bootindex" properties too.
Example OpenFirmware device path for the "vhost-user-fs-pci" device in the "bootorder"
fw_cfgfile:/pci@i0cf8/pci-bridge@1,6/pci1af4,105a@0/filesystem@0
Cc "Dr. David Alan Gilbert" <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>Cc Christian Borntraeger <[email protected]>Cc Cornelia Huck <[email protected]>Cc Halil Pasic <[email protected]>Cc Stefan Hajnoczi <[email protected]>Signed-off-by Laszlo Ersek <[email protected]>
Quoted 7 lines
--- include/hw/virtio/vhost-user-fs.h | 1 + hw/s390x/vhost-user-fs-ccw.c | 2 ++ hw/virtio/vhost-user-fs-pci.c | 2 ++ hw/virtio/vhost-user-fs.c | 10 ++++++++++ 4 files changed, 15 insertions(+)
That looks reasonable; although I'm not familiar with the bootindex system; so
Quoted 76 lines
include/hw/virtio/vhost-user-fs.h +1
-0@@ -39,6 +39,7 @@ struct VHostUserFS {VhostUserState vhost_user;VirtQueue **req_vqs;VirtQueue *hiprio_vq; +int32_t bootindex;/*< public >*/ };hw/s390x/vhost-user-fs-ccw.c +2
-0@@ -47,6 +47,8 @@ static void vhost_user_fs_ccw_instance_init(Object *obj) ccw_dev->force_revision_1 = true;virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VHOST_USER_FS ); +object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev), +"bootindex" ); }static void vhost_user_fs_ccw_class_init (ObjectClass *klass,void *data)hw/virtio/vhost-user-fs-pci.c +2
-0@@ -68,6 +68,8 @@ static void vhost_user_fs_pci_instance_init(Object *obj)virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VHOST_USER_FS ); +object_property_add_alias (obj,"bootindex" ,OBJECT (&dev->vdev), +"bootindex" ); }static const VirtioPCIDeviceTypeInfo vhost_user_fs_pci_info = {hw/virtio/vhost-user-fs.c +10
-0@@ -22,6 +22,7 @@#include "qemu/error-report.h" #include "hw/virtio/vhost-user-fs.h" #include "monitor/monitor.h" +#include "sysemu/sysemu.h" static void vuf_get_config (VirtIODevice *vdev,uint8_t *config) {@@ -279,6 +280,14 @@ static Property vuf_properties[] = { DEFINE_PROP_END_OF_LIST(), }; +static void vuf_instance_init (Object *obj) +{ +VHostUserFS *fs =VHOST_USER_FS (obj); + +device_add_bootindex_property (obj, &fs->bootindex,"bootindex" , +"/filesystem@0" ,DEVICE (obj)); +} +static void vuf_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);@@ -300,6 +309,7 @@ static const TypeInfo vuf_info = { .name = TYPE_VHOST_USER_FS, .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VHostUserFS), + .instance_init = vuf_instance_init, .class_init = vuf_class_init, };Signature · 1 line
2.19.1.3.g30247aa5d201
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK