From owner-freebsd-xen@FreeBSD.ORG Mon Apr 27 07:56:21 2015 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6DD0C1E for ; Mon, 27 Apr 2015 07:56:21 +0000 (UTC) Received: from violet.upc.es (violet.upc.es [147.83.2.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay.upc.es", Issuer "TERENA SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 514581E93 for ; Mon, 27 Apr 2015 07:56:20 +0000 (UTC) Received: from ackerman2.upc.es (ackerman2.upc.es [147.83.2.244]) by violet.upc.es (8.14.1/8.13.1) with ESMTP id t3R7u7xu007112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=FAIL); Mon, 27 Apr 2015 09:56:07 +0200 Received: from [10.0.2.151] ([147.83.40.10]) (authenticated bits=0) by ackerman2.upc.es (8.14.4/8.14.4) with ESMTP id t3R7u79Z018706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 27 Apr 2015 09:56:07 +0200 Message-ID: <553DEB97.5000300@entel.upc.edu> Date: Mon, 27 Apr 2015 09:56:07 +0200 From: =?UTF-8?B?R3VzdGF1IFDDqXJleg==?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= , FreeBSD XEN Subject: Porting the block-iscsi hotplug script Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Delayed for 62:41:49 by milter-greylist-4.4.3 (violet.upc.es [147.83.2.51]); Mon, 27 Apr 2015 09:56:08 +0200 (CEST) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.4.3 (ackerman2.upc.es [147.83.2.244]); Mon, 27 Apr 2015 09:56:07 +0200 (CEST) X-Scanned-By: MIMEDefang 2.70 on 147.83.2.244 X-Mail-Scanned: Criba 2.0 + Clamd X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2015 07:56:22 -0000 Hello, I'm trying to port the linux block-iscsi hotplug script and I discovered there is a chain of sourcing that ends up to including 5 or 6 scripts in the tools/hotplug/Linux directory. Can I strip those and rewrite them to include only the necessary code in the Freebsd hotplug directory? I presume there's no assumption about the scripts' names other than the hotplug script itself, but I'd like to first ask. Thanks, Gustau From owner-freebsd-xen@FreeBSD.ORG Wed Apr 29 09:12:14 2015 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D49E24AE for ; Wed, 29 Apr 2015 09:12:14 +0000 (UTC) Received: from violet.upc.es (violet.upc.es [147.83.2.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay.upc.es", Issuer "TERENA SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51B40128E for ; Wed, 29 Apr 2015 09:12:13 +0000 (UTC) Received: from ackerman2.upc.es (ackerman2.upc.es [147.83.2.244]) by violet.upc.es (8.14.1/8.13.1) with ESMTP id t3T9BlQu031316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=FAIL); Wed, 29 Apr 2015 11:11:47 +0200 Received: from [10.0.2.151] ([147.83.40.10]) (authenticated bits=0) by ackerman2.upc.es (8.14.4/8.14.4) with ESMTP id t3T9BlTo025190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 29 Apr 2015 11:11:47 +0200 Message-ID: <5540A053.4080409@entel.upc.edu> Date: Wed, 29 Apr 2015 11:11:47 +0200 From: =?windows-1252?Q?Gustau_P=E9rez?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?windows-1252?Q?Roger_Pau_Monn=E9?= , FreeBSD XEN Subject: Re: Porting the block-iscsi hotplug script References: <553DEB97.5000300@entel.upc.edu> In-Reply-To: <553DEB97.5000300@entel.upc.edu> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.4.3 (violet.upc.es [147.83.2.51]); Wed, 29 Apr 2015 11:11:48 +0200 (CEST) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.4.3 (ackerman2.upc.es [147.83.2.244]); Wed, 29 Apr 2015 11:11:47 +0200 (CEST) X-Scanned-By: MIMEDefang 2.70 on 147.83.2.244 X-Mail-Scanned: Criba 2.0 + Clamd X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 09:12:14 -0000 El 27/04/2015 a les 09:56, Gustau Pérez ha escrit: > > Hello, > > I'm trying to port the linux block-iscsi hotplug script and I > discovered there is a chain of sourcing that ends up to including 5 or 6 > scripts in the tools/hotplug/Linux directory. Can I strip those and > rewrite them to include only the necessary code in the Freebsd hotplug > directory? I presume there's no assumption about the scripts' names > other than the hotplug script itself, but I'd like to first ask. This morning I got some time to work the block-iscsi script. With some tweaking I was able to call directly the script with something like: scripts/block-iscsi add iqn=bla,portal=bla,username=bla,password=bla and I was also able to simulate the remove. To do so I had to comment out some variables (XENBUS_PATH for example). Now I'm trying to test it at domain creation time, and to do so I had to uncomment XENBUS_PATH and the other changes. Creating the domain with the disk using the iscsi syntax [1] fails. In the xen log file I get an error complaining about XENBUS_PATH not being set [2]. I was hoping that XENBUS_PATH would be set by the xl toolstack. Am I doing anything wrong? Best, Gustau [1] disk = ['script=block-iscsi,vdev=xvda,target=iqn=iqn.2015.local.labs-entel.test_xen:target1,portal=10.0.2.20,username=bla,password=bla'] [2] XENBUS_PATH: parameter null or not set > Thanks, > > Gustau > _______________________________________________ > freebsd-xen@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-xen > To unsubscribe, send any mail to "freebsd-xen-unsubscribe@freebsd.org" From owner-freebsd-xen@FreeBSD.ORG Wed Apr 29 15:14:17 2015 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E415DAA6 for ; Wed, 29 Apr 2015 15:14:17 +0000 (UTC) Received: from SMTP02.CITRIX.COM (smtp02.citrix.com [66.165.176.63]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "mail.citrix.com", Issuer "Cybertrust Public SureServer SV CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DCAE1C60 for ; Wed, 29 Apr 2015 15:14:16 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.11,671,1422921600"; d="scan'208";a="259924004" Message-ID: <5540F3FC.80606@citrix.com> Date: Wed, 29 Apr 2015 17:08:44 +0200 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?windows-1252?Q?Gustau_P=E9rez?= , FreeBSD XEN Subject: Re: Porting the block-iscsi hotplug script References: <553DEB97.5000300@entel.upc.edu> <5540A053.4080409@entel.upc.edu> In-Reply-To: <5540A053.4080409@entel.upc.edu> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-DLP: MIA1 X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 15:14:18 -0000 Hello, Sorry for the delay in the reply. El 29/04/15 a les 11.11, Gustau Pérez ha escrit: > > > El 27/04/2015 a les 09:56, Gustau Pérez ha escrit: >> >> Hello, >> >> I'm trying to port the linux block-iscsi hotplug script and I >> discovered there is a chain of sourcing that ends up to including 5 or 6 >> scripts in the tools/hotplug/Linux directory. Can I strip those and >> rewrite them to include only the necessary code in the Freebsd hotplug >> directory? I presume there's no assumption about the scripts' names >> other than the hotplug script itself, but I'd like to first ask. > This morning I got some time to work the block-iscsi script. With > some tweaking I was able to call directly the script with something like: > > scripts/block-iscsi add > iqn=bla,portal=bla,username=bla,password=bla > > and I was also able to simulate the remove. To do so I had to comment > out some variables (XENBUS_PATH for example). > > Now I'm trying to test it at domain creation time, and to do so I had > to uncomment XENBUS_PATH and the other changes. Creating the domain with > the disk using the iscsi syntax [1] fails. In the xen log file I get an > error complaining about XENBUS_PATH not being set [2]. Yes, libxl needs some modifications in order to execute hotplug scripts for block devices on FreeBSD. If you take a look at tools/libxl/libxl_freebsd.c:libxl__get_hotplug_script_info you will see that hotplug scripts are only executed if the device is a nic. I will try to craft a patch tomorrow to enable the execution of disk hotplug scripts for FreeBSD. Also, if you run xl with "-vvv" you will get a lot more of debugging info which might be helpful. Since there are no block hotplug scripts for FreeBSD yet there's no description about how parameters will be passed. I will also send you the calling convention and what is expected to be filled by the hotplug script upon execution together with the patch. Thanks, Roger. From owner-freebsd-xen@FreeBSD.ORG Thu Apr 30 09:58:43 2015 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BE2C634 for ; Thu, 30 Apr 2015 09:58:43 +0000 (UTC) Received: from SMTP.CITRIX.COM (smtp.citrix.com [66.165.176.89]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "mail.citrix.com", Issuer "Cybertrust Public SureServer SV CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A87A1CF0 for ; Thu, 30 Apr 2015 09:58:42 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.11,676,1422921600"; d="scan'208";a="258090858" Message-ID: <5541FC8A.8080009@citrix.com> Date: Thu, 30 Apr 2015 11:57:30 +0200 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?windows-1252?Q?Gustau_P=E9rez?= , FreeBSD XEN Subject: Re: Porting the block-iscsi hotplug script References: <553DEB97.5000300@entel.upc.edu> <5540A053.4080409@entel.upc.edu> <5540F3FC.80606@citrix.com> In-Reply-To: <5540F3FC.80606@citrix.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-DLP: MIA2 X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2015 09:58:43 -0000 Hello, El 29/04/15 a les 17.08, Roger Pau Monné ha escrit: > Yes, libxl needs some modifications in order to execute hotplug scripts > for block devices on FreeBSD. If you take a look at > tools/libxl/libxl_freebsd.c:libxl__get_hotplug_script_info you will see > that hotplug scripts are only executed if the device is a nic. > > I will try to craft a patch tomorrow to enable the execution of disk > hotplug scripts for FreeBSD. Also, if you run xl with "-vvv" you will > get a lot more of debugging info which might be helpful. > > Since there are no block hotplug scripts for FreeBSD yet there's no > description about how parameters will be passed. I will also send you > the calling convention and what is expected to be filled by the hotplug > script upon execution together with the patch. I've been digging into this, and it looks like it's going to be more complicated than what I thought. FreeBSD blkback is not prepared to work with hotplug scripts so we also need to modify it. I hope I'm going to have some time next week to prepare a patch to both the FreeBSD kernel and libxl, sorry for the delay. Roger. From owner-freebsd-xen@FreeBSD.ORG Thu Apr 30 14:41:24 2015 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6C6EDC2 for ; Thu, 30 Apr 2015 14:41:24 +0000 (UTC) Received: from SMTP.CITRIX.COM (smtp.citrix.com [66.165.176.89]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "mail.citrix.com", Issuer "Cybertrust Public SureServer SV CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A28F1260 for ; Thu, 30 Apr 2015 14:41:23 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.11,677,1422921600"; d="scan'208";a="258185821" Message-ID: <55423ECD.6000404@citrix.com> Date: Thu, 30 Apr 2015 16:40:13 +0200 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?windows-1252?Q?Gustau_P=E9rez?= , FreeBSD XEN Subject: Re: Porting the block-iscsi hotplug script References: <553DEB97.5000300@entel.upc.edu> <5540A053.4080409@entel.upc.edu> <5540F3FC.80606@citrix.com> <5541FC8A.8080009@citrix.com> <5542365D.10403@entel.upc.edu> In-Reply-To: <5542365D.10403@entel.upc.edu> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-DLP: MIA2 X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2015 14:41:24 -0000 Hello, El 30/04/15 a les 16.04, Gustau Pérez ha escrit: > > > El 30/04/2015 a les 11:57, Roger Pau Monné ha escrit: >> I've been digging into this, and it looks like it's going to be more >> complicated than what I thought. FreeBSD blkback is not prepared to work >> with hotplug scripts so we also need to modify it. >> >> I hope I'm going to have some time next week to prepare a patch to both >> the FreeBSD kernel and libxl, sorry for the delay. > > Hi Roger and thanks for your time and efforts. > > I thought XENBUS_PATH was some sort of a reference to the xenstore > path of the VM being executed and that the libxl would export that to > the hotplug scripts. I thought that simply allowing the libxl to execute > hotplug script for blk devices would be enough. > > Can I be of any help? Feel free to pass me work I you're busy. > > OTOH, I wasn't aware it could involve the Dom0 kernel. I'm confused > about that, could you please explain me why it does involve the dom0 > kernel? Sure, in order to provide paravirtualized network and disks to the guests Xen uses what is called a split device model. In the block case, this is done by having a specific driver in the guest kernel, called blkfront, and another driver in the host kernel (Dom0) called blkback. When the guest starts a region of the guest memory is mapped by blkback in order to have a transparent exchange of data between the host and the guest, and that's how disk PV drivers are implemented. blkback runs inside of the FreeBSD kernel and in order to know which file or block device is the backend of a guest virtual disk it reads a node in xenstore, which is called "params". This is directly written by libxl and is the path to the block or raw file in the common case (but when using iSCSI it just contains the information needed to connect to the target, which blkback doesn't understand at all). On Linux for example blkback doesn't read "params" directly, and instead uses another node that's written by the hotplug script upon execution, so blkback attachment is deferred until hotplug script execution has finished. We need something like this in FreeBSD blkback, in order to have the following workflow: 1. libxl populates xenstore nodes. 2. hotplug script execution. 3. blkback attaches the disk. With the current blkback code there's no way to guarantee that 3 happens after 2. > Thank you, > > Gus > > PS: a bit offtopic, but I've been reviewing the commits to FreeBSD > HEAD and I don't see this: > > https://people.freebsd.org/~royger/mem.patch > > IIRC that patch solved the problem of domU PV guests with some > hardware. Could you commit that upstream? Yes, I was waiting to see if Justin had any comments on it. If nothing comes up next week I will just commit it. Roger. From owner-freebsd-xen@FreeBSD.ORG Thu Apr 30 15:30:54 2015 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11B34DAF for ; Thu, 30 Apr 2015 15:30:54 +0000 (UTC) Received: from dash.upc.es (dash.upc.es [147.83.2.50]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay.upc.es", Issuer "TERENA SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1FC18E3 for ; Thu, 30 Apr 2015 15:30:53 +0000 (UTC) Received: from ackerman2.upc.es (ackerman2.upc.es [147.83.2.244]) by dash.upc.es (8.14.1/8.13.1) with ESMTP id t3UE4FBN005195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=FAIL); Thu, 30 Apr 2015 16:04:15 +0200 Received: from [192.168.1.193] (154.Red-83-43-116.dynamicIP.rima-tde.net [83.43.116.154]) (authenticated bits=0) by ackerman2.upc.es (8.14.4/8.14.4) with ESMTP id t3UE4DMu030780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 30 Apr 2015 16:04:14 +0200 Message-ID: <5542365D.10403@entel.upc.edu> Date: Thu, 30 Apr 2015 16:04:13 +0200 From: =?windows-1252?Q?Gustau_P=E9rez?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?windows-1252?Q?Roger_Pau_Monn=E9?= , FreeBSD XEN Subject: Re: Porting the block-iscsi hotplug script References: <553DEB97.5000300@entel.upc.edu> <5540A053.4080409@entel.upc.edu> <5540F3FC.80606@citrix.com> <5541FC8A.8080009@citrix.com> In-Reply-To: <5541FC8A.8080009@citrix.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Greylist: ACL matched, not delayed by milter-greylist-4.4.3 (dash.upc.es [147.83.2.50]); Thu, 30 Apr 2015 16:04:16 +0200 (CEST) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.4.3 (ackerman2.upc.es [147.83.2.244]); Thu, 30 Apr 2015 16:04:15 +0200 (CEST) X-Scanned-By: MIMEDefang 2.70 on 147.83.2.244 X-Mail-Scanned: Criba 2.0 + Clamd X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2015 15:30:54 -0000 El 30/04/2015 a les 11:57, Roger Pau Monné ha escrit: > I've been digging into this, and it looks like it's going to be more > complicated than what I thought. FreeBSD blkback is not prepared to work > with hotplug scripts so we also need to modify it. > > I hope I'm going to have some time next week to prepare a patch to both > the FreeBSD kernel and libxl, sorry for the delay. Hi Roger and thanks for your time and efforts. I thought XENBUS_PATH was some sort of a reference to the xenstore path of the VM being executed and that the libxl would export that to the hotplug scripts. I thought that simply allowing the libxl to execute hotplug script for blk devices would be enough. Can I be of any help? Feel free to pass me work I you're busy. OTOH, I wasn't aware it could involve the Dom0 kernel. I'm confused about that, could you please explain me why it does involve the dom0 kernel? Thank you, Gus PS: a bit offtopic, but I've been reviewing the commits to FreeBSD HEAD and I don't see this: https://people.freebsd.org/~royger/mem.patch IIRC that patch solved the problem of domU PV guests with some hardware. Could you commit that upstream?