From patchwork Tue Feb 23 11:26:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 8391001 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6E70B9F372 for ; Tue, 23 Feb 2016 11:30:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D88F20274 for ; Tue, 23 Feb 2016 11:30:04 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F0F0820304 for ; Tue, 23 Feb 2016 11:30:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYB7g-00022N-Vs; Tue, 23 Feb 2016 11:27:20 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYB7f-00021O-AN for xen-devel@lists.xen.org; Tue, 23 Feb 2016 11:27:19 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id A5/64-03814-6124CC65; Tue, 23 Feb 2016 11:27:18 +0000 X-Env-Sender: olaf@aepfle.de X-Msg-Ref: server-5.tower-31.messagelabs.com!1456226837!24395500!1 X-Originating-IP: [81.169.146.160] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: QmFkIElQOiA4MS4xNjkuMTQ2LjE2MCA9PiA1NTc3MTg=\n,sa_preprocessor: QmFkIElQOiA4MS4xNjkuMTQ2LjE2MCA9PiA1NTc3MTg=\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 57858 invoked from network); 23 Feb 2016 11:27:17 -0000 Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.160) by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 23 Feb 2016 11:27:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1456226837; l=3524; s=domk; d=aepfle.de; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Date: Subject:Cc:To:From; bh=9mYgy7pgrwdIF/sjsiXtajjJ63IdixkP/QXpFC6YNKk=; b=nfuBFDBgtYYcEpjQz33vWQx2ifpSPvnjaF7r+JElDE6+zKh3F7SVO00I5opg/NuDO95 1Fau2xZcxCDl5KbHnnHvgjWG1IjSqvPuaPH7BIieJU/ZoITVvGD2CMdKtmyr10QlMz+0W E901fwpftG2HPIcht+jkzvIbOgqTNff7YVY= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWi/zfN1cLnDYUgqTAeBk4W9EFtcJhQlEigjKrHZjO+/XyMB8ZtmWA== X-RZG-CLASS-ID: mo00 Received: from probook ([2001:a62:113c:45ff:2082:fb69:3bad:17fe]) by smtp.strato.de (RZmta 37.19 AUTH) with ESMTPSA id u07af6s1NBRAAQj (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Tue, 23 Feb 2016 12:27:10 +0100 (CET) Received: by probook (Postfix, from userid 1000) id 11C0050601; Tue, 23 Feb 2016 12:27:08 +0100 (CET) From: Olaf Hering To: xen-devel@lists.xen.org Date: Tue, 23 Feb 2016 11:26:59 +0000 Message-Id: <1456226821-24545-5-git-send-email-olaf@aepfle.de> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1456226821-24545-1-git-send-email-olaf@aepfle.de> References: <1456226821-24545-1-git-send-email-olaf@aepfle.de> MIME-Version: 1.0 Cc: Olaf Hering , Keir Fraser , Ian Campbell , Tim Deegan , Ian Jackson , Jan Beulich Subject: [Xen-devel] [PATCH v9 4/6] vscsiif.h: add some notes about xenstore layout X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Olaf Hering Acked-by: Ian Campbell Acked-by: Wei Liu Cc: Ian Campbell Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan --- xen/include/public/io/vscsiif.h | 69 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/xen/include/public/io/vscsiif.h b/xen/include/public/io/vscsiif.h index e8e38a9..0a4709f 100644 --- a/xen/include/public/io/vscsiif.h +++ b/xen/include/public/io/vscsiif.h @@ -104,6 +104,75 @@ * response structures. */ +/* + * Xenstore format in practice + * =========================== + * + * The backend driver uses a single_host:many_devices notation to manage domU + * devices. Everything is stored in /local/domain//backend/vscsi/. + * The xenstore layout looks like this (dom0 is assumed to be the backend_domid): + * + * //feature-host = "0" + * //frontend = "/local/domain//device/vscsi/0" + * //frontend-id = "" + * //online = "1" + * //state = "4" + * //vscsi-devs/dev-0/p-dev = "8:0:2:1" or "naa.wwn:lun" + * //vscsi-devs/dev-0/state = "4" + * //vscsi-devs/dev-0/v-dev = "0:0:0:0" + * //vscsi-devs/dev-1/p-dev = "8:0:2:2" + * //vscsi-devs/dev-1/state = "4" + * //vscsi-devs/dev-1/v-dev = "0:0:1:0" + * + * The frontend driver maintains its state in + * /local/domain//device/vscsi/. + * + * /backend = "/local/domain/0/backend/vscsi//" + * /backend-id = "0" + * /event-channel = "20" + * /ring-ref = "43" + * /state = "4" + * /vscsi-devs/dev-0/state = "4" + * /vscsi-devs/dev-1/state = "4" + * + * In addition to the entries for backend and frontend these flags are stored + * for the toolstack: + * + * //vscsi-devs/dev-1/p-devname = "/dev/$device" + * //libxl_ctrl_index = "0" + * + * + * Backend/frontend protocol + * ========================= + * + * To create a vhost along with a device: + * //feature-host = "0" + * //frontend = "/local/domain//device/vscsi/0" + * //frontend-id = "" + * //online = "1" + * //state = "1" + * //vscsi-devs/dev-0/p-dev = "8:0:2:1" + * //vscsi-devs/dev-0/state = "1" + * //vscsi-devs/dev-0/v-dev = "0:0:0:0" + * Wait for //state + //vscsi-devs/dev-0/state become 4 + * + * To add another device to a vhost: + * //state = "7" + * //vscsi-devs/dev-1/p-dev = "8:0:2:2" + * //vscsi-devs/dev-1/state = "1" + * //vscsi-devs/dev-1/v-dev = "0:0:1:0" + * Wait for //state + //vscsi-devs/dev-1/state become 4 + * + * To remove a device from a vhost: + * //state = "7" + * //vscsi-devs/dev-1/state = "5" + * Wait for //state to become 4 + * Wait for //vscsi-devs/dev-1/state become 6 + * Remove //vscsi-devs/dev-1/{state,p-dev,v-dev,p-devname} + * Remove //vscsi-devs/dev-1/ + * + */ + /* Requests from the frontend to the backend */ /*