Skip to content

Commit f4f85db

Browse files
committed
as lib
1 parent c834bda commit f4f85db

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

include/system/runstate.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ void qemu_system_shutdown_request(ShutdownCause reason);
9595
void qemu_system_powerdown_request(void);
9696
void qemu_register_powerdown_notifier(Notifier *notifier);
9797
void qemu_register_shutdown_notifier(Notifier *notifier);
98-
void qemu_system_return_request(void);
9998
void qemu_system_debug_request(void);
10099
void qemu_system_vmstop_request(RunState reason);
101100
void qemu_system_vmstop_request_prepare(void);
@@ -109,5 +108,11 @@ void qemu_system_guest_crashloaded(GuestPanicInformation *info);
109108
void qemu_system_guest_pvshutdown(void);
110109
bool qemu_system_dump_in_progress(void);
111110

111+
//// --- Begin LibAFL code ---
112+
#ifdef AS_LIB
113+
void qemu_system_return_request(void);
114+
#endif
115+
//// --- End LibAFL code ---
116+
112117
#endif
113118

system/runstate.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,16 @@ static int qemu_powerdown_requested(void)
503503
return r;
504504
}
505505

506+
//// --- Begin LibAFL code ---
507+
#ifdef AS_LIB
506508
static int qemu_return_requested(void)
507509
{
508510
int r = return_requested;
509511
return_requested = 0;
510512
return r;
511513
}
514+
#endif
515+
//// --- End LibAFL code ---
512516

513517
static int qemu_debug_requested(void)
514518
{
@@ -807,11 +811,15 @@ void qemu_register_shutdown_notifier(Notifier *notifier)
807811
notifier_list_add(&shutdown_notifiers, notifier);
808812
}
809813

814+
//// --- Begin LibAFL code ---
815+
#ifdef AS_LIB
810816
void qemu_system_return_request(void)
811817
{
812818
return_requested = 1;
813819
qemu_notify_event();
814820
}
821+
#endif
822+
//// --- End LibAFL code ---
815823

816824
void qemu_system_debug_request(void)
817825
{

0 commit comments

Comments
 (0)