aboutsummaryrefslogtreecommitdiff
path: root/qga
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-05-03 09:13:17 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-05-03 09:13:17 -0700
commit2e3408b3cc7de4e87a9adafc8c19bfce3abec947 (patch)
tree28882508d4c1581c825fa026feca33c2a9119995 /qga
parent5f14cfe187e2fc3c71f4536b2021b8118d224239 (diff)
parentff5927baa7ffb9c97873a071f6a8d85a3584182b (diff)
downloadqemu-2e3408b3cc7de4e87a9adafc8c19bfce3abec947.zip
qemu-2e3408b3cc7de4e87a9adafc8c19bfce3abec947.tar.gz
qemu-2e3408b3cc7de4e87a9adafc8c19bfce3abec947.tar.bz2
Merge tag 'misc-pull-request' of gitlab.com:marcandre.lureau/qemu into staging
Misc cleanups # -----BEGIN PGP SIGNATURE----- # # iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmJxKjQcHG1hcmNhbmRy # ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5ZD5D/9f5CGbNsrl7kB1t6iS # 1ABr5AeW0g9sidMCsQAe9xhWl6+R2SO/z0bBue+mv1ltG0RSZ1ZXS4FyJFBAhFfR # fZ6J7bvdnawIKOxu5T9NY/UvthdRV0eC8CTo0q6GAJo9MHyIGvo1TOoM2Ld9QpfB # 2uup+9fw3Clh0HSHwV9LSL7v2nucFef4A5P1CJ6d1KHnnej0hfug5o+Aiy+wDLA2 # 5RnTm44dqm9lzTgt/x4MqE6Us7WWQukjlLny8/gyurNTR+6fxLqjsHZG+6woQETu # Gg6angsOoAFyciFZ564rjGv80qQuccMVMjtrKvBZz/cmwUUz+Lb4tU3tUPBqomGX # wiofVtL4qcXs94OHWX654UX/iXgkRqC3r+aC0xT37cL4svC8N69BhilxI5+gIGxZ # ZjaQhHx/0e+Ut3c+xrjYHbywQMd9L9AhRyYSMz5BNeLg9+yUiMR+hvGVR/SubLN1 # iiLS07CRgdOKdP6ts7CC7txAgDw4h3cPN5Hz+gqXMJTcnBKpXpnF1lL+Zd/J5++N # 8qMVQH5O4REQRISsbKaOPW8PCiPESsUaHb/mWkre7iYLgkEdNMVQvRcnfx14ejbk # /KKXolrG1huJXGQGnYvgJArHMBBL+ieIYiT6alKFNRNECLdioL46FuSOlirHVCGe # StU22Vsl61M8ifDOPdolK55X5Q== # =npwd # -----END PGP SIGNATURE----- # gpg: Signature made Tue 03 May 2022 06:12:20 AM PDT # gpg: using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5 # gpg: issuer "marcandre.lureau@redhat.com" # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full] # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full] * tag 'misc-pull-request' of gitlab.com:marcandre.lureau/qemu: (23 commits) util: rename qemu_*block() socket functions tests: replace qemu_set_nonblock() net: replace qemu_set_nonblock() ui: replace qemu_set_nonblock() hw: replace qemu_set_nonblock() qga: replace qemu_set_nonblock() io: replace qemu_set{_non}block() chardev: replace qemu_set_nonblock() io: make qio_channel_command_new_pid() static Replace fcntl(O_NONBLOCK) with g_unix_set_fd_nonblocking() io: replace pipe() with g_unix_open_pipe(CLOEXEC) virtiofsd: replace pipe() with g_unix_open_pipe(CLOEXEC) os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC) tests: replace pipe() with g_unix_open_pipe(CLOEXEC) qga: replace pipe() with g_unix_open_pipe(CLOEXEC) util: replace pipe()+cloexec with g_unix_open_pipe() Replace qemu_pipe() with g_unix_open_pipe() block: move fcntl_setfl() Use g_unix_set_fd_nonblocking() libqtest: split QMP part in libqmp ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'qga')
-rw-r--r--qga/channel-posix.c2
-rw-r--r--qga/commands-posix.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index 0373975..a996858 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -34,7 +34,7 @@ static gboolean ga_channel_listen_accept(GIOChannel *channel,
g_warning("error converting fd to gsocket: %s", strerror(errno));
goto out;
}
- qemu_set_nonblock(client_fd);
+ qemu_socket_set_nonblock(client_fd);
ret = ga_channel_client_add(c, client_fd);
if (ret) {
g_warning("error setting up connection");
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 77f4672..78f2f21 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -404,7 +404,11 @@ int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode,
/* set fd non-blocking to avoid common use cases (like reading from a
* named pipe) from hanging the agent
*/
- qemu_set_nonblock(fileno(fh));
+ if (!g_unix_set_fd_nonblocking(fileno(fh), true, NULL)) {
+ fclose(fh);
+ error_setg_errno(errp, errno, "Failed to set FD nonblocking");
+ return -1;
+ }
handle = guest_file_handle_add(fh, errp);
if (handle < 0) {
@@ -2529,7 +2533,7 @@ void qmp_guest_set_user_password(const char *username,
goto out;
}
- if (pipe(datafd) < 0) {
+ if (!g_unix_open_pipe(datafd, FD_CLOEXEC, NULL)) {
error_setg(errp, "cannot create pipe FDs");
goto out;
}