mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-10-28 14:04:39 +08:00
Remove the test test_validate_caps_pair, which asserted postcopy-ram and mapped-ram capabilities cannot be active together. The new fast snapshot load feature is exactly this pair of capabilities active together, with the following patches in this series, this combination will now supported and be functional. Remove the capability check that rejected mapped-ram and postcopy-ram being set simultaneously, as this combination now corresponds to fast snapshot load. Add a capability check against setting multifd when configured for fast snapshot load as it is not supported yet. Also add capability check against setting postcopy-preempt as it is incompatible. Add infrastructure to check postcopy_notifier_list being empty in capaility checking to block vhost-user with fast snapshot load as it is not supported. Add a check to bail in migrate_prepare to prevent unexpected usage when fast snapshot load is enabled. A smoke test exercising this feature has been added further in this series. Signed-off-by: Aadeshveer Singh <aadeshveer07@gmail.com> Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
83 lines
1.9 KiB
C
83 lines
1.9 KiB
C
/*
|
|
* Notifier lists
|
|
*
|
|
* Copyright IBM, Corp. 2010
|
|
*
|
|
* Authors:
|
|
* Anthony Liguori <aliguori@us.ibm.com>
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2. See
|
|
* the COPYING file in the top-level directory.
|
|
*
|
|
* Contributions after 2012-01-13 are licensed under the terms of the
|
|
* GNU GPL, version 2 or (at your option) any later version.
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "qemu/notify.h"
|
|
|
|
void notifier_list_init(NotifierList *list)
|
|
{
|
|
QLIST_INIT(&list->notifiers);
|
|
}
|
|
|
|
void notifier_list_add(NotifierList *list, Notifier *notifier)
|
|
{
|
|
QLIST_INSERT_HEAD(&list->notifiers, notifier, node);
|
|
}
|
|
|
|
void notifier_remove(Notifier *notifier)
|
|
{
|
|
QLIST_SAFE_REMOVE(notifier, node);
|
|
}
|
|
|
|
void notifier_list_notify(NotifierList *list, void *data)
|
|
{
|
|
Notifier *notifier, *next;
|
|
|
|
QLIST_FOREACH_SAFE(notifier, &list->notifiers, node, next) {
|
|
notifier->notify(notifier, data);
|
|
}
|
|
}
|
|
|
|
bool notifier_list_empty(NotifierList *list)
|
|
{
|
|
return QLIST_EMPTY(&list->notifiers);
|
|
}
|
|
|
|
void notifier_with_return_list_init(NotifierWithReturnList *list)
|
|
{
|
|
QLIST_INIT(&list->notifiers);
|
|
}
|
|
|
|
void notifier_with_return_list_add(NotifierWithReturnList *list,
|
|
NotifierWithReturn *notifier)
|
|
{
|
|
QLIST_INSERT_HEAD(&list->notifiers, notifier, node);
|
|
}
|
|
|
|
void notifier_with_return_remove(NotifierWithReturn *notifier)
|
|
{
|
|
QLIST_REMOVE(notifier, node);
|
|
}
|
|
|
|
int notifier_with_return_list_notify(NotifierWithReturnList *list, void *data,
|
|
Error **errp)
|
|
{
|
|
NotifierWithReturn *notifier, *next;
|
|
int ret = 0;
|
|
|
|
QLIST_FOREACH_SAFE(notifier, &list->notifiers, node, next) {
|
|
ret = notifier->notify(notifier, data, errp);
|
|
if (ret != 0) {
|
|
break;
|
|
}
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
bool notifier_with_return_list_empty(NotifierWithReturnList *list)
|
|
{
|
|
return QLIST_EMPTY(&list->notifiers);
|
|
}
|