qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: marc.mari.barcelo@gmail.com, Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH for-2.7 6/8] libqos: drop duplicated virtio_blk.h definitions
Date: Mon, 25 Apr 2016 13:46:11 +0100	[thread overview]
Message-ID: <1461588373-26486-7-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1461588373-26486-1-git-send-email-stefanha@redhat.com>

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/virtio-blk-test.c | 50 ++++++++++++++++---------------------------------
 1 file changed, 16 insertions(+), 34 deletions(-)

diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 57a2635..8e28a33 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -22,25 +22,7 @@
 #include "standard-headers/linux/virtio_ids.h"
 #include "standard-headers/linux/virtio_config.h"
 #include "standard-headers/linux/virtio_ring.h"
-
-#define QVIRTIO_BLK_F_BARRIER       0x00000001
-#define QVIRTIO_BLK_F_SIZE_MAX      0x00000002
-#define QVIRTIO_BLK_F_SEG_MAX       0x00000004
-#define QVIRTIO_BLK_F_GEOMETRY      0x00000010
-#define QVIRTIO_BLK_F_RO            0x00000020
-#define QVIRTIO_BLK_F_BLK_SIZE      0x00000040
-#define QVIRTIO_BLK_F_SCSI          0x00000080
-#define QVIRTIO_BLK_F_WCE           0x00000200
-#define QVIRTIO_BLK_F_TOPOLOGY      0x00000400
-#define QVIRTIO_BLK_F_CONFIG_WCE    0x00000800
-
-#define QVIRTIO_BLK_T_IN            0
-#define QVIRTIO_BLK_T_OUT           1
-#define QVIRTIO_BLK_T_SCSI_CMD      2
-#define QVIRTIO_BLK_T_SCSI_CMD_OUT  3
-#define QVIRTIO_BLK_T_FLUSH         4
-#define QVIRTIO_BLK_T_FLUSH_OUT     5
-#define QVIRTIO_BLK_T_GET_ID        8
+#include "standard-headers/linux/virtio_blk.h"
 
 #define TEST_IMAGE_SIZE         (64 * 1024 * 1024)
 #define QVIRTIO_BLK_TIMEOUT_US  (30 * 1000 * 1000)
@@ -187,14 +169,14 @@ static void test_basic(const QVirtioBus *bus, QVirtioDevice *dev,
     features = features & ~(QVIRTIO_F_BAD_FEATURE |
                     (1 << VIRTIO_RING_F_INDIRECT_DESC) |
                     (1 << VIRTIO_RING_F_EVENT_IDX) |
-                            QVIRTIO_BLK_F_SCSI);
+                    (1 << VIRTIO_BLK_F_SCSI));
     qvirtio_set_features(bus, dev, features);
 
     qvirtio_set_driver_ok(bus, dev);
 
     /* Write and read with 3 descriptor layout */
     /* Write request */
-    req.type = QVIRTIO_BLK_T_OUT;
+    req.type = VIRTIO_BLK_T_OUT;
     req.ioprio = 1;
     req.sector = 0;
     req.data = g_malloc0(512);
