[lxc-devel] [lxc/lxc] 5d5da4: Refactor lxc-snapshot

GitHub noreply at github.com
Fri Aug 14 00:36:17 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 5d5da49be4dc5603c56042bf6f4393151e27c321
      https://github.com/lxc/lxc/commit/5d5da49be4dc5603c56042bf6f4393151e27c321
  Author: Christian Brauner <christianvanbrauner at gmail.com>
  Date:   2015-08-07 (Fri, 07 Aug 2015)

  Changed paths:
    M src/lxc/arguments.h
    M src/lxc/lxc_snapshot.c

  Log Message:
  -----------
  Refactor lxc-snapshot

- lxc_snapshot.c lacked necessary members in the associated lxc_arguments struct
  in arguments.h. This commit extends the lxc_arguments struct to include
  several parameters used by lxc-snapshot which allows a rewrite that is more
  consistent with the rest of the lxc-* executables.
- All tests have been moved beyond the call to lxc_log_init() to allow for the
  messages to be printed or saved.
- Some small changes to the my_args struct. (The enum task is set to
  SNAP (for snapshot) per default and variables illustrating the usage of the
  command line flags are written in all caps.)
- arguments.h has been extended to accommodate a rewrite of lxc-clone

Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>


  Commit: 840d2afe82f6987e2506264ed3473d785c4ee2eb
      https://github.com/lxc/lxc/commit/840d2afe82f6987e2506264ed3473d785c4ee2eb
  Author: Christian Brauner <christianvanbrauner at gmail.com>
  Date:   2015-08-08 (Sat, 08 Aug 2015)

  Changed paths:
    M src/lxc/lxc_clone.c

  Log Message:
  -----------
  Refactor lxc-clone

- This commit adapts lxc-clone to be similiar in usage and feel to the other
  lxc-* executables. It builds on the previous extension of the lxc_argument
  struct and now uses the default lxc_arguments_parse() function.
- Options which were not used have been removed.
- The LXC_CLONE_KEEPNAME flag was not respected in the previous version of
  lxc-clone. The culprit is a missing if-condition in lxccontainer.c. As this
  requires a change in one of the API functions in lxccontainer.c it will be
  addressed in a follow-up commit.

Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>


  Commit: eab218fbf7c70ab3143440ef1165e5bdd4f51a71
      https://github.com/lxc/lxc/commit/eab218fbf7c70ab3143440ef1165e5bdd4f51a71
  Author: Christian Brauner <christianvanbrauner at gmail.com>
  Date:   2015-08-08 (Sat, 08 Aug 2015)

  Changed paths:
    M src/lxc/lxccontainer.c

  Log Message:
  -----------
  Make LXC_CLONE_KEEPNAME work

Passing the LXC_CLONE_KEEPNAME flag to do_lxcapi_clone() was not respected. We
wrap clear_unexp_config_line() and set_config_item_line() in an appropriate
if-condition.

Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>


  Commit: b2966d59acb9bfb8d02fe1e6427cdf27cbd9686b
      https://github.com/lxc/lxc/commit/b2966d59acb9bfb8d02fe1e6427cdf27cbd9686b
  Author: Christian Brauner <christianvanbrauner at gmail.com>
  Date:   2015-08-08 (Sat, 08 Aug 2015)

  Changed paths:
    M src/lxc/lxc_attach.c
    M src/lxc/lxc_checkpoint.c
    M src/lxc/lxc_console.c
    M src/lxc/lxc_create.c
    M src/lxc/lxc_destroy.c
    M src/lxc/lxc_device.c
    M src/lxc/lxc_execute.c
    M src/lxc/lxc_freeze.c
    M src/lxc/lxc_info.c
    M src/lxc/lxc_init.c
    M src/lxc/lxc_monitor.c
    M src/lxc/lxc_start.c
    M src/lxc/lxc_stop.c
    M src/lxc/lxc_unfreeze.c
    M src/lxc/lxc_wait.c

  Log Message:
  -----------
  Fix grammar in some of the executables

"NAME for name of the container" becomes "NAME of the container"

Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>


  Commit: 7909bb03e6fcc3f49e62aa455b903fdc74ddb6dd
      https://github.com/lxc/lxc/commit/7909bb03e6fcc3f49e62aa455b903fdc74ddb6dd
  Author: Christian Brauner <christianvanbrauner at gmail.com>
  Date:   2015-08-08 (Sat, 08 Aug 2015)

  Changed paths:
    M src/lxc/lxc_destroy.c

  Log Message:
  -----------
  lxc-destroy: Remove container with all snapshots

- This enables the user to destroy a container with all its snapshots without
  having to use lxc-snapshot first to destroy all snapshots. (The enum values
  DESTROY and SNAP from the previous commit are reused here again.)
- Some unification regarding the usage of exit() and return has been done.

Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>


  Commit: f69d74e3599c76ef9aaaa311219ce85e43768b3a
      https://github.com/lxc/lxc/commit/f69d74e3599c76ef9aaaa311219ce85e43768b3a
  Author: Serge Hallyn <serge at hallyn.com>
  Date:   2015-08-13 (Thu, 13 Aug 2015)

  Changed paths:
    M src/lxc/arguments.h
    M src/lxc/lxc_attach.c
    M src/lxc/lxc_checkpoint.c
    M src/lxc/lxc_clone.c
    M src/lxc/lxc_console.c
    M src/lxc/lxc_create.c
    M src/lxc/lxc_destroy.c
    M src/lxc/lxc_device.c
    M src/lxc/lxc_execute.c
    M src/lxc/lxc_freeze.c
    M src/lxc/lxc_info.c
    M src/lxc/lxc_init.c
    M src/lxc/lxc_monitor.c
    M src/lxc/lxc_snapshot.c
    M src/lxc/lxc_start.c
    M src/lxc/lxc_stop.c
    M src/lxc/lxc_unfreeze.c
    M src/lxc/lxc_wait.c
    M src/lxc/lxccontainer.c

  Log Message:
  -----------
  Merge pull request #621 from brauner/arguments

Refactor lxc-snapshot, lxc-clone, make LXC_CLONE_KEEPNAME work and add option to destroy container with all snapshots to lxc-destroy


Compare: https://github.com/lxc/lxc/compare/3cd058176c94...f69d74e3599c


More information about the lxc-devel mailing list