qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH RDMA support v5: 09/12] transmit pc.ram usin


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH RDMA support v5: 09/12] transmit pc.ram using RDMA
Date: Tue, 09 Apr 2013 18:50:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

Il 09/04/2013 05:04, address@hidden ha scritto:
> 
> +            if ((bytes_sent = save_rdma_page(f, block->offset, 
> +                            offset, cont, TARGET_PAGE_SIZE, zero)) >= 0) {
> +                acct_info.norm_pages++;
> +                qemu_file_update_position(f, bytes_sent);
> +            } else if (zero) {

I think this should become a new QEMUFileOps member, save_ram_page.  If
NULL it can return ENOTSUP.

> +/* 
> + * Inform server to begin handling dynamic page registrations
> + */
> +static void ram_registration_start(QEMUFile *f)
> +{
> +    if(qemu_file_ops_are(f, &rdma_write_ops)) {
> +        qemu_put_be64(f, RAM_SAVE_FLAG_RDMA);
> +    }
> +}
> +
> +/*
> + * Inform server that dynamic registrations are done for now.
> + * First, flush writes, if any.
> + */
> +static int ram_registration_stop(QEMUFile *f)
> +{
> +    int ret = 0;
> +
> +    if (qemu_file_ops_are(f, &rdma_write_ops)) {
> +        ret = qemu_rdma_drain_cq(f);
> +        if(ret >= 0)
> +            ret = qemu_rdma_finish_registrations(f);
> +    }
> +
> +    return ret;

I think this should become two QEMUFileOps instead: before_ram_iterate
and after_ram_iterate, or something like that.  Again, if NULL they
should just do nothing.

Errors from the callback should be persisted in the QEMUFile with
qemu_file_set_error.  Then you do not need any checks in the caller.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]