]>
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>
8 #include <sys/syscall.h>
10 #ifndef __NR_pidfd_open
11 #define __NR_pidfd_open 434
13 #ifndef __NR_pidfd_send_signal
14 #define __NR_pidfd_send_signal 424
17 #define VERBOSE_PRINT(...) do { if (verbose) { printf(__VA_ARGS__); fflush(stdout); } } while (0)
19 static inline void log_neg(int errval
, const char *msg
)
26 static inline void bail_neg(int errval
, const char *msg
)
35 pidfd_open(pid_t pid
, unsigned int flags
)
37 return syscall(__NR_pidfd_open
, pid
, flags
);
41 pidfd_send_signal(int pidfd
, int sig
, siginfo_t
*info
, unsigned int flags
)
43 return syscall(__NR_pidfd_send_signal
, pidfd
, sig
, info
, flags
);
55 STATE_EXPECT_STATUS_RESP
,
69 // only relevant for type=CLIENT_QEMU
72 unsigned short graceful
;
74 bool term_check_queued
;
78 // only relevant for type=CLIENT_VZDUMP
80 // vmid of referenced backup
90 void handle_qmp_handshake(struct Client
*client
);
91 void handle_qmp_event(struct Client
*client
, struct json_object
*obj
);
92 void handle_qmp_return(struct Client
*client
, struct json_object
*data
, bool error
);
93 void handle_vzdump_handshake(struct Client
*client
, struct json_object
*data
);
94 void handle_client(struct Client
*client
);
95 void add_new_client(int client_fd
);
96 void cleanup_client(struct Client
*client
);
97 void terminate_client(struct Client
*client
);
98 void terminate_check(struct Client
*client
);