Re: [Qemu-devel] [RFC PATCH 2/6] ram_blocks: Convert to a QLIST

Yoshiaki Tamura
2010-06-09T21:12:51Z

2010/6/10 Alex Williamson <alex.williamson@redhat.com>:
> On Wed, 2010-06-09 at 14:11 -0600, Cam Macdonell wrote:
>> On Tue, Jun 8, 2010 at 1:15 PM, Alex Williamson
>> > diff --git a/cpu-all.h b/cpu-all.h
>> > index 77eaf85..458cb4b 100644
>> > --- a/cpu-all.h
>> > +++ b/cpu-all.h
>> > @@ -859,9 +859,21 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr);
>> >  /* memory API */
>> >
>> >  extern int phys_ram_fd;
>> > -extern uint8_t *phys_ram_dirty;
>> >  extern ram_addr_t ram_size;
>> > -extern ram_addr_t last_ram_offset;
>> > +
>> > +typedef struct RAMBlock {
>> > +    uint8_t *host;
>> > +    ram_addr_t offset;
>> > +    ram_addr_t length;
>> > +    QLIST_ENTRY(RAMBlock) next;
>> > +} RAMBlock;
>>
>> For my shared memory device I need a way to mark device memory as not
>> to be migrated.  Can a flag to be added to this struct to accomplish
>> this?
>
> Yep, it should be easy to skip blocks during migration based on a flag
> here.  I guess that probably means you'd also want a flag when you alloc
> the block, so maybe it should be:
>
> qemu_ram_alloc(DeviceState *dev, const char *name, ram_addr_t size, int flags)
>
> Best to make that change now, then we can add it to the RAMBlock as we need.

I have a question that if a device doesn't want to be migrated, why is
it still connected during live migration? Shouldn't that be hot
unplugged before going into the live migration procedure?

Thanks,

Yoshi

>
> Alex
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>