mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
vhost-user: add a migration blocker
If VHOST_USER_PROTOCOL_F_LOG_SHMFD is not announced, block vhost-user migration. The blocker is removed in vhost_dev_cleanup(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
This commit is contained in:
parent
9a78a5dd27
commit
d2fc4402cb
2 changed files with 21 additions and 4 deletions
|
@ -15,6 +15,7 @@
|
|||
#include "qemu/error-report.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "exec/ram_addr.h"
|
||||
#include "migration/migration.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
@ -442,6 +443,14 @@ static int vhost_user_init(struct vhost_dev *dev, void *opaque)
|
|||
}
|
||||
}
|
||||
|
||||
if (dev->migration_blocker == NULL &&
|
||||
!virtio_has_feature(dev->protocol_features,
|
||||
VHOST_USER_PROTOCOL_F_LOG_SHMFD)) {
|
||||
error_setg(&dev->migration_blocker,
|
||||
"Migration disabled: vhost-user backend lacks "
|
||||
"VHOST_USER_PROTOCOL_F_LOG_SHMFD feature.");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue