From patchwork Wed Jan 16 05:19:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Changpeng" X-Patchwork-Id: 1025634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43fZpg2ByCz9sD9 for ; Wed, 16 Jan 2019 16:03:06 +1100 (AEDT) Received: from localhost ([127.0.0.1]:48154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjdLz-0006yT-Vv for incoming@patchwork.ozlabs.org; Wed, 16 Jan 2019 00:03:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjdLQ-0006xK-JF for qemu-devel@nongnu.org; Wed, 16 Jan 2019 00:02:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjdLM-0005Ca-O4 for qemu-devel@nongnu.org; Wed, 16 Jan 2019 00:02:27 -0500 Received: from mga05.intel.com ([192.55.52.43]:4444) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjdLI-00058k-VM for qemu-devel@nongnu.org; Wed, 16 Jan 2019 00:02:22 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2019 21:02:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,484,1539673200"; d="scan'208";a="108597068" Received: from fedora.sh.intel.com ([10.67.114.176]) by orsmga006.jf.intel.com with ESMTP; 15 Jan 2019 21:02:16 -0800 From: Changpeng Liu To: qemu-devel@nongnu.org Date: Wed, 16 Jan 2019 13:19:29 +0800 Message-Id: <1547615970-23545-2-git-send-email-changpeng.liu@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1547615970-23545-1-git-send-email-changpeng.liu@intel.com> References: <1547615970-23545-1-git-send-email-changpeng.liu@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.43 Subject: [Qemu-devel] [PATCH v2 2/3] contrib/vhost-user-blk: fix the compilation issue 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: changpeng.liu@intel.com, sgazare@redhat.com, stefanha@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Changpeng Liu Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella --- contrib/vhost-user-blk/vhost-user-blk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c index 858221a..49640df 100644 --- a/contrib/vhost-user-blk/vhost-user-blk.c +++ b/contrib/vhost-user-blk/vhost-user-blk.c @@ -20,6 +20,10 @@ #include "contrib/libvhost-user/libvhost-user-glib.h" #include "contrib/libvhost-user/libvhost-user.h" +#if defined(__linux__) +#include +#include +#endif struct virtio_blk_inhdr { unsigned char status; @@ -454,7 +458,7 @@ vub_get_blocksize(int fd) #if defined(__linux__) && defined(BLKSSZGET) if (ioctl(fd, BLKSSZGET, &blocksize) == 0) { - return blocklen; + return blocksize; } #endif