Markus Armbruster b266f1d112 ivshmem: Fix unplug of device "ivshmem-plain"
Commit 2aece63c8a "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: 2aece63c8a9d2c3a8ff41d2febc4cdeff2633331
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180926163709.22876-1-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2018-10-10 08:01:36 +02:00
..
2016-05-19 16:42:29 +02:00
2016-06-14 15:59:14 +01:00
2018-10-02 19:09:03 +02:00
2017-06-02 05:54:43 +01:00
2018-10-02 19:09:12 +02:00
2017-12-18 17:07:02 +03:00
2016-05-19 16:42:29 +02:00
2016-06-14 15:59:14 +01:00
2018-06-08 13:15:32 +01:00
2018-06-01 14:15:10 +02:00
2017-06-02 05:54:43 +01:00
2016-05-19 16:42:29 +02:00