From owner-freebsd-xen@freebsd.org Mon Mar 7 12:31:42 2016 Return-Path: Delivered-To: freebsd-xen@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CF1B9DB56B for ; Mon, 7 Mar 2016 12:31:42 +0000 (UTC) (envelope-from gustau.perez@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A26C21A6 for ; Mon, 7 Mar 2016 12:31:41 +0000 (UTC) (envelope-from gustau.perez@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id l68so106270603wml.0 for ; Mon, 07 Mar 2016 04:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=MZFgRG1FDenaWZ1Tu0681Wv0xkXiFriMN50JwVIcQ5c=; b=n2N0z+ZCq+XSIZgkt7MNlLgZg8D9wMkGFfDpI3/9ONsyvaxvZooRminhmRJ/BGfhbt zFYj4/xBqvCykPi5tnRp5v/qnyK/LOgI1qYEOiGdH2gdFcPmjEHMEgOpt8RvhTgyZe79 PLTqDQ48+RgbrHl7q+8dopVGSgEVpZBJZ7KU6UyrO5S5SdNmSO/MsYk5Jpqmm2bXKgmN 0VfJTN+T/cv3IR1RdPvsAU5IhScraNwlAAfMCgeyFL3Kxka43J6W7FvvIj3WpdBH3M4m zNDj6sE3woMYPgfL26nCnHORECjiAKUfRtRbiYPDD72MdNT2lQEKhbjXjYzgyRoSp4R6 r8Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=MZFgRG1FDenaWZ1Tu0681Wv0xkXiFriMN50JwVIcQ5c=; b=iahpjKmRmANI+kfVxqohAKylK/CdrIoQnGMs/7MKCBadJAZuI3yhl1N4AWsAVg5p9y IPl6Yc6rABJs5uybHz6mu6FjSE/ZYREbJsQhcvbeAYYdUHN6/MMbBn088nx5hzaZOOT2 Zxx1ktWwBTCKWKKUvUjzcBNZ8C7be5y/W19ICiKHsvfWJW3s9bqJw72xRGAS0iVpKMXq 1948cMIca24T8bQv5T7kF9M17C1AWaTsVSvUnHQgdLtUGAtk/SmcVQbSRLUw65fbdRhq yo9amRUWhxkiAydbzZpFyQTW+VP84+S4n0EbaxD8rK0Ya65SXTB3MSQhTkWVw1vXSpdt Z4Xw== X-Gm-Message-State: AD7BkJIqgVGAZoJxd6uMAclx8hw6hDI4QMjzvzBAdytMl4MMKgyeZKFOGRqtKXDj+7zSuQ== X-Received: by 10.28.10.149 with SMTP id 143mr12085585wmk.38.1457353900113; Mon, 07 Mar 2016 04:31:40 -0800 (PST) Received: from [10.0.2.151] ([147.83.40.10]) by smtp.googlemail.com with ESMTPSA id y62sm13424039wmg.12.2016.03.07.04.31.38 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Mar 2016 04:31:38 -0800 (PST) Subject: Re: Porting the block-iscsi hotplug script To: FreeBSD XEN References: <553DEB97.5000300@entel.upc.edu> <555EF542.3090002@citrix.com> <555F9B3F.1000600@entel.upc.edu> <55602512.1090702@citrix.com> <56C6FA2F.8040900@gmail.com> <56CAC8CB.8030107@gmail.com> <56CADEDA.4050007@citrix.com> <56CB0057.1060509@gmail.com> <56CB041E.1020009@citrix.com> <56CB2D90.5080809@gmail.com> <56CB34BA.6060809@citrix.com> <56CC24BD.6050609@gmail.com> <56CC32E5.5010101@citrix.com> <56CC7637.3080408@gmail.com> <56CF5668.6090605@citrix.com> <56D0091F.80408@gmail.com> <56D02863.7040100@citrix.com> <56D03D95.9090509@gmail.com> <56D04E5F.8070901@citrix.com> <56D42A28.8050701@gmail.com> <56D434FC.8030905@citrix.com> <56D57110.2060406@gmail.com> <56D587D8.6030702@citrix.com> <56D590EA.609@gmail.com> <56D591BA.4020303@gmail.com> <56D5929F.7040001@citrix.com> <56D5C722.3080205@gmail.com> <56D6B68D.8080809@citrix.com> <56D7FEFE.9050000@gmail.com> <56D97762.7000908@gmail.com> From: =?UTF-8?Q?Gustau_P=c3=a9rez?= Message-ID: <56DD74A9.3050709@gmail.com> Date: Mon, 7 Mar 2016 13:31:37 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.21 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, 07 Mar 2016 12:31:42 -0000 El 4/03/16 a les 16:54, Roger Pau Monné ha escrit: > > Linux already has some code to do this checking, but this also involves > taking a lock in order to make sure there's only one hotplug script > performing this check at the same time. > > The Linux function that performs this checking is in: > > http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/hotplug/Linux/block;h=2691b56951c9b82094471a141b9e0bed04abb929;hb=HEAD#l40 > > And the caller is: > > http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/hotplug/Linux/block;h=2691b56951c9b82094471a141b9e0bed04abb929;hb=HEAD#l275 > > If you take a look, the call to check_device_sharing is protected with the > "block" lock. > Thank you, today I wasn't unable to code, I hope I'll have some time this afternoon. Btw, In coding sh style, I don't want to bring in bash and add another dependency to the xen-tools port. Gustau From owner-freebsd-xen@freebsd.org Tue Mar 8 16:44:28 2016 Return-Path: Delivered-To: freebsd-xen@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B739DAC8A39 for ; Tue, 8 Mar 2016 16:44:28 +0000 (UTC) (envelope-from gustau.perez@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59BDEFBB for ; Tue, 8 Mar 2016 16:44:28 +0000 (UTC) (envelope-from gustau.perez@gmail.com) Received: by mail-wm0-x230.google.com with SMTP id p65so35731425wmp.0 for ; Tue, 08 Mar 2016 08:44:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=muxhPnykz8sl4+ij34yFg/V5a6K9GVOGfx2afy797FQ=; b=iOtuAt5xr0vMXiDyiNPvaeEQEmJ4sSm1d47aUbRu3p4jE9fWkivOwdp6ZTPg1gT0iV urg/DcZo7kHnho/mM1kd6ek1O7qPuspT1aYYE+UyifUsgbEVT54Q4LlncPUAxhSlUnaN FqEjdbG77DskvvqEZWrDs/fwiWG+CtcdbnRnmAQAH8ub5N+R4ztjcTCPsr9PUrbDIyiv O9k5s0ggploTc8bjG/M2NZM76OdXvyBbgcNtCzyKsuO8OjzXsBgISbFxyYdlCgN9w5Zl 40Bc4MfERQ6JD+CEjkVom5OjegtDMLMWBf2xhfKA4gu70M8OVyobkFfl4fQFRj9KBQOe shKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=muxhPnykz8sl4+ij34yFg/V5a6K9GVOGfx2afy797FQ=; b=GOP2OGnVulz/kIHq1MU+IdBdX3fZdPj9qD4BRollM/FREOkB94glybsTJuH/3mCUBi HvfEpks2NUiVVWodl6fSE1TTYuemqVtI7wUXzDkMNSPRa0Oz9s17kgsWu1zVFfalkY19 6VWiQul/HkRF10nKMkMDK337mIBU9UI+XcErvVLMK33qMnJb5K80VcU/ciCb2MjMIOmF zgI+fifJ2WeL2Gnp4Nmer2XZv5E1/kVrsQjbzxOZNGPJmZBKBsQxUTovupMuzO4wMiJA cUQ2Q2vOmV0ru0xHAqdvjFWjh4sjncLG1fYWM9HPFtJS6XPvd23J8KCjjGAaI4EOEqLm Nu2g== X-Gm-Message-State: AD7BkJIiunPVJ/Ha4cFR8F7ftwrcF87jTttZIDkdY36lLPFSM+5DA5YHyOBxqd6m0w7d4g== X-Received: by 10.194.115.132 with SMTP id jo4mr28876500wjb.156.1457455466572; Tue, 08 Mar 2016 08:44:26 -0800 (PST) Received: from [10.0.2.151] ([147.83.40.10]) by smtp.googlemail.com with ESMTPSA id x186sm19640897wmg.19.2016.03.08.08.44.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Mar 2016 08:44:25 -0800 (PST) Subject: Re: Porting the block-iscsi hotplug script To: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= References: <553DEB97.5000300@entel.upc.edu> <555EF542.3090002@citrix.com> <555F9B3F.1000600@entel.upc.edu> <55602512.1090702@citrix.com> <56C6FA2F.8040900@gmail.com> <56CAC8CB.8030107@gmail.com> <56CADEDA.4050007@citrix.com> <56CB0057.1060509@gmail.com> <56CB041E.1020009@citrix.com> <56CB2D90.5080809@gmail.com> <56CB34BA.6060809@citrix.com> <56CC24BD.6050609@gmail.com> <56CC32E5.5010101@citrix.com> <56CC7637.3080408@gmail.com> <56CF5668.6090605@citrix.com> <56D0091F.80408@gmail.com> <56D02863.7040100@citrix.com> <56D03D95.9090509@gmail.com> <56D04E5F.8070901@citrix.com> <56D42A28.8050701@gmail.com> <56D434FC.8030905@citrix.com> <56D57110.2060406@gmail.com> <56D587D8.6030702@citrix.com> <56D590EA.609@gmail.com> <56D591BA.4020303@gmail.com> <56D5929F.7040001@citrix.com> <56D5C722.3080205@gmail.com> <56D6B68D.8080809@citrix.com> <56D7FEFE.9050000@gmail.com> <56D97762.7000908@gmail.com> Cc: FreeBSD XEN From: =?UTF-8?Q?Gustau_P=c3=a9rez?= X-Enigmail-Draft-Status: N1110 Message-ID: <56DF0168.4010300@gmail.com> Date: Tue, 8 Mar 2016 17:44:24 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.21 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: Tue, 08 Mar 2016 16:44:28 -0000 El 4/03/16 a les 16:54, Roger Pau Monné ha escrit: > On Fri, 4 Mar 2016, Gustau Pérez wrote: >> El 4/03/16 a les 11:00, Roger Pau Monné ha escrit: >>> What other parameters do you want to pass to your script that cannot be >>> fetched from xenstore? IMHO I was planning to only pass the xenstore >>> backend node and the action. >> The action (if I understand it correctly) is already there. > Yes, the xenstore backend path is $1 and the action $2. > >> OTOH, I'd like to check if the disks are already in use, and so I'd >> need to walk the /local/domain/0/backend/vbd/$domin/$devid/ looking if >> the disks are already there. This arises two questions: >> >> * can I assume the domain0 store would always be /local/domain/0/? > Hm, I wouldn't be on it. This is true in the most common scenario, where > Dom0 (domain with id 0) runs all the backends. But if you are using a > driver domain or a radically disagregated system (where control domain != > hardware domain) this is no longer true. So in general you shouldn't make > this assumption. > >> * would I need to walk for each $domid checking for each $devid and >> getting the physical device? Hi, today I had some time to work a bit the script. I managed to have something that works with plain 'sh' and seems to do its job. I need to split the script (for example, the xenstore_[read|write] functions can be used by other scripts) and I also need to tackle the locking functions, which are not 'sh' compliant. If you want I can post it somewhere. I make the assumption that domain0 can also be the dom0 domain. As you previously stated, in general this assumption should hold; given the fact that the domain ids are given sequentially in the worst case the dom0 would be > 0. This is used when checking if the disk is already in use, that way we can return the domid of the domain already using the device or 0 if the device can be used. Thank you, Gustau From owner-freebsd-xen@freebsd.org Thu Mar 10 12:18:16 2016 Return-Path: Delivered-To: freebsd-xen@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6C02AC9D8C for ; Thu, 10 Mar 2016 12:18:16 +0000 (UTC) (envelope-from gustau.perez@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4732BD74 for ; Thu, 10 Mar 2016 12:18:16 +0000 (UTC) (envelope-from gustau.perez@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id l68so26127066wml.0 for ; Thu, 10 Mar 2016 04:18:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:cc:from:to:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=o1ZWkNYfxNe9wcj9PZ1PDGRWH9Do0raGVH74+kLjiC0=; b=N4OxUXhkQ72QfyQRi/ktwQ+PFxtqe9l89gxJ5M+XFuY2tWAU6+rHUxT9vWrzfWHIjT v4CdzQUFIvnaVDfcp507hN62W4wbH12DdTCTtCLfJ6H6Y5INdm0oQ1YI3Xpu+/o29FlC 3LUYi49kCjSaBf3zaizJsCbgb1sgMW4txAFE575nkBIg7e3uUcF44xNicBpvVaexbkoT oK5mgouo8KLuIFPdE6UOeNXRqPYzTcsRTg719aLVwaVtTEG2vpF0X0h0HibzjdJzdfzW lPCW9BRfid9r3QWzL97JC8HRt3S7VIw/qoUnkG73PiyFfibH1yiH5gagIISyNLhV3Xl/ w8rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:cc:from:to:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=o1ZWkNYfxNe9wcj9PZ1PDGRWH9Do0raGVH74+kLjiC0=; b=e0X94rQ6FRpftFaoXR47RlIWN6Ib/3ousytzBV+tHHBl1a9RiV+CUyQirq1me/jj8N lnczK5lU19zsYjvrPYFbN5D3L+3qs2orL0WwfmwBy3DVfs6D6SyIaK5LkUw6pbjaAJGb Uh9tdJVc6JbO42QHuZ5t+hvaMQT987NkMV3TfwlGnuS0W7RITwThWNEDTmFkAw9ffGtE uWckX6lbF0YGbgSyNTsgIShv1fwP1huw07x9jzaxeIWh2QTp38sFknOj7K0KwNUu0peX zADw6sqONi49JIQmfORruShdPaGkYAxrO/1915Ezs/oNZamc9FOIHvv83MEm59e2Meu1 1wvQ== X-Gm-Message-State: AD7BkJJH9aR6t9Aqm+tyvPoVzxbcXNsXd75mdQHK2Xd83AXmIZnu7xHH2mVY1okvqSuuSQ== X-Received: by 10.194.91.233 with SMTP id ch9mr3467084wjb.121.1457612294578; Thu, 10 Mar 2016 04:18:14 -0800 (PST) Received: from [10.0.2.151] ([147.83.40.10]) by smtp.googlemail.com with ESMTPSA id i1sm3222347wjs.45.2016.03.10.04.18.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Mar 2016 04:18:13 -0800 (PST) Subject: Re: Porting the block-iscsi hotplug script References: <553DEB97.5000300@entel.upc.edu> <555EF542.3090002@citrix.com> <555F9B3F.1000600@entel.upc.edu> <55602512.1090702@citrix.com> <56C6FA2F.8040900@gmail.com> <56CAC8CB.8030107@gmail.com> <56CADEDA.4050007@citrix.com> <56CB0057.1060509@gmail.com> <56CB041E.1020009@citrix.com> <56CB2D90.5080809@gmail.com> <56CB34BA.6060809@citrix.com> <56CC24BD.6050609@gmail.com> <56CC32E5.5010101@citrix.com> <56CC7637.3080408@gmail.com> <56CF5668.6090605@citrix.com> <56D0091F.80408@gmail.com> <56D02863.7040100@citrix.com> <56D03D95.9090509@gmail.com> <56D04E5F.8070901@citrix.com> <56D42A28.8050701@gmail.com> <56D434FC.8030905@citrix.com> <56D57110.2060406@gmail.com> <56D587D8.6030702@citrix.com> <56D590EA.609@gmail.com> <56D591BA.4020303@gmail.com> <56D5929F.7040001@citrix.com> <56D5C722.3080205@gmail.com> <56D6B68D.8080809@citrix.com> <56D7FEFE.9050000@gmail.com> <56D97762.7000908@gmail.com> From: =?UTF-8?Q?Gustau_P=c3=a9rez?= X-Enigmail-Draft-Status: N1110 To: FreeBSD XEN Message-ID: <56E16604.2040007@gmail.com> Date: Thu, 10 Mar 2016 13:18:12 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.21 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, 10 Mar 2016 12:18:16 -0000 El 4/03/16 a les 16:54, Roger Pau Monné ha escrit: > Linux already has some code to do this checking, but this also involves > taking a lock in order to make sure there's only one hotplug script > performing this check at the same time. > > The Linux function that performs this checking is in: > > http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/hotplug/Linux/block;h=2691b56951c9b82094471a141b9e0bed04abb929;hb=HEAD#l40 > > And the caller is: > > http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/hotplug/Linux/block;h=2691b56951c9b82094471a141b9e0bed04abb929;hb=HEAD#l275 > > If you take a look, the call to check_device_sharing is protected with the > "block" lock. > Hi Roger, today I got time for that and there's something in tools/hotplug/Linux/locking.sh I don't understand. There's an array (_lockdict) which seems to be used to keep track of the locks. But I have a few concerns: 1. Where are those values kept? I mean, the _lockdict array seems to be used in _setlockfd() function to search if the lock is already used. Then it searches for the lock and used it if found, If it's not found a new lock is attached, if there's a lock previously freed in a position < ${#_lockdict} that $i position is used. But it remains alive just during the execution of the hotplug script and thus Id say does locks are per process, right? 2. This is not related to xen nor xl, but perhaps someone may come with a solution. In sh I think I don't have arrays, does anyone know a solution for that? I mean, perhaps it would be possible to simulate them. The second one may be solved by depending on bash, but I think that would be overkill IMHO. Best, Gustau > . From owner-freebsd-xen@freebsd.org Fri Mar 11 08:55:15 2016 Return-Path: Delivered-To: freebsd-xen@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF196ACABD4 for ; Fri, 11 Mar 2016 08:55:15 +0000 (UTC) (envelope-from skarida@gmail.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D7B8C95 for ; Fri, 11 Mar 2016 08:55:15 +0000 (UTC) (envelope-from skarida@gmail.com) Received: by mail-wm0-x234.google.com with SMTP id p65so8381907wmp.0 for ; Fri, 11 Mar 2016 00:55:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=lPhsJYKKfNBhQLwmdRQhbAngi/fcISeCHSkI0qbJ9bI=; b=agqyRs4JMjWLzqoPy+nZrPE/O6j6UFLWfEG8HaF6WiVvtbTzivwWGRWErTOhlF65zZ I5DsxtflazRjhz7rLKzEf3L9hOCcESXZ17LGgsb6VSz/I9VaKZ9EwCj/KPcwxvf2Rz03 ZvfYIdTx+VPZ2SVbiHLyxNYRVf1BKO5tzY+DWKILHkdLNRcFyHdvmLtliEDWfJhM7XEA 1xwQApMJ3zQZ50s0CtkTlxWVezFLyLTXfHusc59nXUhUycMweCYfphefrqYFc2P7Z/Ed GCa62Ek63XZh+Saglo9qKoMpOHBWvkfscTler89AEpK/UCUVDNwjlLnQCWtwfv+gguXw 0xUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=lPhsJYKKfNBhQLwmdRQhbAngi/fcISeCHSkI0qbJ9bI=; b=EQMmAmN0MgQdSidReDT7wYHYsnTD+o0BrmpFplozt9n7NUcz7Dhlb36hfCaXj50utJ 2F0zRYvo3jGgBXpBg9BKm1GPfvfi66NovBzdCDUroT6KasV6PfTm1SdRvIM5EMFhCvDW IuKjARROkGrBJQA7pQMhmg4+za5rNhjsvbmY75ykHKTqkDbXC1oV/rH1q6eoGdJGn6lp w5Z/jA8hlYV9e8a8TFGOrqoD8DSveUDLpvAeW3vLYtoOWGode7j8YYoSFd2zC3833zM4 9gGXqxMzmOfJhDQPZI6AMp+Bu0G4L5FCazwtgd9akG7Y2fdjPShc8uGcwp947rj8QTvC 8s+g== X-Gm-Message-State: AD7BkJJFebeTsZKY2WSQ/akLcSKG2U9Ps3uVcUuvcQU/0lJK1SFCL1fEV0IJqOICbc5lkfMkg3MOjU4HMKc20w== MIME-Version: 1.0 X-Received: by 10.28.3.138 with SMTP id 132mr1518697wmd.20.1457686513700; Fri, 11 Mar 2016 00:55:13 -0800 (PST) Received: by 10.28.225.196 with HTTP; Fri, 11 Mar 2016 00:55:13 -0800 (PST) Date: Fri, 11 Mar 2016 10:55:13 +0200 Message-ID: Subject: FreeBSD 11 XEN Dom0 hangs and reboot From: "skarida@gmail.com" To: freebsd-xen@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.21 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: Fri, 11 Mar 2016 08:55:16 -0000 Hello all, I have tried to run FreeBSD 11 rev.296614 and /usr/ports/emulator/xen on two different hardware configurations and the result was the same. XEN kernel loads successfully but it hangs and restart on dom0 Init with *"Error* creating domain 0" and "ELF boundaries" error. I tried on : *) Dell Vostro with CPU i7-2640M *) SuperMicro X10DRW-N with CPU E5-2667 v3 Both CPU are listed to support VT-d and VT-x. On both machines I have EPT and DMAR available. On both machines virtualization is enabled in BIOS. How can I proceed to catch the error source hardware related, XEN related or FreeBSD related ? Cheers Rumen Palov From owner-freebsd-xen@freebsd.org Fri Mar 11 14:03:31 2016 Return-Path: Delivered-To: freebsd-xen@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A0EFACC6E5 for ; Fri, 11 Mar 2016 14:03:31 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com [IPv6:2607:f8b0:400e:c03::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF8F09D8 for ; Fri, 11 Mar 2016 14:03:30 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-pa0-x233.google.com with SMTP id fl4so98566600pad.0 for ; Fri, 11 Mar 2016 06:03:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=sLqa8y5HWLY5imWImS0oa1W7e8UZjtOFTdt6+5w49lU=; b=YN6J6do8wk0wGgfFcNvDTRgfGJu6y1yB/W0orblUJAICNecE8+b4MQLt5ogNM9xg5r 1uZx5F+DwxSlPz9KaCpyUFAPSJDW8+DraHXUZmL2r7tlIKT0Oy7ZrxIy5U2DGEEN5Qpx /rulxTBfTQUBzxyNYseS59Eip8Y01GHe75VkN4oTvNpxXpYRFzDK+hlMOpCiP3t3UMLF fls5mY00Q0RTWl156xZbBbPJ3wtKaS9ncv4U98N9Z1TtRqCTKQQwX3OSQMAXO2Q2/dWN 5Z8yYkMuFiu3sNcdLcH6NUSqH0B/DaOiPg3Te3s/FCJ7nQFaL3U2WjDOmNYA/74CdlxG KU3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:in-reply-to :message-id:references:user-agent:mime-version; bh=sLqa8y5HWLY5imWImS0oa1W7e8UZjtOFTdt6+5w49lU=; b=EjplI27aCtK75MjmAgwR1HKrl3p91uR9Zw/SJzrpcFgI2yufSTkh1rZJcpzcUD5UdG X6gggqXiiflHSvcpRDScO4jCtwzY/cZSnOWgL4rOdPY21+oa6L8nasT6XpY02FqYJGEv MDwCkMXmJnNNnjsGreuvRN3bssdt1aDUybgdtISd7mZdsydQA2PC4NRwtIZTPxPl/VGs ay9j9vM34W9zyXOQ4pRJqq3B9uyTYG33jhOwOedI+3WqZLb5W6ZHI9y1oFr8nIN5p01e XTtAlG5YusPra0cwtrMZ4qzZ/lOkLdC0VKlqJHAflQQ1AXUVe8cqcrnKj/K1E9TyVu5W DiAQ== X-Gm-Message-State: AD7BkJJOlVKM+6pVGlK1MEogcL/w6Hzy21bBSOaPs2MoUSi6Sv7iQty+xjlDVaV+BYRc2w== X-Received: by 10.66.62.132 with SMTP id y4mr15073297par.55.1457705010182; Fri, 11 Mar 2016 06:03:30 -0800 (PST) Received: from [192.168.1.68] (p142030-ipngn11501marunouchi.tokyo.ocn.ne.jp. [220.104.97.30]) by smtp.gmail.com with ESMTPSA id 27sm13311040pfo.58.2016.03.11.06.03.28 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Mar 2016 06:03:29 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Fri, 11 Mar 2016 23:03:27 +0900 (JST) From: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= X-X-Sender: royger@macbook-air-de-roger.local To: "skarida@gmail.com" cc: freebsd-xen@freebsd.org Subject: Re: FreeBSD 11 XEN Dom0 hangs and reboot In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (OSX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.21 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: Fri, 11 Mar 2016 14:03:31 -0000 On Fri, 11 Mar 2016, skarida@gmail.com wrote: Hello, > Hello all, > > I have tried to run FreeBSD 11 rev.296614 and /usr/ports/emulator/xen on > two different hardware configurations and the result was the same. XEN > kernel loads successfully but it hangs and restart on dom0 Init with > *"Error* creating domain 0" and "ELF boundaries" error. > > I tried on : > *) Dell Vostro with CPU i7-2640M > *) SuperMicro X10DRW-N with CPU E5-2667 v3 > > Both CPU are listed to support VT-d and VT-x. On both machines I have EPT > and DMAR available. > On both machines virtualization is enabled in BIOS. > > How can I proceed to catch the error source hardware related, XEN related > or FreeBSD related ? This has also been reported in the freebsd-virt mailing list: https://lists.freebsd.org/pipermail/freebsd-virtualization/2016-March/004257.html It seems like something is broken while linking the kernel, so the resulting ELF program headers physical address is wrong. AFAICT using r295683 or older revisions should work fine. As said in the other email, I'm currently bisecting the kernel in order to try to find the cause of the issue. Roger. From owner-freebsd-xen@freebsd.org Fri Mar 11 14:30:57 2016 Return-Path: Delivered-To: freebsd-xen@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A9EEACC10F for ; Fri, 11 Mar 2016 14:30:57 +0000 (UTC) (envelope-from gustau.perez@gmail.com) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1F201999 for ; Fri, 11 Mar 2016 14:30:56 +0000 (UTC) (envelope-from gustau.perez@gmail.com) Received: by mail-ig0-x231.google.com with SMTP id ig19so12880478igb.0 for ; Fri, 11 Mar 2016 06:30:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bKCwryO+Dcv8dbnXQrmbgsQmAaBSRX5Be75qGA0PYgI=; b=af+r2cWRm6rcAtDpFXqLBIKI5l+/pRDBDr5GV4ickMgVrtAtoPxraVfcP3vP5lANDS 4XR2YnG47OXArxt6hSrRovMtMWEjndQDMnbMBB64QhElSlonQF1tADTx2wbL5XiLIzep ic7OxxLMSDINMWS+8t+2+FdcJNoDts0LJ9KaqhFh51CZHvM1BYFToK7V9XM5SMQm+48c I7EvL47jMMs3aRL3YrgYM/onWtiwq8kk2O35lHLSS2fwmkU8qFREf+vgDem1e4ZcD4Qn Nu21zxVqy3k7JQrjXO+dHvevc+0s7GY91ATo1YkQ5gn8vpf3lMxu3VxsbvFEG6BgDFSx E4GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bKCwryO+Dcv8dbnXQrmbgsQmAaBSRX5Be75qGA0PYgI=; b=jUQFm7MPE/jllKr7hP/CuzaN00sG5EkK6W5a5vjmQVchvv4LRdASfZ4qwbkFNXb5xu V77DaOtbhFmtMosD++2088P3Lk+CYKiSIHby/y/Gm/fHeI6MQPh2L4mEv/A1PPXqSqaW /FWnFj1tT2uyqZuHWCMBNGKBIufhOuRloT2AURKjNGhJqQtGTEwNmZpV1RJarFT9hgDq d0HSAR2BDPZfhZhE3d5h2pVAsY/Zw5C7UmltPv5How6Ri9z3JtYqF7Ht9Wpamn3EGO7q WhhXFUhIDe7BCxi/jM1g2ua0tRdZfniyg4SForgJySj2S25Qir6Ch07oHi48aajVOZUC Mi2w== X-Gm-Message-State: AD7BkJI9rBgeH6QZ3yypiuMhOStyocFZd4MzxQ3WcLknqnYn0DkanVo2UhbEvQAvLqjRqafHLFvUAzEXj6kP0A== X-Received: by 10.50.164.229 with SMTP id yt5mr3822202igb.43.1457706656324; Fri, 11 Mar 2016 06:30:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.10.198 with HTTP; Fri, 11 Mar 2016 06:30:16 -0800 (PST) In-Reply-To: <56E16604.2040007@gmail.com> References: <553DEB97.5000300@entel.upc.edu> <555EF542.3090002@citrix.com> <555F9B3F.1000600@entel.upc.edu> <55602512.1090702@citrix.com> <56C6FA2F.8040900@gmail.com> <56CAC8CB.8030107@gmail.com> <56CADEDA.4050007@citrix.com> <56CB0057.1060509@gmail.com> <56CB041E.1020009@citrix.com> <56CB2D90.5080809@gmail.com> <56CB34BA.6060809@citrix.com> <56CC24BD.6050609@gmail.com> <56CC32E5.5010101@citrix.com> <56CC7637.3080408@gmail.com> <56CF5668.6090605@citrix.com> <56D0091F.80408@gmail.com> <56D02863.7040100@citrix.com> <56D03D95.9090509@gmail.com> <56D04E5F.8070901@citrix.com> <56D42A28.8050701@gmail.com> <56D434FC.8030905@citrix.com> <56D57110.2060406@gmail.com> <56D587D8.6030702@citrix.com> <56D590EA.609@gmail.com> <56D591BA.4020303@gmail.com> <56D5929F.7040001@citrix.com> <56D5C722.3080205@gmail.com> <56D6B68D.8080809@citrix.com> <56D7FEFE.9050000@gmail.com> <56D97762.7000908@gmail.com> <56E16604.2040007@gmail.com> From: =?UTF-8?Q?Gustau_P=C3=A9rez?= Date: Fri, 11 Mar 2016 15:30:16 +0100 Message-ID: Subject: Re: Porting the block-iscsi hotplug script To: FreeBSD XEN Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.21 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: Fri, 11 Mar 2016 14:30:57 -0000 > > Hi Roger, > > today I got time for that and there's something in > tools/hotplug/Linux/locking.sh I don't understand. There's an array > (_lockdict) which seems to be used to keep track of the locks. But I > have a few concerns: > > 1. Where are those values kept? I mean, the _lockdict array seems to be > used in _setlockfd() function to search if the lock is already used. > Then it searches for the lock and used it if found, If it's not > found a new lock is attached, if there's a lock previously freed in > a position < ${#_lockdict} that $i position is used. But it remains > alive just during the execution of the hotplug script and thus Id > say does locks are per process, right? > 2. This is not related to xen nor xl, but perhaps someone may come with > a solution. In sh I think I don't have arrays, does anyone know a > solution for that? I mean, perhaps it would be possible to simulate > them. > > The second one may be solved by depending on bash, but I think that > would be overkill IMHO. > > Best, > > Gustau > > > . > Answering myself: - I've been to trick ash and do something like an array by using multiple variables named like _lockdict$i and another variable holding the size of the array. if the execution of the scrip only lasts during the boot of a particular machine I think we would be fine. I guess the locks need to be released before the hotplug finishes or there would be stale locks in the system. - I'll ask you something about the advisory locks. Perhaps this evening if I find some time to spend. Thanks, Gustau