#include "qemu/osdep.h"
+#include "qemu/cutils.h"
#include <termios.h>
#include "qapi/error.h"
#include "qemu/sockets.h"
#include "channel.h"
+#include "cutils.h"
#ifdef CONFIG_SOLARIS
#include <stropts.h>
switch (c->method) {
case GA_CHANNEL_VIRTIO_SERIAL: {
assert(fd < 0);
- fd = qemu_open_old(path, O_RDWR | O_NONBLOCK
+ fd = qga_open_cloexec(
+ path,
#ifndef CONFIG_SOLARIS
- | O_ASYNC
+ O_ASYNC |
#endif
- );
+ O_RDWR | O_NONBLOCK,
+ 0
+ );
if (fd == -1) {
error_setg_errno(errp, errno, "error opening channel");
return false;
struct termios tio;
assert(fd < 0);
- fd = qemu_open_old(path, O_RDWR | O_NOCTTY | O_NONBLOCK);
+ fd = qga_open_cloexec(path, O_RDWR | O_NOCTTY | O_NONBLOCK, 0);
if (fd == -1) {
error_setg_errno(errp, errno, "error opening channel");
return false;
| (((sizeof(log) >> 2) - 1) << 16)
};
- fd = qemu_open_old(disk->name, O_RDONLY);
+ fd = qga_open_cloexec(disk->name, O_RDONLY, 0);
if (fd == -1) {
g_debug("Failed to open device: %s: %s", disk->name, g_strerror(errno));
return;
}
}
- fd = qemu_open_old(mount->dirname, O_RDONLY);
+ fd = qga_open_cloexec(mount->dirname, O_RDONLY, 0);
if (fd == -1) {
error_setg_errno(errp, errno, "failed to open %s", mount->dirname);
goto error;
QTAILQ_FOREACH(mount, &mounts, next) {
logged = false;
- fd = qemu_open_old(mount->dirname, O_RDONLY);
+ fd = qga_open_cloexec(mount->dirname, O_RDONLY, 0);
if (fd == -1) {
continue;
}
QAPI_LIST_PREPEND(response->paths, result);
- fd = qemu_open_old(mount->dirname, O_RDONLY);
+ fd = qga_open_cloexec(mount->dirname, O_RDONLY, 0);
if (fd == -1) {
result->error = g_strdup_printf("failed to open: %s",
strerror(errno));