From: Ian Campbell <Ian.Campbell@citrix.com>
To: Euan Harris <euan.harris@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: libxl: Is the nic param to libxl_network_device_add an (in)_out parameter?
Date: Tue, 18 Nov 2014 15:35:24 +0000 [thread overview]
Message-ID: <1416324924.17982.21.camel@citrix.com> (raw)
In-Reply-To: <20141118152848.GE31225@citrix.com>
On Tue, 2014-11-18 at 15:28 +0000, Euan Harris wrote:
> Hi,
>
> If I call libxl_device_nic_add and pass in a mostly-default
> libxl_device_nic structure, the function fills in the unspecified default
> config fields with data for the NIC which it has just created:
>
> libxl_device_nic nic;
> libxl_device_nic_init(&nic);
> /*
> nic.devid == -1
> nic.mac == 00:00:00:00:00:00
> nic.model == null
> etc.
> */
>
> libxl_device_nic_add(ctx, domid, &nic, NULL);
> /*
> nic.devid == 3
> nic.mac == 00:16:3e:1b:7b:12
> nic.model == rtl8139
> etc.
> */
>
> Is this behaviour an intentional part of the API which I can rely on,
> or just an artefact of the current implementation? In other words, is
> nic meant to be an (in)_out parameter?
I believe so, yes. The comment under "Devices" in libxl.h probably ought
to be adjusted to say so explicitly.
Ian (J) -- do you agree?
> If it's not, what is the correct
> way to find out the device ID which was allocated for the new device,
> for example?
You would have to libxl_device_<type>_list and look for it, which is
clearly suboptimal.
Ian.
next prev parent reply other threads:[~2014-11-18 15:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 15:28 libxl: Is the nic param to libxl_network_device_add an (in)_out parameter? Euan Harris
2014-11-18 15:35 ` Ian Campbell [this message]
2014-11-18 15:41 ` Ian Jackson
2014-11-18 15:44 ` Ian Campbell
2014-11-18 17:08 ` Euan Harris
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=1416324924.17982.21.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=euan.harris@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.