This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [PATCH] libxl: added libxl compatibility with physical b

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] libxl: added libxl compatibility with physical backend file for NetBSD
From: Roger Pau Monné <roger.pau@xxxxxxxxxxxxx>
Date: Fri, 22 Jul 2011 16:55:35 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 22 Jul 2011 07:56:16 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bRT74ihTkm15t0Hz4FMWI5byrLQQQL3qAogac9Xi8mI=; b=MuCk01OwKFU2HroLFaVE7F7PY4SKnf0a4Q13pIJqo97BTG1Gb9L6xI9ERIh0B/aMv5 12MzdXTQA+DlS7WBdYM5LnnxuRTBiU5ARDRuwqxFQkkvnb3RJXoNUlb+PwO2CBiFNRZW Bdvl39mDdor5AzbdxQzOaVCHaGw7ySnwC0w+o=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1311341983.12772.66.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CAPLaKK5QW_PiGcKcKoH-g4VF8zM_VFmpjGiuW5DbNN9kHeMXJg@xxxxxxxxxxxxxx> <1311341983.12772.66.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
2011/7/22 Ian Campbell <Ian.Campbell@xxxxxxxxxx>:
> On Fri, 2011-07-22 at 13:38 +0100, Roger Pau Monné wrote:
>> Hello,
>> This patch fixes the problems described in a previous thread regarding
>> PV machines not booting on NetBSD with libxl toolstack. The patch also
>> prevents libxl from adding PCI entries to xenstore if there is no PCI
>> device configured in the guest.
> Thanks Roger.
> In general we prefer to see individual fixes split up into separate
> patches for review and commit. Also please can you add to your ~/.hgrc:
>        [diff]
>        showfunc = True
> It prints the function name in the hunk header which makes it easier to
> review.

Ok done, sorry, I didn't know about that.

> The change to the hotplug script seems odd, if the "xtype" paramter is
> not needed then just remove it altogether, otherwise we need to teach
> libxl what to write.

The block script needs the parameter xtype because it needs to know if
the vbd is a block device (phy) or a regular file (file). Since libxl
sets the param type based on disk->backend, and it is always
LIBXL_DISK_BACKEND_PHY (even if image is a regular file or a block
device, libxl.c:998), the "type" atribute in the xenstore is no longer
helpful to choose whether the "params" is a block device or a regular
file. That's why I asked to create a new DISK_BACKEND define,
something like VND or LOOP. Or maybe if disk->backend is PHY, use
disk->format to set "type" in xenstore (using RAW for "file" and EMPTY
for "phy").

> The PCI change looks good, although you might as well throw the for()
> loop under the check too.
> "#ifdef" etc should be in column 0, but the content should be indented
> normally.

Ok, will fix that.

> The checks on LIBXL_DISK_FORMAT_EMPTY and S_ISBLK are not really related
> so I would not combine them even though the return is the same.
> Otherwise the HAVE_PHY_BACKEND_FILE_SUPPORT change itself looks ok
> What is DONT_REMOVE_VBD_FROM_STORE for? Is this because xenbackendd does
> it for you or something else?

xenbackendd is a little tricky, and can cause trouble regarding
sincronization. libxl and xenbackendd are not synchronized, so
sometimes xenstore entries where removed from the store before
xenbackend had time to read them, and perform the necessary
operations, this resulted in vnd devices not being detached, so I just
disabled the remove of vbd entries from libxl. I think it would be
better to implement some kind of synchronization between libxl and
xenbackend, so the flow would be like:

Stop guest ----> xenbackend: detach devices -----> libxl: remove entries

Don't know about the best way to synchronize this, I can only thing
about synchronizing them using the "hotplug-status" attribute, but
that would mean changing the way libxl__device_destroy works.

> Does your changed xenbackendd still work with xend? Oh, I see what the
> hotplug script change was about now -- I guess just remove the commented
> out line?

Yes, I missed that one, I will remove it.

> Ian.

Thanks for the feedback, Roger.

Xen-devel mailing list