From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USOmB-0006cc-CQ for qemu-devel@nongnu.org; Wed, 17 Apr 2013 05:35:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USOmA-0006fI-8U for qemu-devel@nongnu.org; Wed, 17 Apr 2013 05:35:39 -0400 Received: from mail-qe0-f54.google.com ([209.85.128.54]:36835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USOmA-0006fA-4N for qemu-devel@nongnu.org; Wed, 17 Apr 2013 05:35:38 -0400 Received: by mail-qe0-f54.google.com with SMTP id s14so774724qeb.13 for ; Wed, 17 Apr 2013 02:35:37 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <516E6CDE.8070509@redhat.com> Date: Wed, 17 Apr 2013 11:35:26 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1366172418-8729-1-git-send-email-mrhines@linux.vnet.ibm.com> <1366172418-8729-6-git-send-email-mrhines@linux.vnet.ibm.com> In-Reply-To: <1366172418-8729-6-git-send-email-mrhines@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL v3 5/7] rdma: send pc.ram List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mrhines@linux.vnet.ibm.com Cc: aliguori@us.ibm.com, quintela@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com Il 17/04/2013 06:20, mrhines@linux.vnet.ibm.com ha scritto: > +/* > + * If a page (or a whole RDMA chunk) has been > + * determined to be zero, then zap it. > + */ > +void ram_handle_compressed(void *host, uint8_t ch, uint64_t size) > +{ > + memset(host, ch, TARGET_PAGE_SIZE); > +#ifndef _WIN32 > + if (ch == 0 && (!kvm_enabled() || kvm_has_sync_mmu()) && > + getpagesize() <= TARGET_PAGE_SIZE) { > + qemu_madvise(host, size, QEMU_MADV_DONTNEED); > + } > +#endif > +} > + > static int ram_load(QEMUFile *f, void *opaque, int version_id) > { > ram_addr_t addr; > @@ -837,14 +881,7 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) > } > > ch = qemu_get_byte(f); > - memset(host, ch, TARGET_PAGE_SIZE); > -#ifndef _WIN32 > - if (ch == 0 && > - (!kvm_enabled() || kvm_has_sync_mmu()) && > - getpagesize() <= TARGET_PAGE_SIZE) { > - qemu_madvise(host, TARGET_PAGE_SIZE, QEMU_MADV_DONTNEED); > - } > -#endif > + ram_handle_compressed(host, ch, TARGET_PAGE_SIZE); > } else if (flags & RAM_SAVE_FLAG_PAGE) { > void *host; > This part got squashed here. Please put it in a separate patch as it was in v2. Paolo