WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] libxenlight driver

To: Jim Fehlig <jfehlig@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] libxenlight driver
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Mon, 14 Feb 2011 12:15:19 +0000
Cc: LibVir <libvir-list@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Markus Gross <gross@xxxxxxxxxxxxx>
Delivery-date: Mon, 14 Feb 2011 04:16:11 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D588CDF.8090501@xxxxxxxxxx>
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: <4D588CDF.8090501@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Mon, 14 Feb 2011, Jim Fehlig wrote:
> Hi All,
> 
> Here's a first cut of libxenlight driver for libvirt.  The driver is
> stateful and provides functionality for managed (persistent) domains. 
> The driver only maintains state for and manages domains under its
> control, ignoring domains created by other libxenlight clients, e.g. xl.
> 
> As you can see, a fair number of the driver functions are implemented,
> at least what I think constitutes a minimal set for upstream inclusion. 
> Are there any required functions missing?
> 
> I'm still looking into a problem with failure to restart a domain,
> persistent or otherwise.  E.g. virsh start|create domU; virsh shutdown
> domU; virsh start|create domU.  The second start/create fails in
> libxenlight, but I've not yet tracked down the cause.  Also, I've not
> yet handled restart of libvirtd if domains are running - not sure if
> this is a requirement for initial inclusion.
> 
> TIA for your review and comment.
> 
> Regards,
> Jim
> 
> 
> Add a new xen driver based on libxenlight [1], which is the primary
> toolstack starting with Xen 4.1.0.  The driver is stateful, runs
> privileged only, and is accessed with libxl:/// URI.
> 

---8<---

> +static int
> +libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
> +{
> +    virDomainDiskDefPtr *l_disks = def->disks;
> +    int ndisks = def->ndisks;
> +    libxl_device_disk *x_disks;
> +    int i;
> +
> +    if (VIR_ALLOC_N(x_disks, ndisks) < 0) {
> +        virReportOOMError();
> +        return -1;
> +    }
> +
> +    for (i = 0; i < ndisks; i++) {
> +        if (l_disks[i]->src &&
> +             (x_disks[i].physpath = strdup(l_disks[i]->src)) == NULL) {
> +            virReportOOMError();
> +            goto error;
> +        }
> +
> +        if (l_disks[i]->dst &&
> +            (x_disks[i].virtpath = strdup(l_disks[i]->dst)) == NULL) {
> +            virReportOOMError();
> +            goto error;
> +        }
> +
> +        if (l_disks[i]->driverName) {
> +            if (STREQ(l_disks[i]->driverName, "tap") ||
> +                STREQ(l_disks[i]->driverName, "tap2")) {
> +                if (l_disks[i]->driverType &&
> +                    STREQ(l_disks[i]->driverType, "qcow2"))
> +                    x_disks[i].phystype = PHYSTYPE_QCOW2;
> +                else if (l_disks[i]->driverType &&
> +                         STREQ(l_disks[i]->driverType, "aio"))
> +                    x_disks[i].phystype = PHYSTYPE_AIO;
> +                else if (l_disks[i]->driverType &&
> +                         STREQ(l_disks[i]->driverType, "vhd"))
> +                    x_disks[i].phystype = PHYSTYPE_VHD;
> +            } else if (STREQ(l_disks[i]->driverName, "file")) {
> +                x_disks[i].phystype = PHYSTYPE_FILE;
> +            } else if (STREQ(l_disks[i]->driverName, "phy")) {
> +                x_disks[i].phystype = PHYSTYPE_PHY;
> +            }
> +        } else {
> +            /* Default to file?? */
> +            x_disks[i].phystype = PHYSTYPE_FILE;
> +        }

Just an heads up on disk parsing: we are about to change the disk API,
before the xen 4.1 release. That's because we realized that the current
API entangles the disk backend and the disk format together; so we are
going to separate them, using two separate fields: backend and format.
An change in the xl disk config parser will also follow, that should
help you make the corresponding changes to this function.

Everything else on the libxenlight side looks good!


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>