diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-04-14 15:30:42 +0200 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2020-04-15 09:15:53 -0500 |
commit | 5d3586b834633c8ac462d4741b85b4036cbc0f93 (patch) | |
tree | 9531ff31b8ba3bb90f4c2763a951bb7838b8c462 /qga/commands-posix.c | |
parent | f62ebb63848107336e57adc12369aefaa639e38c (diff) | |
download | qemu-5d3586b834633c8ac462d4741b85b4036cbc0f93.zip qemu-5d3586b834633c8ac462d4741b85b4036cbc0f93.tar.gz qemu-5d3586b834633c8ac462d4741b85b4036cbc0f93.tar.bz2 |
qga: Extract guest_file_handle_find() to commands-common.h
As we are going to reuse this method, declare it in common
header.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga/commands-posix.c')
-rw-r--r-- | qga/commands-posix.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c index cc69b82..c59c321 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -26,6 +26,7 @@ #include "qemu/sockets.h" #include "qemu/base64.h" #include "qemu/cutils.h" +#include "commands-common.h" #ifdef HAVE_UTMPX #include <utmpx.h> @@ -237,12 +238,12 @@ typedef enum { RW_STATE_WRITING, } RwState; -typedef struct GuestFileHandle { +struct GuestFileHandle { uint64_t id; FILE *fh; RwState state; QTAILQ_ENTRY(GuestFileHandle) next; -} GuestFileHandle; +}; static struct { QTAILQ_HEAD(, GuestFileHandle) filehandles; @@ -268,7 +269,7 @@ static int64_t guest_file_handle_add(FILE *fh, Error **errp) return handle; } -static GuestFileHandle *guest_file_handle_find(int64_t id, Error **errp) +GuestFileHandle *guest_file_handle_find(int64_t id, Error **errp) { GuestFileHandle *gfh; |