From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrTdx-0000Pl-5c for qemu-devel@nongnu.org; Tue, 25 Jun 2013 09:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrTds-0001uw-ER for qemu-devel@nongnu.org; Tue, 25 Jun 2013 09:50:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrTdr-0001uq-NQ for qemu-devel@nongnu.org; Tue, 25 Jun 2013 09:50:44 -0400 Message-ID: <51C9A022.8020709@redhat.com> Date: Tue, 25 Jun 2013 15:50:26 +0200 From: Paolo Bonzini 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> <51C99D67.8090806@linux.vnet.ibm.com> In-Reply-To: <51C99D67.8090806@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 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: "Michael R. Hines" Cc: aliguori@us.ibm.com, quintela@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, chegu_vinod@hp.com, knoel@redhat.com Il 25/06/2013 15:38, Michael R. Hines ha scritto: > 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. Indeed, it made my review a bit easier. Paolo