From patchwork Mon Feb 18 22:22:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Larrew X-Patchwork-Id: 221560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 51DCD2C0291 for ; Tue, 19 Feb 2013 10:46:47 +1100 (EST) Received: from localhost ([::1]:50667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7aQ1-0004I8-IZ for incoming@patchwork.ozlabs.org; Mon, 18 Feb 2013 18:46:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7ZSa-0007zn-3W for qemu-devel@nongnu.org; Mon, 18 Feb 2013 17:45:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7ZST-0003r2-2i for qemu-devel@nongnu.org; Mon, 18 Feb 2013 17:45:17 -0500 Received: from [32.97.110.55] (port=60150 helo=jlarrew.austin.ibm.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7ZSS-0003mY-IP for qemu-devel@nongnu.org; Mon, 18 Feb 2013 17:45:12 -0500 Received: from jlarrew.austin.ibm.com (localhost [127.0.0.1]) by jlarrew.austin.ibm.com (8.14.5/8.14.5) with ESMTP id r1IMN0Iq019153; Mon, 18 Feb 2013 16:23:00 -0600 Received: (from jlarrew@localhost) by jlarrew.austin.ibm.com (8.14.5/8.14.5/Submit) id r1IMN0Ip019152; Mon, 18 Feb 2013 16:23:00 -0600 From: Jesse Larrew To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2013 16:22:45 -0600 Message-Id: <1361226165-19030-9-git-send-email-jlarrew@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1361226165-19030-1-git-send-email-jlarrew@linux.vnet.ibm.com> References: <1361226165-19030-1-git-send-email-jlarrew@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 32.97.110.55 Cc: aliguori@us.ibm.com, Jesse Larrew Subject: [Qemu-devel] [PATCH 8/8] virtio-blk: fill in the feature table X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Fill in the feature table with the last field of struct virtio_blk_config at the time that the feature flag was introduced. The table was constructed by searching through the git history. Signed-off-by: Jesse Larrew --- hw/virtio-blk.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 788a4c7..47c57d8 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -26,8 +26,26 @@ #endif static VirtIOFeature feature_sizes[] = { - {.flags = 0xffffffff, /* dummy table -- all features included */ - .end = sizeof(struct virtio_blk_config)}, + {.flags = 1 << VIRTIO_BLK_F_BARRIER, + .end = endof(struct virtio_blk_config, sectors)}, + {.flags = 1 << VIRTIO_BLK_F_SIZE_MAX, + .end = endof(struct virtio_blk_config, sectors)}, + {.flags = 1 << VIRTIO_BLK_F_SEG_MAX, + .end = endof(struct virtio_blk_config, sectors)}, + {.flags = 1 << VIRTIO_BLK_F_GEOMETRY, + .end = endof(struct virtio_blk_config, sectors)}, + {.flags = 1 << VIRTIO_BLK_F_RO, + .end = endof(struct virtio_blk_config, sectors)}, + {.flags = 1 << VIRTIO_BLK_F_BLK_SIZE, + .end = endof(struct virtio_blk_config, sectors)}, + {.flags = 1 << VIRTIO_BLK_F_SCSI, + .end = endof(struct virtio_blk_config, sectors)}, + {.flags = 1 << VIRTIO_BLK_F_WCE, + .end = endof(struct virtio_blk_config, blk_size)}, + {.flags = 1 << VIRTIO_BLK_F_TOPOLOGY, + .end = endof(struct virtio_blk_config, opt_io_size)}, + {.flags = 1 << VIRTIO_BLK_F_CONFIG_WCE, + .end = endof(struct virtio_blk_config, wce)}, {} };