All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v10 4/5] libxl: add support for vscsi
Date: Fri, 1 Apr 2016 18:25:49 +0100	[thread overview]
Message-ID: <22270.44829.165824.448663@mariner.uk.xensource.com> (raw)
In-Reply-To: <1458635016-20146-5-git-send-email-olaf@aepfle.de>

Olaf Hering writes ("[PATCH v10 4/5] libxl: add support for vscsi"):
> Port pvscsi support from xend to libxl:
> 
>  vscsi=['pdev,vdev{,options}']
>  xl scsi-attach
>  xl scsi-detach
>  xl scsi-list

Thanks for this contribution.  I have tried to review it, although I
don't fully understand the underlying vscsi subsystem.  The public API
looks reasonably good.


> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 59b183c..b670997 100644
> --- a/tools/libxl/libxl_types.idl
...
> +libxl_vscsiinfo = Struct("vscsiinfo", [
> +    ("backend", string),
> +    ("backend_id", uint32),
> +    ("frontend", string),
> +    ("frontend_id", uint32),
> +    ("devid", libxl_devid),
> +    ("pdev", libxl_vscsi_pdev),
> +    ("vdev", libxl_vscsi_hctl),
> +    ("idx", libxl_devid),
> +    ("vscsidev_id", libxl_devid),
> +    ("scsi_raw_cmds", bool),
> +    ("vscsictrl_state", integer),
> +    ("vscsidev_state", integer),
> +    ("evtch", integer),
> +    ("rref", integer),

I don't think the event channel and ring ref belong here.  (That they
are present in some other devices is a mistake.)


> +static int xlu__vscsi_parse_dev(XLU_Config *cfg, char *pdev, libxl_vscsi_hctl *hctl)
> +{
> +    struct stat dentry;
> +    char *sysfs = NULL;
> +    const char *type;
> +    int rc, found = 0;
> +    DIR *dirp;
> +    struct dirent *de;
...
> +    /* /sys/dev/type/major:minor symlink added in 2.6.27 */
> +    if (asprintf(&sysfs, "/sys/dev/%s/%u:%u/device/scsi_device", type,
> +                 major(dentry.st_rdev), minor(dentry.st_rdev)) < 0) {
> +        sysfs = NULL;
> +        rc = ERROR_NOMEM;
> +        goto out;
> +    }

I'm not sure that this sysfs parsing ought to be in xl rather than
libxl.  Also, this is Linux-specific code.  So it needs to be made
conditional somehow.

It seems to me that the contents of xlu__vscsi_target should be much
closer to vscsi_pdev_type (unless I have misunderstood).

Perhaps the libxl_types.idl API needs to change.  In general, the
libxl API ought to be close enough in semantics to the xl config API
that the correspondence is obvious.  I don't think that's the case
here.



Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-04-01 17:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22  8:23 [PATCH v10 0/5] libxl: add support for pvscsi, iteration 10 Olaf Hering
2016-03-22  8:23 ` [PATCH v10 1/5] vscsiif.h: fix WWN notation for p-dev property Olaf Hering
2016-03-22  8:23 ` [PATCH v10 2/5] docs: add vscsi to xenstore-paths.markdown Olaf Hering
2016-03-22  8:23 ` [PATCH v10 3/5] vscsiif.h: add some notes about xenstore layout Olaf Hering
2016-03-22  8:23 ` [PATCH v10 4/5] libxl: add support for vscsi Olaf Hering
2016-03-31  8:56   ` Juergen Gross
2016-03-31  9:12     ` Olaf Hering
2016-04-01 17:25   ` Ian Jackson [this message]
2016-04-01 17:52     ` Olaf Hering
2016-04-01 18:04       ` Ian Jackson
2016-04-08  7:17     ` Olaf Hering
2016-03-22  8:23 ` [PATCH v10 5/5] Scripts to create and delete xen-scsiback nodes in Linux target framework Olaf Hering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22270.44829.165824.448663@mariner.uk.xensource.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=olaf@aepfle.de \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.