aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/tcm_vhost.h
diff options
context:
space:
mode:
authorAsias He <asias@redhat.com>2013-04-25 15:35:21 +0800
committerNicholas Bellinger <nab@linux-iscsi.org>2013-04-25 01:06:41 -0700
commita6c9af87363c5e964d981fe0ec4aa73061a0c793 (patch)
tree527c2f5179730e9763b6d1a7e969383e907205a0 /drivers/vhost/tcm_vhost.h
parenttcm_vhost: Refactor the lock nesting rule (diff)
downloadlinux-dev-a6c9af87363c5e964d981fe0ec4aa73061a0c793.tar.xz
linux-dev-a6c9af87363c5e964d981fe0ec4aa73061a0c793.zip
tcm_vhost: Add hotplug/hotunplug support
In commit 365a7150094 ([SCSI] virtio-scsi: hotplug support for virtio-scsi), hotplug support is added to virtio-scsi. This patch adds hotplug and hotunplug support to tcm_vhost. You can create or delete a LUN in targetcli to hotplug or hotunplug a LUN in guest. Signed-off-by: Asias He <asias@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to '')
-rw-r--r--drivers/vhost/tcm_vhost.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/vhost/tcm_vhost.h b/drivers/vhost/tcm_vhost.h
index 1d2ae7a60e11..a545a5b766a3 100644
--- a/drivers/vhost/tcm_vhost.h
+++ b/drivers/vhost/tcm_vhost.h
@@ -53,6 +53,7 @@ struct tcm_vhost_nacl {
struct se_node_acl se_node_acl;
};
+struct vhost_scsi;
struct tcm_vhost_tpg {
/* Vhost port target portal group tag for TCM */
u16 tport_tpgt;
@@ -70,6 +71,8 @@ struct tcm_vhost_tpg {
struct tcm_vhost_tport *tport;
/* Returned by tcm_vhost_make_tpg() */
struct se_portal_group se_tpg;
+ /* Pointer back to vhost_scsi, protected by tv_tpg_mutex */
+ struct vhost_scsi *vhost_scsi;
};
struct tcm_vhost_tport {
@@ -83,6 +86,13 @@ struct tcm_vhost_tport {
struct se_wwn tport_wwn;
};
+struct tcm_vhost_evt {
+ /* event to be sent to guest */
+ struct virtio_scsi_event event;
+ /* event list, serviced from vhost worker thread */
+ struct llist_node list;
+};
+
/*
* As per request from MST, keep TCM_VHOST related ioctl defines out of
* linux/vhost.h (user-space) for now..