• M
    ivshmem: Fix unplug of device "ivshmem-plain" · b266f1d1
    Markus Armbruster 提交于
    Commit 2aece63c "hostmem: detect host backend memory is being used
    properly" fixed "ivshmem-plain" to reject memory backends that are
    already in use, and to block their deletion while in use.  Two bugs
    escaped review:
    
    * New ivshmem_plain_exit() fails to call ivshmem_exit().  This breaks
      unplug.  Reproducer: migration after unplug still fails with
      "Migration is disabled when using feature 'peer mode' in device
      'ivshmem'".
    
    * It failed to update legacy "ivshmem".  Harmless, because it creates
      the memory backend itself, and nothing else should use it.
    
    Fix by moving the two host_memory_backend_set_mapped() calls into
    ivshmem_common_realize() and ivshmem_exit(), guarded by s->hostmem.
    
    Fixes: 2aece63cSigned-off-by: NMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20180926163709.22876-1-armbru@redhat.com>
    Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
    b266f1d1
ivshmem.c 37.2 KB