tests: add helper for DEVICE_DELETED events

Add qemuMonitorTestEmitDeviceDeleted() so monitor tests can emit a
DEVICE_DELETED event after the command reply has already been consumed.

The helper uses the monitor callback path directly and avoids adding
event JSON to command/reply fixtures.

Signed-off-by: Akash Kulhalli <akash.kulhalli@oracle.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Akash Kulhalli authored and Peter Krempa committed 2026-06-22 16:46:18 +02:00
1 parent f4e362487b
commit 750ee6248b
2 files changed
+12

No files matched your search

+9
View File
@@ -1240,3 +1240,12 @@ qemuMonitorTestGetDomainObj(qemuMonitorTest *test)
{
return test->vm;
}
void
qemuMonitorTestEmitDeviceDeleted(qemuMonitorTest *test,
const char *alias)
{
virObjectLock(test->mon);
qemuMonitorEmitDeviceDeleted(test->mon, alias);
virObjectUnlock(test->mon);
}
+3
View File
@@ -109,5 +109,8 @@ qemuAgent *
qemuMonitorTestGetAgent(qemuMonitorTest *test);
virDomainObj *
qemuMonitorTestGetDomainObj(qemuMonitorTest *test);
void
qemuMonitorTestEmitDeviceDeleted(qemuMonitorTest *test,
const char *alias);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorTest, qemuMonitorTestFree);