[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 05/21] migration: Introduce ignore-shared capabil
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PULL 05/21] migration: Introduce ignore-shared capability |
Date: |
Mon, 18 Mar 2019 17:19:28 +0000 |
User-agent: |
Mutt/1.11.3 (2019-02-01) |
* Markus Armbruster (address@hidden) wrote:
> "Dr. David Alan Gilbert (git)" <address@hidden> writes:
>
> > From: Yury Kotov <address@hidden>
> >
> > We want to use local migration to update QEMU for running guests.
> > In this case we don't need to migrate shared (file backed) RAM.
> > So, add a capability to ignore such blocks during live migration.
> >
> > Signed-off-by: Yury Kotov <address@hidden>
> > Message-Id: <address@hidden>
> > Reviewed-by: Dr. David Alan Gilbert <address@hidden>
> > Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> > ---
> [...]
> > diff --git a/qapi/migration.json b/qapi/migration.json
> > index 1fd7bbea9b..eab87340b2 100644
> > --- a/qapi/migration.json
> > +++ b/qapi/migration.json
> > @@ -409,13 +409,16 @@
> > # devices (and thus take locks) immediately at the end of
> > migration.
> > # (since 3.0)
> > #
> > +# @x-ignore-shared: If enabled, QEMU will not migrate shared memory (since
> > 4.0)
>
> What exactly is considered "shared memory"?
There's an existing property of RAMBlock's called 'shared' and this is
exactly whether that existing property is set; it corresponds to the
'share' property in hostmem, which is a user visible property and
normally maps to whether we have MAP_SHARED.
> Specifically: say you have an ivshmem-plain device. Is its shared
> memory migrated?
Hmm good question.
So I think it comes down to whether the call to
'memory_region_init_ram_from_fd' has the 'share' flag set, which ends
up setting a RAM_SHARED ram_flag when it's passed to
qemu_ram_alloc_from_fd.
In hw/misc/ivshmem.c I see:
/* mmap the region and map into the BAR2 */
memory_region_init_ram_from_fd(&s->server_bar2, OBJECT(s),
"ivshmem.bar2", size, true, fd, &local_err);
and that 'true' is the 'share' flag.
So, yep, it skips that.
> No objection to the pull request; if documentation improvements are
> necessary, we can do them in a follow-up patch.
I wonder how to describe it; since it mapped 1-1 with the 'shared' flag
on hostmem I hadn't thought it needed anything extra; but the ivshmem
case I guess is a special, I wonder what others there are.
Dave
> > +#
> > # Since: 1.2
> > ##
> > { 'enum': 'MigrationCapability',
> > 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
> > 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
> > 'block', 'return-path', 'pause-before-switchover', 'x-multifd',
> > - 'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate' ] }
> > + 'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate',
> > + 'x-ignore-shared' ] }
> >
> > ##
> > # @MigrationCapabilityStatus:
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- [Qemu-devel] [PULL 00/21] migration queue, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 01/21] migration: Fix cancel state, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 03/21] migration/rdma: clang compilation fix, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 02/21] migration/rdma: Fix qemu_rdma_cleanup null check, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 04/21] exec: Change RAMBlockIterFunc definition, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 05/21] migration: Introduce ignore-shared capability, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 06/21] migration: Add an ability to ignore shared RAM blocks, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 08/21] migration: Add capabilities validation, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 07/21] tests/migration-test: Add a test for ignore-shared capability, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 11/21] tests: Add basic migration precopy tcp test, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 09/21] tests: Add migration xbzrle test, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 13/21] bitmap: bitmap_count_one_with_offset, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 12/21] bitmap: fix bitmap_count_one, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 14/21] migration: use bitmap_mutex in migration_bitmap_clear_dirty, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 15/21] migration: API to clear bits of guest free pages from the dirty bitmap, Dr. David Alan Gilbert (git), 2019/03/05
- [Qemu-devel] [PULL 10/21] migration: Create socket-address parameter, Dr. David Alan Gilbert (git), 2019/03/05