qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vhost-scsi: include linux/vhost.h
@ 2015-09-18 14:18 marcandre.lureau
  2015-09-18 14:42 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: marcandre.lureau @ 2015-09-18 14:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Replace ad-hoc declarations with the linux header.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/scsi/vhost-scsi.c           |  1 +
 include/hw/virtio/vhost-scsi.h | 25 -------------------------
 2 files changed, 1 insertion(+), 25 deletions(-)

diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index bac9ddb..fb7983d 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -26,6 +26,7 @@
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 #include "hw/fw-path-provider.h"
+#include "linux/vhost.h"
 
 /* Features supported by host kernel. */
 static const int kernel_feature_bits[] = {
diff --git a/include/hw/virtio/vhost-scsi.h b/include/hw/virtio/vhost-scsi.h
index 701bfee..9fd63df 100644
--- a/include/hw/virtio/vhost-scsi.h
+++ b/include/hw/virtio/vhost-scsi.h
@@ -19,37 +19,12 @@
 #include "hw/virtio/virtio-scsi.h"
 #include "hw/virtio/vhost.h"
 
-/*
- * Used by QEMU userspace to ensure a consistent vhost-scsi ABI.
- *
- * ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate +
- *            RFC-v2 vhost-scsi userspace.  Add GET_ABI_VERSION ioctl usage
- * ABI Rev 1: January 2013. Ignore vhost_tpgt filed in struct vhost_scsi_target.
- * 	      All the targets under vhost_wwpn can be seen and used by guest.
- */
-
-#define VHOST_SCSI_ABI_VERSION 1
-
-/* TODO #include <linux/vhost.h> properly */
-/* For VHOST_SCSI_SET_ENDPOINT/VHOST_SCSI_CLEAR_ENDPOINT ioctl */
-struct vhost_scsi_target {
-    int abi_version;
-    char vhost_wwpn[224];
-    unsigned short vhost_tpgt;
-    unsigned short reserved;
-};
-
 enum vhost_scsi_vq_list {
     VHOST_SCSI_VQ_CONTROL = 0,
     VHOST_SCSI_VQ_EVENT = 1,
     VHOST_SCSI_VQ_NUM_FIXED = 2,
 };
 
-#define VHOST_VIRTIO 0xAF
-#define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)
-#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)
-#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int)
-
 #define TYPE_VHOST_SCSI "vhost-scsi"
 #define VHOST_SCSI(obj) \
         OBJECT_CHECK(VHostSCSI, (obj), TYPE_VHOST_SCSI)
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] vhost-scsi: include linux/vhost.h
  2015-09-18 14:18 [Qemu-devel] [PATCH] vhost-scsi: include linux/vhost.h marcandre.lureau
@ 2015-09-18 14:42 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2015-09-18 14:42 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel



On 18/09/2015 16:18, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Replace ad-hoc declarations with the linux header.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  hw/scsi/vhost-scsi.c           |  1 +
>  include/hw/virtio/vhost-scsi.h | 25 -------------------------
>  2 files changed, 1 insertion(+), 25 deletions(-)
> 
> diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
> index bac9ddb..fb7983d 100644
> --- a/hw/scsi/vhost-scsi.c
> +++ b/hw/scsi/vhost-scsi.c
> @@ -26,6 +26,7 @@
>  #include "hw/virtio/virtio-bus.h"
>  #include "hw/virtio/virtio-access.h"
>  #include "hw/fw-path-provider.h"
> +#include "linux/vhost.h"
>  
>  /* Features supported by host kernel. */
>  static const int kernel_feature_bits[] = {
> diff --git a/include/hw/virtio/vhost-scsi.h b/include/hw/virtio/vhost-scsi.h
> index 701bfee..9fd63df 100644
> --- a/include/hw/virtio/vhost-scsi.h
> +++ b/include/hw/virtio/vhost-scsi.h
> @@ -19,37 +19,12 @@
>  #include "hw/virtio/virtio-scsi.h"
>  #include "hw/virtio/vhost.h"
>  
> -/*
> - * Used by QEMU userspace to ensure a consistent vhost-scsi ABI.
> - *
> - * ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate +
> - *            RFC-v2 vhost-scsi userspace.  Add GET_ABI_VERSION ioctl usage
> - * ABI Rev 1: January 2013. Ignore vhost_tpgt filed in struct vhost_scsi_target.
> - * 	      All the targets under vhost_wwpn can be seen and used by guest.
> - */
> -
> -#define VHOST_SCSI_ABI_VERSION 1
> -
> -/* TODO #include <linux/vhost.h> properly */
> -/* For VHOST_SCSI_SET_ENDPOINT/VHOST_SCSI_CLEAR_ENDPOINT ioctl */
> -struct vhost_scsi_target {
> -    int abi_version;
> -    char vhost_wwpn[224];
> -    unsigned short vhost_tpgt;
> -    unsigned short reserved;
> -};
> -
>  enum vhost_scsi_vq_list {
>      VHOST_SCSI_VQ_CONTROL = 0,
>      VHOST_SCSI_VQ_EVENT = 1,
>      VHOST_SCSI_VQ_NUM_FIXED = 2,
>  };
>  
> -#define VHOST_VIRTIO 0xAF
> -#define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)
> -#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target)
> -#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int)
> -
>  #define TYPE_VHOST_SCSI "vhost-scsi"
>  #define VHOST_SCSI(obj) \
>          OBJECT_CHECK(VHostSCSI, (obj), TYPE_VHOST_SCSI)
> 

Thanks, looks good.

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-18 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-18 14:18 [Qemu-devel] [PATCH] vhost-scsi: include linux/vhost.h marcandre.lureau
2015-09-18 14:42 ` Paolo Bonzini

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).