On 12/01/2011 03:44 PM, Anthony Liguori wrote: >> So, links are equivalent to pointers? > > > Yup. Once we have qom inheritance (next stage), we can have a > link<PCIDevice> property and you'll be able to set it to an E1000State > with the appropriate casting and error checking taking place.
I really like this goal but can't help feeling that we're stretching C beyond its limits here, so that the client code ends up boilerplate-heavy. Kind of like the issue with local_err elsewhere in this thread, where you juggle things instead of a "throw Exception(...)". What does the client code looks like for link<PCIDevice>? -- error compiling committee.c: too many arguments to function