On 27 May 2013 19:48, Laurent Vivier <laur...@vivier.eu> wrote: > This allows to pass the device name. > > You can test this with the "route" command. > > WITHOUT this patch: > > $ sudo route add -net default gw 10.0.3.1 eth0 > SIOCADDRT: Bad address > $ netstat -nr > Kernel IP routing table > Destination Gateway Genmask Flags MSS Window irtt Ifa > 10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth > > WITH this patch: > > $ sudo route add -net default gw 10.0.3.1 eth0 > $ netstat -nr > Kernel IP routing table > Destination Gateway Genmask Flags MSS Window irtt Ifa > 0.0.0.0 10.0.3.1 0.0.0.0 UG 0 0 0 eth > 10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth > > Signed-off-by: Laurent Vivier <laur...@vivier.eu>
Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> Incidentally, the command works without the patch if the guest base is zero (eg x86_64-on-x86_64); but now we use guest base more often so the patch is required. (Having thunk_convert treat pointers in structs just like longs, ie simple byteswap, is a bit dubious. I'd be tempted to put in a warning at least if we hit that code path, except I suspect we have some current uses which do a thunk_convert of the whole struct and then fix up the pointer afterwards.) thanks -- PMM