qemu: Validate watchdog action compatibility per-device

This makes it also work during attach.  Also add a test for attaching a
watchdog with incompatible action.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2187278
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Martin Kletzander
2023-04-19 14:07:26 +02:00
parent d56ddd0d19
commit 865b071ae8
4 changed files with 17 additions and 10 deletions

View File

@@ -908,6 +908,9 @@ mymain(void)
DO_TEST_DETACH("x86_64", "base-live", "watchdog-user-alias-full", false, false,
"device_del", QMP_DEVICE_DELETED("ua-UserWatchdog") QMP_OK);
/* attaching a watchdog with different action should fail */
DO_TEST_ATTACH("x86_64", "base-live+watchdog", "watchdog-reset", true, false, NULL);
DO_TEST_ATTACH("x86_64", "base-live", "guestfwd", false, true,
"getfd", QMP_OK,
"chardev-add", QMP_OK,