From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: ocaml libxl bindings and KeyedUnion
Date: Fri, 20 Mar 2015 17:44:17 +0100 [thread overview]
Message-ID: <20150320164417.GA23886@aepfle.de> (raw)
In-Reply-To: <1426843539.21742.92.camel@citrix.com>
On Fri, Mar 20, Ian Campbell wrote:
> The name at (*) must be the enum member, which I've duplicated at (**)
> but you might like to thing about whether (**) would have a better name
> in the context of e.g. vscsi_dev->u.dev.dev or vscsi_dev->u.wwn.wwn.
Thanks Ian. For some reason I have ocaml disabled on my workstation.
I made this change:
+++ b/tools/libxl/libxl_types.idl
@@ -571,9 +571,9 @@ libxl_vscsi_pdev = Struct("vscsi_pdev", [
("u", KeyedUnion(None, libxl_vscsi_pdev_type, "type",
[
("invalid", None),
- ("dev", libxl_vscsi_hctl),
- ("wwn", string),
- ("hctl", libxl_vscsi_hctl),
+ ("dev", Struct(None, [("m", libxl_vscsi_hctl)])),
+ ("wwn", Struct(None, [("m", string)])),
+ ("hctl", Struct(None, [("m", libxl_vscsi_hctl)])),
])),
])
> Aside: What is the difference between dev and hctl in this context?
Its supposed to represent either "/dev/something" and "h:ct:l". The
result in the "p-dev" property, which is used by the backend, is the
same. But translating "p-dev" back into the config string for the
scsi-list command needs some way to represent that. I'm not fully happy
with the current way. Perhaps the code should just reuse the "p-devname"
property to tell what was in the config file.
Olaf
next prev parent reply other threads:[~2015-03-20 16:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-20 8:10 ocaml libxl bindings and KeyedUnion Olaf Hering
2015-03-20 9:25 ` Ian Campbell
2015-03-20 16:44 ` Olaf Hering [this message]
2015-03-20 17:01 ` Ian Campbell
2015-03-24 12:18 ` 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=20150320164417.GA23886@aepfle.de \
--to=olaf@aepfle.de \
--cc=ian.campbell@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.