qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 12/15] savevm: Create a new continue flag to avo


From: Alex Williamson
Subject: [Qemu-devel] Re: [PATCH 12/15] savevm: Create a new continue flag to avoid resending block name
Date: Thu, 24 Jun 2010 09:06:32 -0600

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






reply via email to

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