From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38751 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORo0q-0000AF-IB for qemu-devel@nongnu.org; Thu, 24 Jun 2010 11:06:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORo0p-0005NZ-7K for qemu-devel@nongnu.org; Thu, 24 Jun 2010 11:06:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4484) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORo0p-0005NP-0m for qemu-devel@nongnu.org; Thu, 24 Jun 2010 11:06:43 -0400 From: Alex Williamson In-Reply-To: <4C22F250.2080508@redhat.com> References: <20100624044046.16168.32804.stgit@localhost.localdomain> <20100624044215.16168.51019.stgit@localhost.localdomain> <4C22F250.2080508@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 24 Jun 2010 09:06:32 -0600 Message-ID: <1277391992.4669.2254.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 12/15] savevm: Create a new continue flag to avoid resending block name List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: jan.kiszka@siemens.com, qemu-devel@nongnu.org, armbru@redhat.com, paul@codesourcery.com, cam@cs.ualberta.ca, kraxel@redhat.com On Thu, 2010-06-24 at 07:51 +0200, Paolo Bonzini wrote: > > @@ -377,26 +398,11 @@ int ram_load(QEMUFile *f, void *opaque, int version_id) > > } else if (flags& RAM_SAVE_FLAG_PAGE) { > > void *host; > > > > - if (version_id == 3) { > > + if (version_id == 3) > > host = qemu_get_ram_ptr(addr); > > - } else { > > - RAMBlock *block; > > - char id[256]; > > - uint8_t len; > > + else > > + host = host_from_stream_offset(f, addr, flags); > > > > - len = qemu_get_byte(f); > > - qemu_get_buffer(f, (uint8_t *)id, len); > > - id[len] = 0; > > - > > - QLIST_FOREACH(block,&ram_list.blocks, next) { > > - if (!strncmp(id, block->idstr, sizeof(id))) > > - break; > > - } > > - if (!block) > > - return -EINVAL; > > - > > - host = block->host + addr; > > - } > > qemu_get_buffer(f, host, TARGET_PAGE_SIZE); > > } > > if (qemu_file_has_error(f)) { > > Gah, sorry. :) > > This also takes care of the code duplication, great. It was certainly a good thought ;) See my reply to Yoshi for the overhead saved. Thanks, Alex