@@ -217,7 +199,7 @@ static void test_basic(const QVirtioBus *bus, QVirtioDevice *dev,
     guest_free(alloc, req_addr);
 
     /* Read request */
-    req.type = QVIRTIO_BLK_T_IN;
+    req.type = VIRTIO_BLK_T_IN;
     req.ioprio = 1;
     req.sector = 0;
     req.data = g_malloc0(512);
@@ -246,7 +228,7 @@ static void test_basic(const QVirtioBus *bus, QVirtioDevice *dev,
     if (features & VIRTIO_F_ANY_LAYOUT) {
         /* Write and read with 2 descriptor layout */
         /* Write request */
-        req.type = QVIRTIO_BLK_T_OUT;
+        req.type = VIRTIO_BLK_T_OUT;
         req.ioprio = 1;
         req.sector = 1;
         req.data = g_malloc0(512);
@@ -267,7 +249,7 @@ static void test_basic(const QVirtioBus *bus, QVirtioDevice *dev,
         guest_free(alloc, req_addr);
 
         /* Read request */
-        req.type = QVIRTIO_BLK_T_IN;
+        req.type = VIRTIO_BLK_T_IN;
         req.ioprio = 1;
         req.sector = 1;
         req.data = g_malloc0(512);
@@ -355,7 +337,7 @@ static void pci_indirect(void)
     g_assert_cmphex(features & (1 << VIRTIO_RING_F_INDIRECT_DESC), !=, 0);
     features = features & ~(QVIRTIO_F_BAD_FEATURE |
                             (1 << VIRTIO_RING_F_EVENT_IDX) |
-                            QVIRTIO_BLK_F_SCSI);
+                            (1 << VIRTIO_BLK_F_SCSI));
     qvirtio_set_features(&qvirtio_pci, &dev->vdev, features);
 
     alloc = pc_alloc_init();
@@ -364,7 +346,7 @@ static void pci_indirect(void)
     qvirtio_set_driver_ok(&qvirtio_pci, &dev->vdev);
 
     /* Write request */
-    req.type = QVIRTIO_BLK_T_OUT;
+    req.type = VIRTIO_BLK_T_OUT;
     req.ioprio = 1;
     req.sector = 0;
     req.data = g_malloc0(512);
@@ -389,7 +371,7 @@ static void pci_indirect(void)
     guest_free(alloc, req_addr);
 
     /* Read request */
-    req.type = QVIRTIO_BLK_T_IN;
+    req.type = VIRTIO_BLK_T_IN;
     req.ioprio = 1;
     req.sector = 0;
     req.data = g_malloc0(512);
@@ -497,7 +479,7 @@ static void pci_msix(void)
     features = features & ~(QVIRTIO_F_BAD_FEATURE |
                             (1 << VIRTIO_RING_F_INDIRECT_DESC) |
                             (1 << VIRTIO_RING_F_EVENT_IDX) |
-                            QVIRTIO_BLK_F_SCSI);
+                            (1 << VIRTIO_BLK_F_SCSI));
     qvirtio_set_features(&qvirtio_pci, &dev->vdev, features);
 
     vqpci = (QVirtQueuePCI *)qvirtqueue_setup(&qvirtio_pci, &dev->vdev,
@@ -516,7 +498,7 @@ static void pci_msix(void)
     g_assert_cmpint(capacity, ==, n_size / 512);
 
     /* Write request */
-    req.type = QVIRTIO_BLK_T_OUT;
+    req.type = VIRTIO_BLK_T_OUT;
     req.ioprio = 1;
     req.sector = 0;
     req.data = g_malloc0(512);
@@ -540,7 +522,7 @@ static void pci_msix(void)
     guest_free(alloc, req_addr);
 
     /* Read request */
-    req.type = QVIRTIO_BLK_T_IN;
+    req.type = VIRTIO_BLK_T_IN;
     req.ioprio = 1;
     req.sector = 0;
     req.data = g_malloc0(512);
@@ -613,7 +595,7 @@ static void pci_idx(void)
     features = features & ~(QVIRTIO_F_BAD_FEATURE |
                             (1 << VIRTIO_RING_F_INDIRECT_DESC) |
                             (1 << VIRTIO_F_NOTIFY_ON_EMPTY) |
-                            QVIRTIO_BLK_F_SCSI);
+                            (1 << VIRTIO_BLK_F_SCSI));
     qvirtio_set_features(&qvirtio_pci, &dev->vdev, features);
 
     vqpci = (QVirtQueuePCI *)qvirtqueue_setup(&qvirtio_pci, &dev->vdev,
@@ -623,7 +605,7 @@ static void pci_idx(void)
     qvirtio_set_driver_ok(&qvirtio_pci, &dev->vdev);
 
     /* Write request */
-    req.type = QVIRTIO_BLK_T_OUT;
+    req.type = VIRTIO_BLK_T_OUT;
     req.ioprio = 1;
     req.sector = 0;
     req.data = g_malloc0(512);
@@ -642,7 +624,7 @@ static void pci_idx(void)
                            QVIRTIO_BLK_TIMEOUT_US);
 
     /* Write request */
-    req.type = QVIRTIO_BLK_T_OUT;
+    req.type = VIRTIO_BLK_T_OUT;
     req.ioprio = 1;
     req.sector = 1;
     req.data = g_malloc0(512);
@@ -668,7 +650,7 @@ static void pci_idx(void)
     guest_free(alloc, req_addr);
 
     /* Read request */
-    req.type = QVIRTIO_BLK_T_IN;
+    req.type = VIRTIO_BLK_T_IN;
     req.ioprio = 1;
     req.sector = 1;
     req.data = g_malloc0(512);
-- 
2.5.5

  parent reply	other threads:[~2016-04-25 12:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 12:46 [Qemu-devel] [PATCH for-2.7 0/8] libqos: use standard virtio headers Stefan Hajnoczi
2016-04-25 12:46 ` [Qemu-devel] [PATCH for-2.7 1/8] libqos: use virtio_ids.h for device ID definitions Stefan Hajnoczi
2016-04-25 12:46 ` [Qemu-devel] [PATCH for-2.7 2/8] libqos: drop duplicated PCI vendor ID definition Stefan Hajnoczi
2016-04-25 12:46 ` [Qemu-devel] [PATCH for-2.7 3/8] libqos: drop duplicated virtio_config.h definitions Stefan Hajnoczi
2016-05-08 18:22   ` Marc Marí
2016-05-08 18:40     ` Marc Marí
2016-05-09 11:46       ` Stefan Hajnoczi
2016-04-25 12:46 ` [Qemu-devel] [PATCH for-2.7 4/8] libqos: drop duplicated virtio_ring.h bit definitions Stefan Hajnoczi
2016-04-25 12:46 ` [Qemu-devel] [PATCH for-2.7 5/8] libqos: drop duplicated virtio_vring.h structs Stefan Hajnoczi
2016-04-25 12:46 ` Stefan Hajnoczi [this message]
2016-04-25 12:46 ` [Qemu-devel] [PATCH for-2.7 7/8] libqos: drop duplicated virtio_scsi.h definitions Stefan Hajnoczi
2016-04-25 12:46 ` [Qemu-devel] [PATCH for-2.7 8/8] libqos: drop duplicated virtio_pci.h definitions Stefan Hajnoczi
2016-04-25 19:09 ` [Qemu-devel] [PATCH for-2.7 0/8] libqos: use standard virtio headers John Snow
2016-04-26  9:58   ` Stefan Hajnoczi

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=1461588373-26486-7-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=marc.mari.barcelo@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 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).