commands-common.h (28298069afff3eb696e4995e63b2579b27adf378) | commands-common.h (518b0d800b5ab046b72fac423ace7549ab187329) |
---|---|
1/* 2 * QEMU Guest Agent common/cross-platform common commands 3 * 4 * Copyright (c) 2020 Red Hat, Inc. 5 * 6 * This work is licensed under the terms of the GNU GPL, version 2 or later. 7 * See the COPYING file in the top-level directory. 8 */ 9#ifndef QGA_COMMANDS_COMMON_H 10#define QGA_COMMANDS_COMMON_H 11 12#include "qga-qapi-types.h" | 1/* 2 * QEMU Guest Agent common/cross-platform common commands 3 * 4 * Copyright (c) 2020 Red Hat, Inc. 5 * 6 * This work is licensed under the terms of the GNU GPL, version 2 or later. 7 * See the COPYING file in the top-level directory. 8 */ 9#ifndef QGA_COMMANDS_COMMON_H 10#define QGA_COMMANDS_COMMON_H 11 12#include "qga-qapi-types.h" |
13#include "guest-agent-core.h" 14#include "qemu/queue.h" |
|
13 | 15 |
16#if defined(__linux__) 17#include <linux/fs.h> 18#ifdef FIFREEZE 19#define CONFIG_FSFREEZE 20#endif 21#ifdef FITRIM 22#define CONFIG_FSTRIM 23#endif 24#endif /* __linux__ */ 25 26#if defined(CONFIG_FSFREEZE) || defined(CONFIG_FSTRIM) 27typedef struct FsMount { 28 char *dirname; 29 char *devtype; 30 unsigned int devmajor, devminor; 31 QTAILQ_ENTRY(FsMount) next; 32} FsMount; 33 34typedef QTAILQ_HEAD(FsMountList, FsMount) FsMountList; 35 36bool build_fs_mount_list(FsMountList *mounts, Error **errp); 37void free_fs_mount_list(FsMountList *mounts); 38#endif /* CONFIG_FSFREEZE || CONFIG_FSTRIM */ 39 40#if defined(CONFIG_FSFREEZE) 41int64_t qmp_guest_fsfreeze_do_freeze_list(bool has_mountpoints, 42 strList *mountpoints, 43 FsMountList mounts, 44 Error **errp); 45int qmp_guest_fsfreeze_do_thaw(Error **errp); 46#endif /* CONFIG_FSFREEZE */ 47 |
|
14typedef struct GuestFileHandle GuestFileHandle; 15 16GuestFileHandle *guest_file_handle_find(int64_t id, Error **errp); 17 18GuestFileRead *guest_file_read_unsafe(GuestFileHandle *gfh, 19 int64_t count, Error **errp); 20 21/** 22 * qga_get_host_name: 23 * @errp: Error object 24 * 25 * Operating system agnostic way of querying host name. 26 * Compared to g_get_host_name(), it doesn't cache the result. 27 * 28 * Returns allocated hostname (caller should free), NULL on failure. 29 */ 30char *qga_get_host_name(Error **errp); 31 32#endif | 48typedef struct GuestFileHandle GuestFileHandle; 49 50GuestFileHandle *guest_file_handle_find(int64_t id, Error **errp); 51 52GuestFileRead *guest_file_read_unsafe(GuestFileHandle *gfh, 53 int64_t count, Error **errp); 54 55/** 56 * qga_get_host_name: 57 * @errp: Error object 58 * 59 * Operating system agnostic way of querying host name. 60 * Compared to g_get_host_name(), it doesn't cache the result. 61 * 62 * Returns allocated hostname (caller should free), NULL on failure. 63 */ 64char *qga_get_host_name(Error **errp); 65 66#endif |