From patchwork Mon Mar 27 02:50:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashish Mittal X-Patchwork-Id: 9645257 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 DB6CF601E9 for ; Mon, 27 Mar 2017 02:52:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDDAD200E7 for ; Mon, 27 Mar 2017 02:52:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C011F203B9; Mon, 27 Mar 2017 02:52:10 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 11C0F200E7 for ; Mon, 27 Mar 2017 02:52:09 +0000 (UTC) Received: from localhost ([::1]:43884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csKlM-00033t-UY for patchwork-qemu-devel@patchwork.kernel.org; Sun, 26 Mar 2017 22:52:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csKkZ-00033b-B2 for qemu-devel@nongnu.org; Sun, 26 Mar 2017 22:51:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csKkX-0007Vm-8v for qemu-devel@nongnu.org; Sun, 26 Mar 2017 22:51:19 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:35522) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1csKkX-0007VX-2E for qemu-devel@nongnu.org; Sun, 26 Mar 2017 22:51:17 -0400 Received: by mail-pg0-x242.google.com with SMTP id g2so8863773pge.2 for ; Sun, 26 Mar 2017 19:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=97aYyVP0g9Kn5qbGPWK9kFzas6C6EMWQpYZQbrHg+tQ=; b=Cc8zzixWcoO1uxZRQ0vaS0Wb8y6XHXZYlILhBPQHogPC0gOt4He1o3VUwZSoKtgbPN DNspYLT50T4ljoIuxhCnNcZlg1SpePNsooWfa3JwkP7KstWSBT2HINCcsA7ZeoGyoM+q caz7K3+p84rGQNoi1vevxdoqJwik1KGWUcg7x1O7GbEOyuTqJ0Zkj1hUE7ShB6UnctCJ fkM6REp4Uv7NwkCvb+X4fcKzhPfNbK/jotiWUIjV0b6whe5NoFSDd00Im/WKRyDdnWcm 8lE44wR1c8JEBpNFrzqlLJmYGouBnW0j888VtPgzeWsD2V4/4igAYgg/r+B6PRa1O6UZ llGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=97aYyVP0g9Kn5qbGPWK9kFzas6C6EMWQpYZQbrHg+tQ=; b=R6mrGgGbDrBFA7qZeU8smIPp+sG6tMb38nkSF7m0xIY8enWNCKfpFVMEB0+wNNqb1i vevCBPn7/45Xp3WxOAkITU9kcNxh5DL3CuvufpsUwp3OKUMhX+qCXkdtvY6Sj/7K7OlA 8J2JxlPhTsnql0t2nENfFDVWOZywGRfhKO+bZvyxStCeMuTQrXicqTM78koRJg1XYxdM pSdHQyGt9dMOFrn5LXAX/1zeLLxzIFNwaSKpU2jvIOMIbgTMwWC9KHVXrBXQv2Rx3oe3 po5DGradmRD5aMksfATIjachlp+ZmHH7FhuwXYFwefer4p/3So/8F7fgKWy8ibx9wQtB IOhg== X-Gm-Message-State: AFeK/H1+J4FGQ5k1Y7FEynw+3VGgPKev+ZqVPb3U0udexqP+eGCFA2AlZZVKTYj2j3kHWg== X-Received: by 10.84.248.72 with SMTP id e8mr11724130pln.133.1490583076075; Sun, 26 Mar 2017 19:51:16 -0700 (PDT) Received: from localhost.localdomain.localdomain ([24.6.85.152]) by smtp.gmail.com with ESMTPSA id v86sm17184893pfa.86.2017.03.26.19.51.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Mar 2017 19:51:15 -0700 (PDT) From: Ashish Mittal X-Google-Original-From: Ashish Mittal To: qemu-devel@nongnu.org, pbonzini@redhat.com, kwolf@redhat.com, armbru@redhat.com, berrange@redhat.com, jcody@redhat.com, famz@redhat.com, ashish.mittal@veritas.com, stefanha@gmail.com, Ketan.Nilangekar@veritas.com, jferlan@redhat.com, Buddhi.Madhav@veritas.com, Suraj.Singh@veritas.com, Nitin.Jerath@veritas.com, peter.maydell@linaro.org, venkatesha.mg@veritas.com Date: Sun, 26 Mar 2017 19:50:36 -0700 Message-Id: <1490583036-3683-2-git-send-email-Ashish.Mittal@veritas.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1490583036-3683-1-git-send-email-Ashish.Mittal@veritas.com> References: <1490583036-3683-1-git-send-email-Ashish.Mittal@veritas.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PATCH v10 2/2] block/vxhs.c: Add qemu-iotests for new block device type "vxhs" 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: Ashish Mittal , Abhijit.Dey@veritas.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP These changes use a vxhs test server that is a part of the following repository: https://github.com/VeritasHyperScale/libqnio.git Signed-off-by: Ashish Mittal Reviewed-by: Stefan Hajnoczi --- v10 changelog: (1) Redirect o/p of "$QEMU_VXHS -d $TEST_DIR" to /dev/null v9 changelog: (1) Dropped second argument to set_prog_path(). We will pick up the test server location from the user's PATH env setting. v8/v7 changelog: (1) No changes. v6 changelog: (1) Added iotests for VxHS block device. tests/qemu-iotests/common | 6 ++++++ tests/qemu-iotests/common.config | 13 +++++++++++++ tests/qemu-iotests/common.filter | 1 + tests/qemu-iotests/common.rc | 19 +++++++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 4d5650d..9c6f972 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -157,6 +157,7 @@ check options -ssh test ssh -nfs test nfs -luks test luks + -vxhs test vxhs -xdiff graphical mode diff -nocache use O_DIRECT on backing file -misalign misalign memory allocations @@ -260,6 +261,11 @@ testlist options xpand=false ;; + -vxhs) + IMGPROTO=vxhs + xpand=false + ;; + -ssh) IMGPROTO=ssh xpand=false diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config index 55527aa..c4b51b3 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -105,6 +105,10 @@ if [ -z "$QEMU_NBD_PROG" ]; then export QEMU_NBD_PROG="`set_prog_path qemu-nbd`" fi +if [ -z "$QEMU_VXHS_PROG" ]; then + export QEMU_VXHS_PROG="`set_prog_path qnio_server`" +fi + _qemu_wrapper() { ( @@ -156,10 +160,19 @@ _qemu_nbd_wrapper() ) } +_qemu_vxhs_wrapper() +{ + ( + echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid" + exec "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@" + ) +} + export QEMU=_qemu_wrapper export QEMU_IMG=_qemu_img_wrapper export QEMU_IO=_qemu_io_wrapper export QEMU_NBD=_qemu_nbd_wrapper +export QEMU_VXHS=_qemu_vxhs_wrapper QEMU_IMG_EXTRA_ARGS= if [ "$IMGOPTSSYNTAX" = "true" ]; then diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter index 1040013..c9a2d5c 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -122,6 +122,7 @@ _filter_img_info() -e "s#$TEST_DIR#TEST_DIR#g" \ -e "s#$IMGFMT#IMGFMT#g" \ -e 's#nbd://127.0.0.1:10810$#TEST_DIR/t.IMGFMT#g' \ + -e 's#json.*vdisk-id.*vxhs"}}#TEST_DIR/t.IMGFMT#' \ -e "/encrypted: yes/d" \ -e "/cluster_size: [0-9]\\+/d" \ -e "/table_size: [0-9]\\+/d" \ diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 7d4781d..62529ee 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -85,6 +85,9 @@ else elif [ "$IMGPROTO" = "nfs" ]; then TEST_DIR="nfs://127.0.0.1/$TEST_DIR" TEST_IMG=$TEST_DIR/t.$IMGFMT + elif [ "$IMGPROTO" = "vxhs" ]; then + TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT + TEST_IMG="vxhs://127.0.0.1:9999/t.$IMGFMT" else TEST_IMG=$IMGPROTO:$TEST_DIR/t.$IMGFMT fi @@ -171,6 +174,12 @@ _make_test_img() eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT $TEST_IMG_FILE >/dev/null &" sleep 1 # FIXME: qemu-nbd needs to be listening before we continue fi + + # Start QNIO server on image directory for vxhs protocol + if [ $IMGPROTO = "vxhs" ]; then + eval "$QEMU_VXHS -d $TEST_DIR > /dev/null &" + sleep 1 # Wait for server to come up. + fi } _rm_test_img() @@ -197,6 +206,16 @@ _cleanup_test_img() fi rm -f "$TEST_IMG_FILE" ;; + vxhs) + if [ -f "${TEST_DIR}/qemu-vxhs.pid" ]; then + local QEMU_VXHS_PID + read QEMU_VXHS_PID < "${TEST_DIR}/qemu-vxhs.pid" + kill ${QEMU_VXHS_PID} >/dev/null 2>&1 + rm -f "${TEST_DIR}/qemu-vxhs.pid" + fi + rm -f "$TEST_IMG_FILE" + ;; + file) _rm_test_img "$TEST_DIR/t.$IMGFMT" _rm_test_img "$TEST_DIR/t.$IMGFMT.orig"