[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] libxl: problem with devices in PV

On Thu, 2011-07-21 at 10:39 +0100, Roger Pau Monnà wrote:
> BTW, would it be ok to create a new disk backend, like LOOP or VND
> Now it's a bit hackish, since type is always set to phy, I have to
> guess the real type by checking if  'params' starts with '/dev' on
> xenbackend. I think it would be clearer to set the type to
> LIBXL_DISK_BACKEND_VND if passed file is not a block device and OS is
> NetBSD in disk_try_backend.

The VND stuff is transparent to the toolstack though, it's internal to
xenbackendd and the hotplug scripts, all the toolstack sees is a vbd
directory in xenstore. So I think it would be better to stick with the
phy/vbd types within the toolstack.

Can the code in disk_try_backend become:

[in some suitable central location:]
#if __NetBSD__

        if (!(a->disk->format == LIBXL_DISK_FORMAT_RAW ||
              a->disk->format == LIBXL_DISK_FORMAT_EMPTY)) {
            goto bad_format;
        if (a->disk->format == LIBXL_DISK_FORMAT_EMPTY)
            return backend;

        if (S_ISREG(a->stab.st_mode)) /* S_ISLNK? */
            return backend;
        if (S_ISBLK(a->stab.st_mode))
            return backend;

        LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend phy"
                   " unsuitable as phys path not a block device"
#ifdef HAVE_PHY_...
                   " nor a regular file"
                   , a->disk->vdev);
        return 0;

? (perhaps the log message construction could be done cleaner)


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.