]>
git.proxmox.com Git - qemu-server.git/blob - qmeventd/qmeventd.h
1 // SPDX-License-Identifier: AGPL-3.0-or-later
3 Copyright (C) 2018 - 2021 Proxmox Server Solutions GmbH
5 Author: Dominik Csapak <d.csapak@proxmox.com>
6 Author: Stefan Reiter <s.reiter@proxmox.com>
9 #include <sys/syscall.h>
12 #ifndef __NR_pidfd_open
13 #define __NR_pidfd_open 434
15 #ifndef __NR_pidfd_send_signal
16 #define __NR_pidfd_send_signal 424
19 #define VERBOSE_PRINT(...) do { if (verbose) { printf(__VA_ARGS__); fflush(stdout); } } while (0)
21 static inline void log_neg(int errval
, const char *msg
)
28 static inline void bail_neg(int errval
, const char *msg
)
37 pidfd_open(pid_t pid
, unsigned int flags
)
39 return syscall(__NR_pidfd_open
, pid
, flags
);
43 pidfd_send_signal(int pidfd
, int sig
, siginfo_t
*info
, unsigned int flags
)
45 return syscall(__NR_pidfd_send_signal
, pidfd
, sig
, info
, flags
);
57 STATE_EXPECT_STATUS_RESP
,
73 // only relevant for type=CLIENT_QEMU
76 unsigned short graceful
;
78 bool term_check_queued
;
82 // only relevant for type=CLIENT_VZDUMP
84 // vmid of referenced backup
89 void handle_qmp_handshake(struct Client
*client
);
90 void handle_qmp_event(struct Client
*client
, struct json_object
*obj
);
91 void handle_qmp_return(struct Client
*client
, struct json_object
*data
, bool error
);
92 void handle_vzdump_handshake(struct Client
*client
, struct json_object
*data
);
93 void handle_client(struct Client
*client
);
94 void add_new_client(int client_fd
);
95 void cleanup_client(struct Client
*client
);
96 void terminate_client(struct Client
*client
);
97 void terminate_check(struct Client
*client
);