All of lore.kernel.org
 help / color / mirror / Atom feed
From: <arei.gonglei@huawei.com>
To: qemu-devel@nongnu.org
Cc: weidong.huang@huawei.com, subo7@huawei.com, mst@redhat.com,
	peter.huangpeng@huawei.com, Gonglei <arei.gonglei@huawei.com>,
	pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH v2 2/5] vhost-scsi: add bootindex property
Date: Thu, 29 Jan 2015 15:08:52 +0800	[thread overview]
Message-ID: <1422515335-13316-3-git-send-email-arei.gonglei@huawei.com> (raw)
In-Reply-To: <1422515335-13316-1-git-send-email-arei.gonglei@huawei.com>

From: Gonglei <arei.gonglei@huawei.com>

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 hw/scsi/vhost-scsi.c           | 9 +++++++++
 hw/virtio/virtio-pci.c         | 2 ++
 include/hw/virtio/vhost-scsi.h | 1 +
 3 files changed, 12 insertions(+)

diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index dcb2bc5..9c4f613 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -290,11 +290,20 @@ static void vhost_scsi_class_init(ObjectClass *klass, void *data)
     vdc->set_status = vhost_scsi_set_status;
 }
 
+static void vhost_scsi_instance_init(Object *obj)
+{
+    VHostSCSI *dev = VHOST_SCSI(obj);
+
+    device_add_bootindex_property(obj, &dev->bootindex, "bootindex", NULL,
+                                  DEVICE(dev), NULL);
+}
+
 static const TypeInfo vhost_scsi_info = {
     .name = TYPE_VHOST_SCSI,
     .parent = TYPE_VIRTIO_SCSI_COMMON,
     .instance_size = sizeof(VHostSCSI),
     .class_init = vhost_scsi_class_init,
+    .instance_init = vhost_scsi_instance_init,
 };
 
 static void virtio_register_types(void)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index dde1d73..604cb5b 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1238,6 +1238,8 @@ static void vhost_scsi_pci_instance_init(Object *obj)
 
     virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
                                 TYPE_VHOST_SCSI);
+    object_property_add_alias(obj, "bootindex", OBJECT(&dev->vdev),
+                              "bootindex", &error_abort);
 }
 
 static const TypeInfo vhost_scsi_pci_info = {
diff --git a/include/hw/virtio/vhost-scsi.h b/include/hw/virtio/vhost-scsi.h
index 85cc031..ed50289 100644
--- a/include/hw/virtio/vhost-scsi.h
+++ b/include/hw/virtio/vhost-scsi.h
@@ -60,6 +60,7 @@ typedef struct VHostSCSI {
     Error *migration_blocker;
 
     struct vhost_dev dev;
+    int32_t bootindex;
 } VHostSCSI;
 
 #define DEFINE_VHOST_SCSI_PROPERTIES(_state, _conf_field) \
-- 
1.7.12.4

  parent reply	other threads:[~2015-01-29  7:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29  7:08 [Qemu-devel] [PATCH v2 0/5] vhost-scsi: support to assign boot order arei.gonglei
2015-01-29  7:08 ` [Qemu-devel] [PATCH v2 1/5] qdev: support to get a device firmware path directly arei.gonglei
2015-01-29  7:08 ` arei.gonglei [this message]
2015-01-29  7:08 ` [Qemu-devel] [PATCH v2 3/5] vhost-scsi: realize the TYPE_FW_PATH_PROVIDER interface arei.gonglei
2015-01-29  7:08 ` [Qemu-devel] [PATCH v2 4/5] vhost-scsi: add a property for booting arei.gonglei
2015-01-29  7:08 ` [Qemu-devel] [PATCH v2 5/5] vhost-scsi: set the bootable value of channel/target/lun arei.gonglei
2015-02-03  8:55 ` [Qemu-devel] [PATCH v2 0/5] vhost-scsi: support to assign boot order Gonglei
2015-02-03 11:11   ` Paolo Bonzini
2015-02-03 11:27     ` Gonglei
2015-02-05  8:51       ` Gonglei
2015-02-05 11:10         ` Paolo Bonzini
2015-02-05 12:04           ` Michael S. Tsirkin
2015-02-05 12:31             ` Gonglei

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=1422515335-13316-3-git-send-email-arei.gonglei@huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=subo7@huawei.com \
    --cc=weidong.huang@huawei.com \
    /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 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.