]>
git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/tools/lxc_unfreeze.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
13 #include "arguments.h"
16 lxc_log_define(lxc_unfreeze
, lxc
);
18 static const struct option my_longopts
[] = {
22 static struct lxc_arguments my_args
= {
23 .progname
= "lxc-unfreeze",
27 lxc-unfreeze unfreezes a container with the identifier NAME\n\
30 -n, --name=NAME NAME of the container\n\
31 --rcfile=FILE Load configuration file FILE\n",
32 .options
= my_longopts
,
35 .log_priority
= "ERROR",
39 int main(int argc
, char *argv
[])
41 struct lxc_container
*c
;
44 if (lxc_arguments_parse(&my_args
, argc
, argv
))
47 log
.name
= my_args
.name
;
48 log
.file
= my_args
.log_file
;
49 log
.level
= my_args
.log_priority
;
50 log
.prefix
= my_args
.progname
;
51 log
.quiet
= my_args
.quiet
;
52 log
.lxcpath
= my_args
.lxcpath
[0];
54 if (lxc_log_init(&log
))
57 c
= lxc_container_new(my_args
.name
, my_args
.lxcpath
[0]);
59 ERROR("No such container: %s:%s", my_args
.lxcpath
[0], my_args
.name
);
63 if (!c
->may_control(c
)) {
64 ERROR("Insufficent privileges to control %s:%s", my_args
.lxcpath
[0], my_args
.name
);
72 if (!c
->load_config(c
, my_args
.rcfile
)) {
73 ERROR("Failed to load rcfile");
78 c
->configfile
= strdup(my_args
.rcfile
);
80 ERROR("Out of memory setting new config filename");
86 if (!c
->unfreeze(c
)) {
87 ERROR("Failed to unfreeze %s:%s", my_args
.lxcpath
[0], my_args
.name
);