2 * QEMU Guest Agent POSIX-specific command implementations
4 * Copyright IBM Corp. 2011
7 * Michael Roth <mdroth@linux.vnet.ibm.com>
8 * Michal Privoznik <mprivozn@redhat.com>
10 * This work is licensed under the terms of the GNU GPL, version 2 or later.
11 * See the COPYING file in the top-level directory.
15 #include <sys/types.h>
16 #include <sys/ioctl.h>
18 #include "qga/guest-agent-core.h"
19 #include "qga-qmp-commands.h"
20 #include "qapi/qmp/qerror.h"
21 #include "qemu/queue.h"
22 #include "qemu/host-utils.h"
24 #ifndef CONFIG_HAS_ENVIRON
26 #include <crt_externs.h>
27 #define environ (*_NSGetEnviron())
29 extern char **environ
;
33 #if defined(__linux__)
37 #include <arpa/inet.h>
38 #include <sys/socket.h>
42 #define CONFIG_FSFREEZE
49 static void ga_wait_child(pid_t pid
, int *status
, Error
**err
)
56 rpid
= waitpid(pid
, status
, 0);
57 } while (rpid
== -1 && errno
== EINTR
);
60 error_setg_errno(err
, errno
, "failed to wait for child (pid: %d)", pid
);
64 g_assert(rpid
== pid
);
67 void qmp_guest_shutdown(bool has_mode
, const char *mode
, Error
**err
)
69 const char *shutdown_flag
;
70 Error
*local_err
= NULL
;
74 slog("guest-shutdown called, mode: %s", mode
);
75 if (!has_mode
|| strcmp(mode
, "powerdown") == 0) {
77 } else if (strcmp(mode
, "halt") == 0) {
79 } else if (strcmp(mode
, "reboot") == 0) {
83 "mode is invalid (valid values are: halt|powerdown|reboot");
89 /* child, start the shutdown */
95 execle("/sbin/shutdown", "shutdown", shutdown_flag
, "+0",
96 "hypervisor initiated shutdown", (char*)NULL
, environ
);
99 error_setg_errno(err
, errno
, "failed to create child process");
103 ga_wait_child(pid
, &status
, &local_err
);
104 if (error_is_set(&local_err
)) {
105 error_propagate(err
, local_err
);
109 if (!WIFEXITED(status
)) {
110 error_setg(err
, "child process has terminated abnormally");
114 if (WEXITSTATUS(status
)) {
115 error_setg(err
, "child process has failed to shutdown");
122 typedef struct GuestFileHandle
{
125 QTAILQ_ENTRY(GuestFileHandle
) next
;
129 QTAILQ_HEAD(, GuestFileHandle
) filehandles
;
132 static void guest_file_handle_add(FILE *fh
)
134 GuestFileHandle
*gfh
;
136 gfh
= g_malloc0(sizeof(GuestFileHandle
));
137 gfh
->id
= fileno(fh
);
139 QTAILQ_INSERT_TAIL(&guest_file_state
.filehandles
, gfh
, next
);
142 static GuestFileHandle
*guest_file_handle_find(int64_t id
, Error
**err
)
144 GuestFileHandle
*gfh
;
146 QTAILQ_FOREACH(gfh
, &guest_file_state
.filehandles
, next
)
153 error_setg(err
, "handle '%" PRId64
"' has not been found", id
);
157 int64_t qmp_guest_file_open(const char *path
, bool has_mode
, const char *mode
, Error
**err
)
166 slog("guest-file-open called, filepath: %s, mode: %s", path
, mode
);
167 fh
= fopen(path
, mode
);
169 error_setg_errno(err
, errno
, "failed to open file '%s' (mode: '%s')",
174 /* set fd non-blocking to avoid common use cases (like reading from a
175 * named pipe) from hanging the agent
178 ret
= fcntl(fd
, F_GETFL
);
179 ret
= fcntl(fd
, F_SETFL
, ret
| O_NONBLOCK
);
181 error_setg_errno(err
, errno
, "failed to make file '%s' non-blocking",
187 guest_file_handle_add(fh
);
188 slog("guest-file-open, handle: %d", fd
);
192 void qmp_guest_file_close(int64_t handle
, Error
**err
)
194 GuestFileHandle
*gfh
= guest_file_handle_find(handle
, err
);
197 slog("guest-file-close called, handle: %ld", handle
);
202 ret
= fclose(gfh
->fh
);
204 error_setg_errno(err
, errno
, "failed to close handle");
208 QTAILQ_REMOVE(&guest_file_state
.filehandles
, gfh
, next
);
212 struct GuestFileRead
*qmp_guest_file_read(int64_t handle
, bool has_count
,
213 int64_t count
, Error
**err
)
215 GuestFileHandle
*gfh
= guest_file_handle_find(handle
, err
);
216 GuestFileRead
*read_data
= NULL
;
226 count
= QGA_READ_COUNT_DEFAULT
;
227 } else if (count
< 0) {
228 error_setg(err
, "value '%" PRId64
"' is invalid for argument count",
234 buf
= g_malloc0(count
+1);
235 read_count
= fread(buf
, 1, count
, fh
);
237 error_setg_errno(err
, errno
, "failed to read file");
238 slog("guest-file-read failed, handle: %ld", handle
);
241 read_data
= g_malloc0(sizeof(GuestFileRead
));
242 read_data
->count
= read_count
;
243 read_data
->eof
= feof(fh
);
245 read_data
->buf_b64
= g_base64_encode(buf
, read_count
);
254 GuestFileWrite
*qmp_guest_file_write(int64_t handle
, const char *buf_b64
,
255 bool has_count
, int64_t count
, Error
**err
)
257 GuestFileWrite
*write_data
= NULL
;
261 GuestFileHandle
*gfh
= guest_file_handle_find(handle
, err
);
269 buf
= g_base64_decode(buf_b64
, &buf_len
);
273 } else if (count
< 0 || count
> buf_len
) {
274 error_setg(err
, "value '%" PRId64
"' is invalid for argument count",
280 write_count
= fwrite(buf
, 1, count
, fh
);
282 error_setg_errno(err
, errno
, "failed to write to file");
283 slog("guest-file-write failed, handle: %ld", handle
);
285 write_data
= g_malloc0(sizeof(GuestFileWrite
));
286 write_data
->count
= write_count
;
287 write_data
->eof
= feof(fh
);
295 struct GuestFileSeek
*qmp_guest_file_seek(int64_t handle
, int64_t offset
,
296 int64_t whence
, Error
**err
)
298 GuestFileHandle
*gfh
= guest_file_handle_find(handle
, err
);
299 GuestFileSeek
*seek_data
= NULL
;
308 ret
= fseek(fh
, offset
, whence
);
310 error_setg_errno(err
, errno
, "failed to seek file");
312 seek_data
= g_malloc0(sizeof(GuestFileRead
));
313 seek_data
->position
= ftell(fh
);
314 seek_data
->eof
= feof(fh
);
321 void qmp_guest_file_flush(int64_t handle
, Error
**err
)
323 GuestFileHandle
*gfh
= guest_file_handle_find(handle
, err
);
334 error_setg_errno(err
, errno
, "failed to flush file");
338 static void guest_file_init(void)
340 QTAILQ_INIT(&guest_file_state
.filehandles
);
343 /* linux-specific implementations. avoid this if at all possible. */
344 #if defined(__linux__)
346 #if defined(CONFIG_FSFREEZE) || defined(CONFIG_FSTRIM)
347 typedef struct FsMount
{
350 QTAILQ_ENTRY(FsMount
) next
;
353 typedef QTAILQ_HEAD(, FsMount
) FsMountList
;
355 static void free_fs_mount_list(FsMountList
*mounts
)
357 FsMount
*mount
, *temp
;
363 QTAILQ_FOREACH_SAFE(mount
, mounts
, next
, temp
) {
364 QTAILQ_REMOVE(mounts
, mount
, next
);
365 g_free(mount
->dirname
);
366 g_free(mount
->devtype
);
372 * Walk the mount table and build a list of local file systems
374 static void build_fs_mount_list(FsMountList
*mounts
, Error
**err
)
378 char const *mtab
= "/proc/self/mounts";
381 fp
= setmntent(mtab
, "r");
383 error_setg(err
, "failed to open mtab file: '%s'", mtab
);
387 while ((ment
= getmntent(fp
))) {
389 * An entry which device name doesn't start with a '/' is
390 * either a dummy file system or a network file system.
391 * Add special handling for smbfs and cifs as is done by
394 if ((ment
->mnt_fsname
[0] != '/') ||
395 (strcmp(ment
->mnt_type
, "smbfs") == 0) ||
396 (strcmp(ment
->mnt_type
, "cifs") == 0)) {
400 mount
= g_malloc0(sizeof(FsMount
));
401 mount
->dirname
= g_strdup(ment
->mnt_dir
);
402 mount
->devtype
= g_strdup(ment
->mnt_type
);
404 QTAILQ_INSERT_TAIL(mounts
, mount
, next
);
411 #if defined(CONFIG_FSFREEZE)
414 * Return status of freeze/thaw
416 GuestFsfreezeStatus
qmp_guest_fsfreeze_status(Error
**err
)
418 if (ga_is_frozen(ga_state
)) {
419 return GUEST_FSFREEZE_STATUS_FROZEN
;
422 return GUEST_FSFREEZE_STATUS_THAWED
;
426 * Walk list of mounted file systems in the guest, and freeze the ones which
427 * are real local file systems.
429 int64_t qmp_guest_fsfreeze_freeze(Error
**err
)
433 struct FsMount
*mount
;
434 Error
*local_err
= NULL
;
437 slog("guest-fsfreeze called");
439 QTAILQ_INIT(&mounts
);
440 build_fs_mount_list(&mounts
, &local_err
);
441 if (error_is_set(&local_err
)) {
442 error_propagate(err
, local_err
);
446 /* cannot risk guest agent blocking itself on a write in this state */
447 ga_set_frozen(ga_state
);
449 QTAILQ_FOREACH(mount
, &mounts
, next
) {
450 fd
= qemu_open(mount
->dirname
, O_RDONLY
);
452 error_setg_errno(err
, errno
, "failed to open %s", mount
->dirname
);
456 /* we try to cull filesytems we know won't work in advance, but other
457 * filesytems may not implement fsfreeze for less obvious reasons.
458 * these will report EOPNOTSUPP. we simply ignore these when tallying
459 * the number of frozen filesystems.
461 * any other error means a failure to freeze a filesystem we
462 * expect to be freezable, so return an error in those cases
463 * and return system to thawed state.
465 ret
= ioctl(fd
, FIFREEZE
);
467 if (errno
!= EOPNOTSUPP
) {
468 error_setg_errno(err
, errno
, "failed to freeze %s",
479 free_fs_mount_list(&mounts
);
483 free_fs_mount_list(&mounts
);
484 qmp_guest_fsfreeze_thaw(NULL
);
489 * Walk list of frozen file systems in the guest, and thaw them.
491 int64_t qmp_guest_fsfreeze_thaw(Error
**err
)
496 int fd
, i
= 0, logged
;
497 Error
*local_err
= NULL
;
499 QTAILQ_INIT(&mounts
);
500 build_fs_mount_list(&mounts
, &local_err
);
501 if (error_is_set(&local_err
)) {
502 error_propagate(err
, local_err
);
506 QTAILQ_FOREACH(mount
, &mounts
, next
) {
508 fd
= qemu_open(mount
->dirname
, O_RDONLY
);
512 /* we have no way of knowing whether a filesystem was actually unfrozen
513 * as a result of a successful call to FITHAW, only that if an error
514 * was returned the filesystem was *not* unfrozen by that particular
517 * since multiple preceding FIFREEZEs require multiple calls to FITHAW
518 * to unfreeze, continuing issuing FITHAW until an error is returned,
519 * in which case either the filesystem is in an unfreezable state, or,
520 * more likely, it was thawed previously (and remains so afterward).
522 * also, since the most recent successful call is the one that did
523 * the actual unfreeze, we can use this to provide an accurate count
524 * of the number of filesystems unfrozen by guest-fsfreeze-thaw, which
525 * may * be useful for determining whether a filesystem was unfrozen
526 * during the freeze/thaw phase by a process other than qemu-ga.
529 ret
= ioctl(fd
, FITHAW
);
530 if (ret
== 0 && !logged
) {
538 ga_unset_frozen(ga_state
);
539 free_fs_mount_list(&mounts
);
543 static void guest_fsfreeze_cleanup(void)
548 if (ga_is_frozen(ga_state
) == GUEST_FSFREEZE_STATUS_FROZEN
) {
549 ret
= qmp_guest_fsfreeze_thaw(&err
);
550 if (ret
< 0 || err
) {
551 slog("failed to clean up frozen filesystems");
555 #endif /* CONFIG_FSFREEZE */
557 #if defined(CONFIG_FSTRIM)
559 * Walk list of mounted file systems in the guest, and trim them.
561 void qmp_guest_fstrim(bool has_minimum
, int64_t minimum
, Error
**err
)
565 struct FsMount
*mount
;
567 Error
*local_err
= NULL
;
568 struct fstrim_range r
= {
571 .minlen
= has_minimum
? minimum
: 0,
574 slog("guest-fstrim called");
576 QTAILQ_INIT(&mounts
);
577 build_fs_mount_list(&mounts
, &local_err
);
578 if (error_is_set(&local_err
)) {
579 error_propagate(err
, local_err
);
583 QTAILQ_FOREACH(mount
, &mounts
, next
) {
584 fd
= qemu_open(mount
->dirname
, O_RDONLY
);
586 error_setg_errno(err
, errno
, "failed to open %s", mount
->dirname
);
590 /* We try to cull filesytems we know won't work in advance, but other
591 * filesytems may not implement fstrim for less obvious reasons. These
592 * will report EOPNOTSUPP; we simply ignore these errors. Any other
593 * error means an unexpected error, so return it in those cases. In
594 * some other cases ENOTTY will be reported (e.g. CD-ROMs).
596 ret
= ioctl(fd
, FITRIM
, &r
);
598 if (errno
!= ENOTTY
&& errno
!= EOPNOTSUPP
) {
599 error_setg_errno(err
, errno
, "failed to trim %s",
609 free_fs_mount_list(&mounts
);
611 #endif /* CONFIG_FSTRIM */
614 #define LINUX_SYS_STATE_FILE "/sys/power/state"
615 #define SUSPEND_SUPPORTED 0
616 #define SUSPEND_NOT_SUPPORTED 1
618 static void bios_supports_mode(const char *pmutils_bin
, const char *pmutils_arg
,
619 const char *sysfile_str
, Error
**err
)
621 Error
*local_err
= NULL
;
626 pmutils_path
= g_find_program_in_path(pmutils_bin
);
630 char buf
[32]; /* hopefully big enough */
635 reopen_fd_to_null(0);
636 reopen_fd_to_null(1);
637 reopen_fd_to_null(2);
640 execle(pmutils_path
, pmutils_bin
, pmutils_arg
, NULL
, environ
);
644 * If we get here either pm-utils is not installed or execle() has
645 * failed. Let's try the manual method if the caller wants it.
649 _exit(SUSPEND_NOT_SUPPORTED
);
652 fd
= open(LINUX_SYS_STATE_FILE
, O_RDONLY
);
654 _exit(SUSPEND_NOT_SUPPORTED
);
657 ret
= read(fd
, buf
, sizeof(buf
)-1);
659 _exit(SUSPEND_NOT_SUPPORTED
);
663 if (strstr(buf
, sysfile_str
)) {
664 _exit(SUSPEND_SUPPORTED
);
667 _exit(SUSPEND_NOT_SUPPORTED
);
668 } else if (pid
< 0) {
669 error_setg_errno(err
, errno
, "failed to create child process");
673 ga_wait_child(pid
, &status
, &local_err
);
674 if (error_is_set(&local_err
)) {
675 error_propagate(err
, local_err
);
679 if (!WIFEXITED(status
)) {
680 error_setg(err
, "child process has terminated abnormally");
684 switch (WEXITSTATUS(status
)) {
685 case SUSPEND_SUPPORTED
:
687 case SUSPEND_NOT_SUPPORTED
:
689 "the requested suspend mode is not supported by the guest");
693 "the helper program '%s' returned an unexpected exit status"
694 " code (%d)", pmutils_path
, WEXITSTATUS(status
));
699 g_free(pmutils_path
);
702 static void guest_suspend(const char *pmutils_bin
, const char *sysfile_str
,
709 pmutils_path
= g_find_program_in_path(pmutils_bin
);
717 reopen_fd_to_null(0);
718 reopen_fd_to_null(1);
719 reopen_fd_to_null(2);
722 execle(pmutils_path
, pmutils_bin
, NULL
, environ
);
726 * If we get here either pm-utils is not installed or execle() has
727 * failed. Let's try the manual method if the caller wants it.
734 fd
= open(LINUX_SYS_STATE_FILE
, O_WRONLY
);
739 if (write(fd
, sysfile_str
, strlen(sysfile_str
)) < 0) {
746 g_free(pmutils_path
);
753 rpid
= waitpid(pid
, &status
, 0);
754 } while (rpid
== -1 && errno
== EINTR
);
755 if (rpid
== pid
&& WIFEXITED(status
) && !WEXITSTATUS(status
)) {
760 error_set(err
, QERR_UNDEFINED_ERROR
);
763 void qmp_guest_suspend_disk(Error
**err
)
765 bios_supports_mode("pm-is-supported", "--hibernate", "disk", err
);
766 if (error_is_set(err
)) {
770 guest_suspend("pm-hibernate", "disk", err
);
773 void qmp_guest_suspend_ram(Error
**err
)
775 bios_supports_mode("pm-is-supported", "--suspend", "mem", err
);
776 if (error_is_set(err
)) {
780 guest_suspend("pm-suspend", "mem", err
);
783 void qmp_guest_suspend_hybrid(Error
**err
)
785 bios_supports_mode("pm-is-supported", "--suspend-hybrid", NULL
, err
);
786 if (error_is_set(err
)) {
790 guest_suspend("pm-suspend-hybrid", NULL
, err
);
793 static GuestNetworkInterfaceList
*
794 guest_find_interface(GuestNetworkInterfaceList
*head
,
797 for (; head
; head
= head
->next
) {
798 if (strcmp(head
->value
->name
, name
) == 0) {
807 * Build information about guest interfaces
809 GuestNetworkInterfaceList
*qmp_guest_network_get_interfaces(Error
**errp
)
811 GuestNetworkInterfaceList
*head
= NULL
, *cur_item
= NULL
;
812 struct ifaddrs
*ifap
, *ifa
;
814 if (getifaddrs(&ifap
) < 0) {
815 error_setg_errno(errp
, errno
, "getifaddrs failed");
819 for (ifa
= ifap
; ifa
; ifa
= ifa
->ifa_next
) {
820 GuestNetworkInterfaceList
*info
;
821 GuestIpAddressList
**address_list
= NULL
, *address_item
= NULL
;
822 char addr4
[INET_ADDRSTRLEN
];
823 char addr6
[INET6_ADDRSTRLEN
];
826 unsigned char *mac_addr
;
829 g_debug("Processing %s interface", ifa
->ifa_name
);
831 info
= guest_find_interface(head
, ifa
->ifa_name
);
834 info
= g_malloc0(sizeof(*info
));
835 info
->value
= g_malloc0(sizeof(*info
->value
));
836 info
->value
->name
= g_strdup(ifa
->ifa_name
);
839 head
= cur_item
= info
;
841 cur_item
->next
= info
;
846 if (!info
->value
->has_hardware_address
&&
847 ifa
->ifa_flags
& SIOCGIFHWADDR
) {
848 /* we haven't obtained HW address yet */
849 sock
= socket(PF_INET
, SOCK_STREAM
, 0);
851 error_setg_errno(errp
, errno
, "failed to create socket");
855 memset(&ifr
, 0, sizeof(ifr
));
856 pstrcpy(ifr
.ifr_name
, IF_NAMESIZE
, info
->value
->name
);
857 if (ioctl(sock
, SIOCGIFHWADDR
, &ifr
) == -1) {
858 error_setg_errno(errp
, errno
,
859 "failed to get MAC address of %s",
864 mac_addr
= (unsigned char *) &ifr
.ifr_hwaddr
.sa_data
;
866 if (asprintf(&info
->value
->hardware_address
,
867 "%02x:%02x:%02x:%02x:%02x:%02x",
868 (int) mac_addr
[0], (int) mac_addr
[1],
869 (int) mac_addr
[2], (int) mac_addr
[3],
870 (int) mac_addr
[4], (int) mac_addr
[5]) == -1) {
871 error_setg_errno(errp
, errno
, "failed to format MAC");
875 info
->value
->has_hardware_address
= true;
880 ifa
->ifa_addr
->sa_family
== AF_INET
) {
881 /* interface with IPv4 address */
882 address_item
= g_malloc0(sizeof(*address_item
));
883 address_item
->value
= g_malloc0(sizeof(*address_item
->value
));
884 p
= &((struct sockaddr_in
*)ifa
->ifa_addr
)->sin_addr
;
885 if (!inet_ntop(AF_INET
, p
, addr4
, sizeof(addr4
))) {
886 error_setg_errno(errp
, errno
, "inet_ntop failed");
890 address_item
->value
->ip_address
= g_strdup(addr4
);
891 address_item
->value
->ip_address_type
= GUEST_IP_ADDRESS_TYPE_IPV4
;
893 if (ifa
->ifa_netmask
) {
894 /* Count the number of set bits in netmask.
895 * This is safe as '1' and '0' cannot be shuffled in netmask. */
896 p
= &((struct sockaddr_in
*)ifa
->ifa_netmask
)->sin_addr
;
897 address_item
->value
->prefix
= ctpop32(((uint32_t *) p
)[0]);
899 } else if (ifa
->ifa_addr
&&
900 ifa
->ifa_addr
->sa_family
== AF_INET6
) {
901 /* interface with IPv6 address */
902 address_item
= g_malloc0(sizeof(*address_item
));
903 address_item
->value
= g_malloc0(sizeof(*address_item
->value
));
904 p
= &((struct sockaddr_in6
*)ifa
->ifa_addr
)->sin6_addr
;
905 if (!inet_ntop(AF_INET6
, p
, addr6
, sizeof(addr6
))) {
906 error_setg_errno(errp
, errno
, "inet_ntop failed");
910 address_item
->value
->ip_address
= g_strdup(addr6
);
911 address_item
->value
->ip_address_type
= GUEST_IP_ADDRESS_TYPE_IPV6
;
913 if (ifa
->ifa_netmask
) {
914 /* Count the number of set bits in netmask.
915 * This is safe as '1' and '0' cannot be shuffled in netmask. */
916 p
= &((struct sockaddr_in6
*)ifa
->ifa_netmask
)->sin6_addr
;
917 address_item
->value
->prefix
=
918 ctpop32(((uint32_t *) p
)[0]) +
919 ctpop32(((uint32_t *) p
)[1]) +
920 ctpop32(((uint32_t *) p
)[2]) +
921 ctpop32(((uint32_t *) p
)[3]);
929 address_list
= &info
->value
->ip_addresses
;
931 while (*address_list
&& (*address_list
)->next
) {
932 address_list
= &(*address_list
)->next
;
935 if (!*address_list
) {
936 *address_list
= address_item
;
938 (*address_list
)->next
= address_item
;
941 info
->value
->has_ip_addresses
= true;
951 qapi_free_GuestNetworkInterfaceList(head
);
955 #else /* defined(__linux__) */
957 void qmp_guest_suspend_disk(Error
**err
)
959 error_set(err
, QERR_UNSUPPORTED
);
962 void qmp_guest_suspend_ram(Error
**err
)
964 error_set(err
, QERR_UNSUPPORTED
);
967 void qmp_guest_suspend_hybrid(Error
**err
)
969 error_set(err
, QERR_UNSUPPORTED
);
972 GuestNetworkInterfaceList
*qmp_guest_network_get_interfaces(Error
**errp
)
974 error_set(errp
, QERR_UNSUPPORTED
);
980 #if !defined(CONFIG_FSFREEZE)
982 GuestFsfreezeStatus
qmp_guest_fsfreeze_status(Error
**err
)
984 error_set(err
, QERR_UNSUPPORTED
);
989 int64_t qmp_guest_fsfreeze_freeze(Error
**err
)
991 error_set(err
, QERR_UNSUPPORTED
);
996 int64_t qmp_guest_fsfreeze_thaw(Error
**err
)
998 error_set(err
, QERR_UNSUPPORTED
);
1002 #endif /* CONFIG_FSFREEZE */
1004 #if !defined(CONFIG_FSTRIM)
1005 void qmp_guest_fstrim(bool has_minimum
, int64_t minimum
, Error
**err
)
1007 error_set(err
, QERR_UNSUPPORTED
);
1011 /* register init/cleanup routines for stateful command groups */
1012 void ga_command_state_init(GAState
*s
, GACommandState
*cs
)
1014 #if defined(CONFIG_FSFREEZE)
1015 ga_command_state_add(cs
, NULL
, guest_fsfreeze_cleanup
);
1017 ga_command_state_add(cs
, guest_file_init
, NULL
);