From patchwork Mon Jun 20 14:05:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 9187619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3E0296075E for ; Mon, 20 Jun 2016 14:24:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28E981FE7B for ; Mon, 20 Jun 2016 14:24:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DC7327813; Mon, 20 Jun 2016 14:24:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5E0AE1FE7B for ; Mon, 20 Jun 2016 14:24:06 +0000 (UTC) Received: from localhost ([::1]:43938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF07R-0002Y3-1c for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Jun 2016 10:24:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzps-0007hc-4w for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:06:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEzpk-0006wJ-UN for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:05:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzpk-0006wB-Gu for qemu-devel@nongnu.org; Mon, 20 Jun 2016 10:05:48 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8592C05B1EA; Mon, 20 Jun 2016 14:05:47 +0000 (UTC) Received: from localhost (ovpn-112-59.ams2.redhat.com [10.36.112.59]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5KE5ko6016061; Mon, 20 Jun 2016 10:05:47 -0400 From: Stefan Hajnoczi To: Date: Mon, 20 Jun 2016 15:05:17 +0100 Message-Id: <1466431531-17806-7-git-send-email-stefanha@redhat.com> In-Reply-To: <1466431531-17806-1-git-send-email-stefanha@redhat.com> References: <1466431531-17806-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 20 Jun 2016 14:05:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/20] libqos: drop duplicated virtio_blk.h definitions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Stefan Hajnoczi Message-id: 1462798061-30382-7-git-send-email-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 8efe3d6..3920038 100644 --- a/tests/virtio-blk-test.c +++ b/tests/virtio-blk-test.c @@ -21,25 +21,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) @@ -186,14 +168,14 @@ static void test_basic(const QVirtioBus *bus, QVirtioDevice *dev, features = features & ~(QVIRTIO_F_BAD_FEATURE | (1u << VIRTIO_RING_F_INDIRECT_DESC) | (1u << VIRTIO_RING_F_EVENT_IDX) | - QVIRTIO_BLK_F_SCSI); + (1u << 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); @@ -216,7 +198,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); @@ -245,7 +227,7 @@ static void test_basic(const QVirtioBus *bus, QVirtioDevice *dev, if (features & (1u << 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); @@ -266,7 +248,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); @@ -354,7 +336,7 @@ static void pci_indirect(void) g_assert_cmphex(features & (1u << VIRTIO_RING_F_INDIRECT_DESC), !=, 0); features = features & ~(QVIRTIO_F_BAD_FEATURE | (1u << VIRTIO_RING_F_EVENT_IDX) | - QVIRTIO_BLK_F_SCSI); + (1u << VIRTIO_BLK_F_SCSI)); qvirtio_set_features(&qvirtio_pci, &dev->vdev, features); alloc = pc_alloc_init(); @@ -363,7 +345,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); @@ -388,7 +370,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); @@ -496,7 +478,7 @@ static void pci_msix(void) features = features & ~(QVIRTIO_F_BAD_FEATURE | (1u << VIRTIO_RING_F_INDIRECT_DESC) | (1u << VIRTIO_RING_F_EVENT_IDX) | - QVIRTIO_BLK_F_SCSI); + (1u << VIRTIO_BLK_F_SCSI)); qvirtio_set_features(&qvirtio_pci, &dev->vdev, features); vqpci = (QVirtQueuePCI *)qvirtqueue_setup(&qvirtio_pci, &dev->vdev, @@ -515,7 +497,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); @@ -539,7 +521,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); @@ -612,7 +594,7 @@ static void pci_idx(void) features = features & ~(QVIRTIO_F_BAD_FEATURE | (1u << VIRTIO_RING_F_INDIRECT_DESC) | (1u << VIRTIO_F_NOTIFY_ON_EMPTY) | - QVIRTIO_BLK_F_SCSI); + (1u << VIRTIO_BLK_F_SCSI)); qvirtio_set_features(&qvirtio_pci, &dev->vdev, features); vqpci = (QVirtQueuePCI *)qvirtqueue_setup(&qvirtio_pci, &dev->vdev, @@ -622,7 +604,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); @@ -641,7 +623,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); @@ -667,7 +649,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);