qemu: add support for shmem-{plain, doorbell} role

Role(master or peer) controls how the domain behaves on migration.
For more details about migration with ivshmem, see
https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/system/ivshmem.rst;hb=HEAD

It's a optional attribute in libvirt, and qemu will choose default
role for ivshmem device if the user is not specified.

With device property 'role', the value can be 'master' or 'peer'.
 - 'master' (means 'master=on' in qemu), the guest will copy
   the shared memory on migration to the destination host.
 - 'peer' (means 'master=off' in qemu), the migration is disabled.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Yang Hang <yanghang44@huawei.com>
Signed-off-by: Wang Xin <wangxinxin.wang@huawei.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Wang Xin
2020-07-24 11:34:11 +08:00
committed by Martin Kletzander
parent 77296c807b
commit 493d2769f2
15 changed files with 114 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
<shmem name='shmem0'>
<shmem name='shmem0' role='peer'>
<model type='ivshmem-plain'/>
<size unit='M'>4</size>
<alias name='shmem0'/>

View File

@@ -1,3 +1,3 @@
<shmem name='shmem0'>
<shmem name='shmem0' role='peer'>
<model type='ivshmem-plain'/>
</shmem>