From patchwork Fri Feb 5 10:12:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 8233211 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 546859F37A for ; Fri, 5 Feb 2016 10:15:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 664592039E for ; Fri, 5 Feb 2016 10:15:37 +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 679102026D for ; Fri, 5 Feb 2016 10:15:35 +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 1aRdO4-0004dZ-TF; Fri, 05 Feb 2016 10:13:12 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aRdO4-0004cv-09 for xen-devel@lists.xen.org; Fri, 05 Feb 2016 10:13:12 +0000 Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id 75/16-09708-7B574B65; Fri, 05 Feb 2016 10:13:11 +0000 X-Env-Sender: olaf@aepfle.de X-Msg-Ref: server-5.tower-21.messagelabs.com!1454667187!14180679!1 X-Originating-IP: [81.169.146.221] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 47499 invoked from network); 5 Feb 2016 10:13:10 -0000 Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.221) by server-5.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 5 Feb 2016 10:13:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1454667187; l=3439; s=domk; d=aepfle.de; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Date: Subject:Cc:To:From; bh=Jy7MeftpTCOokFX3UJHp3xJy+hmOq/0f05y2O8G/3CA=; b=Zyg3LjBNMiut8oR5nNA7SiMSYkvqDAi34k0/oteSA3hS4Nmr9eJAy5aFhjsC46Q+ucO /N9IPNLICd/T+CsMbFExb5spZYGA8VJBBBpPSf7oxMo8K8zhRJva9Uba5NIYFPBmxiv8L /9VnM/q1XPB7A0XN4suQvnZhCMf5i2AMPV8= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWi/zfN1cLnDYUgqRlyBxIG94Z+l4sPG5TVHaI4yEcpOb/EH5xRkdg== X-RZG-CLASS-ID: mo00 Received: from probook ([2001:a62:1198:c1ff:b962:113d:f241:eaf9]) by smtp.strato.de (RZmta 37.17 AUTH) with ESMTPSA id 307b53s15AD3VI5 (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); Fri, 5 Feb 2016 11:13:03 +0100 (CET) Received: by probook (Postfix, from userid 1000) id A0A3F508D7; Fri, 5 Feb 2016 11:13:02 +0100 (CET) From: Olaf Hering To: xen-devel@lists.xen.org Date: Fri, 5 Feb 2016 10:12:54 +0000 Message-Id: <1454667175-24282-5-git-send-email-olaf@aepfle.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454667175-24282-1-git-send-email-olaf@aepfle.de> References: <1454667175-24282-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 v7 4/5] 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 Cc: Ian Campbell Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan --- xen/include/public/io/vscsiif.h | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/xen/include/public/io/vscsiif.h b/xen/include/public/io/vscsiif.h index e8e38a9..2c5f04a 100644 --- a/xen/include/public/io/vscsiif.h +++ b/xen/include/public/io/vscsiif.h @@ -104,6 +104,74 @@ * 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" + * + * + * 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 */ /*