diff --git a/libguestfs-inspect.h b/libguestfs-inspect.h index c48ff7e..7f8c02a 100644 --- a/libguestfs-inspect.h +++ b/libguestfs-inspect.h @@ -1,3 +1,5 @@ +#include + enum guestfs_inspect_command_const { GUESTFS_COMMAND_LS, /* GUESTFS_COMMAND_TOUCH, */ @@ -6,6 +8,7 @@ enum guestfs_inspect_command_const { }; struct guestfs_ls_args { + size_t paths_length; char **paths; }; struct guestfs_cat_args {}; @@ -27,3 +30,22 @@ static char *endpoint() { return res; } +static zmsg_t *command_to_zmsg(struct guestfs_inpsect_command *command) { + zmsg_t *res = zmsg_new(); + + zmsg_pushstr(res, command->name); + zmsg_pushmem(res, &(command->command), sizeof(command->command)); + + switch (command->command) { + case GUESTFS_COMMAND_LS: + zmsg_pushmem(res, &(command->args.ls.paths_length), sizeof(command->args.ls.paths_length)); + + for (size_t i = 0; i < (command->args.ls.paths_length); i++) { + zmsg_pushstr(res, command->args.ls.paths[i]); + } + break; + } + + return res; +} +