summaryrefslogtreecommitdiffstats
path: root/qga/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'qga/commands.c')
-rw-r--r--qga/commands.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/qga/commands.c b/qga/commands.c
index 4e9ce25b2e..7ff551d092 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -18,7 +18,6 @@
#include "qapi/qmp/qerror.h"
#include "qemu/base64.h"
#include "qemu/cutils.h"
-#include "qemu/atomic.h"
#include "commands-common.h"
/* Maximum captured guest-exec out_data/err_data - 16MB */
@@ -162,13 +161,12 @@ GuestExecStatus *qmp_guest_exec_status(int64_t pid, Error **errp)
ges = g_new0(GuestExecStatus, 1);
- bool finished = qatomic_mb_read(&gei->finished);
+ bool finished = gei->finished;
/* need to wait till output channels are closed
* to be sure we captured all output at this point */
if (gei->has_output) {
- finished = finished && qatomic_mb_read(&gei->out.closed);
- finished = finished && qatomic_mb_read(&gei->err.closed);
+ finished &= gei->out.closed && gei->err.closed;
}
ges->exited = finished;
@@ -270,7 +268,7 @@ static void guest_exec_child_watch(GPid pid, gint status, gpointer data)
(int32_t)gpid_to_int64(pid), (uint32_t)status);
gei->status = status;
- qatomic_mb_set(&gei->finished, true);
+ gei->finished = true;
g_spawn_close_pid(pid);
}
@@ -326,7 +324,7 @@ static gboolean guest_exec_input_watch(GIOChannel *ch,
done:
g_io_channel_shutdown(ch, true, NULL);
g_io_channel_unref(ch);
- qatomic_mb_set(&p->closed, true);
+ p->closed = true;
g_free(p->data);
return false;
@@ -380,7 +378,7 @@ static gboolean guest_exec_output_watch(GIOChannel *ch,
close:
g_io_channel_shutdown(ch, true, NULL);
g_io_channel_unref(ch);
- qatomic_mb_set(&p->closed, true);
+ p->closed = true;
return false;
}
@@ -511,7 +509,7 @@ int ga_parse_whence(GuestFileWhence *whence, Error **errp)
GuestHostName *qmp_guest_get_host_name(Error **errp)
{
GuestHostName *result = NULL;
- g_autofree char *hostname = qemu_get_host_name(errp);
+ g_autofree char *hostname = qga_get_host_name(errp);
/*
* We want to avoid using g_get_host_name() because that