Hello, Dr. David Alan Gilbert, on Mon 28 Nov 2016 09:08:16 +0000, wrote: > Hmm, I don't really know IPv6 but I'm thinking this code will become > something like > the following (says he not knowing whether a scope-id or a flowinfo > is something that needs migrating) (untested): > > > static const VMStateDescription vmstate_slirp_socket_addr = { > .name = "slirp-socket-addr", > .version_id = 4, > .fields = (VMStateField[]) { > VMSTATE_UINT16(ss.ss_family, union slirp_sockaddr), > VMSTATE_UINT32_TEST(sin.sin_addr.s_addr, union slirp_sockaddr, > slirp_family_inet), > VMSTATE_UINT16_TEST(sin.sin_port, union slirp_sockaddr, > slirp_family_inet), > > VMSTATE_BUFFER_TEST(sin6.sin6_addr, union slirp_sockaddr, > slirp_family_inet6), > VMSTATE_UINT16_TEST(sin6.sin6_port, union slirp_sockaddr, > slirp_family_inet6), > VMSTATE_UINT32_TEST(sin6.sin6_flowinfo, union slirp_sockaddr, > slirp_family_inet6), > VMSTATE_UINT32_TEST(sin6.sin6_scope_id, union slirp_sockaddr, > slirp_family_inet6), > > VMSTATE_END_OF_LIST() > } > };
Ok, that looks good :) > So to me that looks pretty clean, we need to add another slirp_family_inet6 > test function, but then we just add the extra fields for the IPv6 stuff. Yes, now I see. > Can you suggest an IPv6 command line for testing that ? Well, it doesn't exist yet, that's the problem. And applying your patch would have made it to exist even harder, so that's why I was afraid. I would say that your patch should contain these IPv6 lines, but as comments since they are untested, for the person who will at some point want to implement the IPv6 case here. Samuel