From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrTSw-0008Bf-MY for qemu-devel@nongnu.org; Tue, 25 Jun 2013 09:39:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrTSt-0005qt-1L for qemu-devel@nongnu.org; Tue, 25 Jun 2013 09:39:26 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:34177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrTSs-0005qk-SX for qemu-devel@nongnu.org; Tue, 25 Jun 2013 09:39:22 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Jun 2013 07:39:22 -0600 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 826C938C804F for ; Tue, 25 Jun 2013 09:38:47 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5PDcm1n255998 for ; Tue, 25 Jun 2013 09:38:48 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5PDclaJ029522 for ; Tue, 25 Jun 2013 10:38:48 -0300 Message-ID: <51C99D67.8090806@linux.vnet.ibm.com> Date: Tue, 25 Jun 2013 09:38:47 -0400 From: "Michael R. Hines" MIME-Version: 1.0 References: <1372125485-11795-1-git-send-email-mrhines@linux.vnet.ibm.com> <1372125485-11795-10-git-send-email-mrhines@linux.vnet.ibm.com> <87wqpiz9vj.fsf@elfo.elfo> In-Reply-To: <87wqpiz9vj.fsf@elfo.elfo> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v11 09/15] rdma: new QEMUFileOps hooks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, pbonzini@redhat.com, chegu_vinod@hp.com, knoel@redhat.com On 06/25/2013 07:51 AM, Juan Quintela wrote: > mrhines@linux.vnet.ibm.com wrote: >> From: "Michael R. Hines" >> >> These are the prototypes and implementation of new hooks that >> RDMA takes advantage of to perform dynamic page registration. >> >> An optional hook is also introduced for a custom function >> to be able to override the default save_page function. >> >> Also included are the prototypes and accessor methods used by >> arch_init.c which invoke funtions inside savevm.c to call out >> to the hooks that may or may not have been overridden >> inside of QEMUFileOps. >> >> Reviewed-by: Paolo Bonzini >> Reviewed-by: Chegu Vinod >> Tested-by: Chegu Vinod >> Tested-by: Michael R. Hines >> Signed-off-by: Michael R. Hines > Hi > > >> +void ram_control_before_iterate(QEMUFile *f, uint64_t flags) >> +{ >> + int ret = 0; >> + >> + if (f->ops->before_ram_iterate) { >> + ret = f->ops->before_ram_iterate(f, f->opaque, flags); >> + if (ret < 0) { >> + qemu_file_set_error(f, ret); >> + } >> + } >> +} >> + >> +void ram_control_after_iterate(QEMUFile *f, uint64_t flags) >> +{ >> + int ret = 0; >> + >> + if (f->ops->after_ram_iterate) { >> + ret = f->ops->after_ram_iterate(f, f->opaque, flags); >> + if (ret < 0) { >> + qemu_file_set_error(f, ret); >> + } >> + } >> +} >> + >> +void ram_control_load_hook(QEMUFile *f, uint64_t flags) >> +{ >> + int ret = 0; >> + >> + if (f->ops->hook_ram_load) { >> + ret = f->ops->hook_ram_load(f, f->opaque, flags); >> + if (ret < 0) { >> + qemu_file_set_error(f, ret); >> + } >> + } else { >> + qemu_file_set_error(f, ret); >> + } >> +} >> + >> +size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset, >> + ram_addr_t offset, size_t size, int *bytes_sent) >> +{ >> + if (f->ops->save_page) { >> + int ret = f->ops->save_page(f, f->opaque, block_offset, >> + offset, size, bytes_sent); >> + >> + if (ret != RAM_SAVE_CONTROL_DELAYED) { >> + if (*bytes_sent > 0) { >> + qemu_update_position(f, *bytes_sent); >> + } else if (ret < 0) { >> + qemu_file_set_error(f, ret); >> + } >> + } >> + >> + return ret; >> + } >> + >> + return RAM_SAVE_CONTROL_NOT_SUPP; >> +} >> + >> static void qemu_fill_buffer(QEMUFile *f) >> { >> int len; > I wou0ld clame that the calls to this functions belong to this patch. > Not that it makes a lot of difference though. > > Later, Juan. > I'll avoid rebasing if there's no strong objection - as this ordering was suggested by Paolo. - Michael