From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb3FW-0003HR-ON for qemu-devel@nongnu.org; Wed, 21 Nov 2012 00:53:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tb3FV-00011i-Qm for qemu-devel@nongnu.org; Wed, 21 Nov 2012 00:53:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb3FV-00011c-JE for qemu-devel@nongnu.org; Wed, 21 Nov 2012 00:53:25 -0500 Date: Wed, 21 Nov 2012 11:23:20 +0530 From: Amit Shah Message-ID: <20121121055320.GB3648@amit.redhat.com> References: <87txsjk9uw.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87txsjk9uw.fsf@codemonkey.ws> Subject: Re: [Qemu-devel] [PATCH 1/4] virtio-rng: use virtqueue_get_avail_bytes, fix migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , qemu list On (Tue) 20 Nov 2012 [19:44:55], Anthony Liguori wrote: > Amit Shah writes: > > > Popping an elem from the vq just to find out its length causes problems > > with save/load later on. Use the new virtqueue_get_avail_bytes() > > function instead, saves us the complexity in the migration code, as well > > as makes the migration endian-safe. > > > > Signed-off-by: Amit Shah > > To be clear, migration is already endian safe but this is definitely a > very nice cleanup. The in_addr and out_addr fields have pointers -- so endian- plus word-length safety isn't guaranteed if migrating across architectures. Amit