libxl__device_nextid and holes
I wonder if libxl__device_nextid is robust enough to handle holes. If there are 3 devices (0,1,2) of type X, and device #0 or #1 is removed with "X-detach", wouldn't the code return nextid==2? The result would be that the caller will write to the wrong path.
I have not veified this theory in practice.
Olaf
Quoted 7 lines · Olaf Hering
I wonder if
libxl__device_nextidis robust enough to handle holes. If there are 3 devices (0,1,2) of type X, and device #0 or #1 is removed with "X-detach", wouldn't the code return nextid==2? The result would be that the caller will write to the wrong path.I have not veified this theory in practice.
I once had the same question. IIRC I did some experiments and that function seemed to work fine.
You can verify this by attaching / detaching devices to a domain.
And I think the following line is the meat.
1956 nextid = strtoul(l[nb - 1], NULL, 10) + 1;
Wei.
Quoted 6 lines
Olaf
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel