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.