From: Ian Campbell <ian.campbell@citrix.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: Wei Liu <wei.liu2@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
George Dunlap <george.dunlap@eu.citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Chunyan Liu <cyliu@suse.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH v5 3/5] libxl: add support for vscsi
Date: Wed, 13 May 2015 16:12:49 +0100 [thread overview]
Message-ID: <1431529969.8263.324.camel@citrix.com> (raw)
In-Reply-To: <1431528246.8263.307.camel@citrix.com>
On Wed, 2015-05-13 at 15:44 +0100, Ian Campbell wrote:
> > #define COMPARE_PCI(a, b) ((a)->func == (b)->func && \
> > (a)->bus == (b)->bus && \
> > (a)->dev == (b)->dev)
> > libxl_vscsi_dev = Struct("vscsi_dev", [
> > + ("vscsi_dev_id", libxl_devid),
> > + ("remove", bool),
>
> What is this remove field?
>
> A libxl_vscsi_dev describes a device, not the actions which can be
> performed on the device. Those are in the names of the functions.
I started reviewing the code and came across the usage of this, and I'm
afraid we need to reconsider how this stuff fits together.
The underlying issue is that vscsi, like pci (and maybe pvusb?), is a
bit different to other devices, in that the xenstore front/back actually
represent a bus and not individual devices, which are represented as
subdevices.
You've represented this as a libxl_vscsi_dev which is actually a bus
containing an array of devices, which leads to an API where to remove a
device you have to provide libxl_device_scsi_remove with a
libxl_device_vscsi where the individual devices are tagged for remove or
not, using a field in the dev descriptor. Really the remove API should
be taking something like what you've called libxl_vscsi_dev.
There are also issues around updating the json state etc which I think
are made more complicated because of this (DEVICE_ADD called in dev_rm,
and a new version of DEVICE_REMOVE etc).
Is it important/useful that the user be able to configure/control the
number (and addresses) of the buses themselves and which devices are on
which, or can we get away with the pvpci model where the libxl user just
gives the individual devices and the library internally takes care of
what buses need to be created?
If that is not an option then we may need to follow the pvusb model
(Chunyan and George CC-d in case I've got it wrong) which is to have
explicit/separate host and device structs in the libxl API and
associated separate commands to add/remove buses vs add/remove devices
on those buses.
I don't think splitting the structs but not the API functions as you hae
here is something we want to go with.
Going the PCI route would almost certainly be less work at both the API
and implementation side.
Ian.
next prev parent reply other threads:[~2015-05-13 15:12 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-06 13:28 [PATCH v5 0/5] libbxl: add support for pvscsi, iteration 5 Olaf Hering
2015-05-06 13:28 ` [PATCH v5 1/5] vscsiif.h: fix WWN notation for p-dev property Olaf Hering
2015-05-13 14:11 ` Ian Campbell
2015-05-06 13:28 ` [PATCH v5 2/5] docs: add vscsi to xenstore-paths.markdown Olaf Hering
2015-05-13 14:12 ` Ian Campbell
2015-05-06 13:28 ` [PATCH v5 3/5] libxl: add support for vscsi Olaf Hering
2015-05-13 14:23 ` Ian Campbell
2015-05-15 6:29 ` Olaf Hering
2015-05-13 14:44 ` Ian Campbell
2015-05-13 15:12 ` Ian Campbell [this message]
2015-05-13 17:31 ` Olaf Hering
2015-05-15 4:11 ` Jürgen Groß
2015-05-15 5:58 ` Olaf Hering
2015-05-15 8:47 ` Ian Campbell
2015-05-15 9:35 ` Juergen Gross
2015-05-15 9:46 ` Ian Campbell
2015-05-15 9:48 ` Ian Campbell
2015-05-13 17:56 ` George Dunlap
2015-05-13 15:24 ` Olaf Hering
2015-05-06 13:28 ` [PATCH v5 4/5] vscsiif.h: add some notes about xenstore layout Olaf Hering
2015-05-13 14:14 ` Ian Campbell
2015-05-06 13:28 ` [PATCH v5 5/5] Scripts to create and delete xen-scsiback nodes in Linux target framework Olaf Hering
2015-05-13 14:18 ` Ian Campbell
2015-05-13 14:37 ` 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=1431529969.8263.324.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=cyliu@suse.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.jackson@eu.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.