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

Re: [Xen-devel] ocaml libxl bindings and KeyedUnion



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

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


 


Rackspace

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