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

Re: [Xen-devel] xen vbd: better.




On Fri, 22 Oct 2004, Keir Fraser wrote:

> I'm interested to know how. How do you define a network header layout,
> for example, and how do you access subfields? e.g., is there an
> explicit IDL with integration into the compiler?

it's the old fashioned way. You pack and unpack from an array of unsigned
chars. It sounds painful, but there's so little of it needed that it
really doesn't matter much. In 15 years of working on this kernel nobody
has ever felt the need, and although they did end up adding __packed__
into the compiler in some form, they hated it for practical and esthetic
reasons; hence its use is "deprecated". The kernel functions that do the
pack/unpack are tiny and have not changed in forever.

Having done this both way myself many times, I'd have to come down right
on the middle of the fence. Yah, having the compiler pack is nice.  No,
it's actually not foolproof in all cases on all compilers for all time --
so it's out there waiting to bite you. And, the 'unpack it yourself' is in
actual practice more portable -- at least that's how it's been for me
(well, and many others).  Weird but true.

There's a lot of interesting philosophical arguments to be made on either 
side, I'm just reporting them. Having solved my problems (almost) with 
the vbd, I'm going to move along now :-) 

[VBD reported size still makes no sense at all]


ron


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

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