From: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH xm/xl enhancements for vptm 5/6] make devid a libxl type
Date: Tue, 25 Sep 2012 12:00:43 -0400 [thread overview]
Message-ID: <5061D52B.9080503@jhuapl.edu> (raw)
In-Reply-To: <1348569397.3452.180.camel@zakaz.uk.xensource.com>
[-- Attachment #1.1: Type: text/plain, Size: 2220 bytes --]
On 09/25/2012 06:36 AM, Ian Campbell wrote:
> On Fri, 2012-09-21 at 20:20 +0100, Matthew Fioravante wrote:
>> This fixes a bug in libxl where device ids are not initialized properly.
>> The devid field for each device is set to be an integer type which are
>> always initialized to 0.
>>
>> This makes the xl DEV-attach commands always fail to add more than one
>> device, because each time the device id is initialized to 0, when it
>> should be initialized to -1, which in the code will trigger a search for
>> free id.
> Which of the DEV-attach commands can be used to add more than one
> device?
network-attach, block-attach, and also my vtpm-attach.
>
> Where is the code to do the search? I had a look in the disk and network
> cases and couldn't find it.
libxl.c
void libxl__device_nic_add(
if (nic->devid == -1) {
if (!(dompath = libxl__xs_get_dompath(gc, domid))) {
rc = ERROR_FAIL;
goto out_free;
}
if (!(l = libxl__xs_directory(gc, XBT_NULL,
libxl__sprintf(gc, "%s/device/vif",
dompath), &nb))) {
nic->devid = 0;
} else {
nic->devid = strtoul(l[nb - 1], NULL, 10) + 1;
}
}
Right now, nic-devid is 0 on attach. So it always tries to use 0. When
you do a network-attach twice,
the second time it trys and fails to create device/vif/0
>
>> diff --git a/tools/ocaml/libs/xs/xs.mli b/tools/ocaml/libs/xs/xs.mli
>> --- a/tools/ocaml/libs/xs/xs.mli
>> +++ b/tools/ocaml/libs/xs/xs.mli
>> @@ -27,6 +27,7 @@ exception Failed_to_connect
>> type perms = Xsraw.perms
>>
>> type domid = int
>> +type devid = int
> I can see why these were needed in the xl modules, but I don't see how
> this type can be required in the xenstore ones.
It shouldn't be required for xenstore or xc. The problem is they won't
compile without it because of the way the ocaml build system works. As
far as I understand it creates types for xl, xc, and xs from the
libxl_types.idl. Either the build system needs to be changed, or devid
needs to be a type in all libraries, or we find some other way to fix
this initialization bug.
>
> Ian.
>
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 1459 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2012-09-25 16:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-21 19:20 [PATCH xm/xl enhancements for vptm 5/6] make devid a libxl type Matthew Fioravante
2012-09-25 10:36 ` Ian Campbell
2012-09-25 16:00 ` Matthew Fioravante [this message]
2012-09-25 16:14 ` Ian Campbell
2012-09-25 16:23 ` Matthew Fioravante
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=5061D52B.9080503@jhuapl.edu \
--to=matthew.fioravante@jhuapl.edu \
--cc=Ian.Campbell@citrix.com \
--cc=xen-devel@lists.xensource.com \
/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.