From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0rOF-0007Rj-TZ for qemu-devel@nongnu.org; Sun, 30 Oct 2016 10:47:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0rOF-0003xM-9x for qemu-devel@nongnu.org; Sun, 30 Oct 2016 10:47:15 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:41651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0rOF-0003xG-3p for qemu-devel@nongnu.org; Sun, 30 Oct 2016 10:47:15 -0400 Date: Sun, 30 Oct 2016 15:47:12 +0100 From: Samuel Thibault Message-ID: <20161030144712.GE3671@var.home> References: <20161027153217.16984-1-dgilbert@redhat.com> <20161027153217.16984-8-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161027153217.16984-8-dgilbert@redhat.com> Subject: Re: [Qemu-devel] [PATCH 7/8] slirp: VMStatify socket level List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: qemu-devel@nongnu.org, quintela@redhat.com, amit.shah@redhat.com, jan.kiszka@siemens.com, duanj@linux.vnet.ibm.com Hello, Dr. David Alan Gilbert (git), on Thu 27 Oct 2016 16:32:16 +0100, wrote: > - case AF_INET: > - qemu_put_be32(f, so->so_faddr.s_addr); > - qemu_put_be16(f, so->so_fport); > - break; > + if (version_id >= 4 && !is_inet) { > + error_report("%s: so_ffamily unknown, socket not preserved", __func__); > } Well, no, we need to settle this another way, because we want to be able to easily add inet6 support here. At least pave the way in a way that makes it not unnecessarily hard. The code you are adding here looks to me like very hard to rework to make it support the various socket families. > + VMSTATE_UINT16_V(so_ffamily, struct socket, 4), > + VMSTATE_UINT32_TEST(so_faddr.s_addr, struct socket, > + slirp_v4_or_newer_ffamily_inet), > + VMSTATE_UINT16_TEST(so_fport, struct socket, > + slirp_v4_or_newer_ffamily_inet), Does VMStat not provide a way to have differing content depending on a field? (here, so_ffamily) Samuel