1. 04 Jan, 2016 11 commits
  2. 01 Jan, 2016 1 commit
  3. 30 Dec, 2015 1 commit
  4. 28 Dec, 2015 11 commits
    • Merge pull request #734 from brauner/2015-12-12/split_bdev_into_modules · cb65e5d7
      Serge Hallyn authored
      split bdev into modules: btrfs + rsync
    • Add <linux/types.h> header to lxcbtrfs.h · c40c5fdf
      Christian Brauner authored
      Using
      
      	#include <sys/types.h>
      
      is not sufficient to guarantee that __le64 and other types are defined.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • Simplify overlay.{c,h} · 3188197d
      Christian Brauner authored
      The struct
      
      	struct ovl_rsync_data {
      		struct bdev *orig;
      		struct bdev *new;
      	};
      
      is simply a duplicate of
      
      	struct rsync_data {
      		struct bdev *orig;
      		struct bdev *new;
      	};
      
      So let's replace any references to ovl_rsync_data with rsync_data.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • Split bdev into modules: lxcrsync · e9df7e1a
      Christian Brauner authored
      The functions:
      
              - do_rsync();
              - rsync_delta();
              - rsync_delta_wrapper();
              - rsync_rootfs();
              - rsync_rootfs_wrapper();
      
      and the structs
      
              - struct rsync_data;
              - struct rsync_data_char;
      
      move from bdev.{c,h} to lxcrsync.{c.h}. All functions previously declared as
      static become public.
      
      lxcrsync.{c,h} should allow for a reasonable amount of abstraction regarding
      our rsync functions. Some of the functions could easily be abstracted.
      
      Adapt Makefile.am to include lxcrsync.{c,h}.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • lxcbtrfs.{c,h} rework declarations and definitions · 988be9c1
      Christian Brauner authored
      Declare
      
      	- btrfs_same_fs();
      	- btrfs_snapshot();
      
      extern instead of static in lxcbtrfs.h. They are defined in lxcbtrfs.c.
      
      Forward declare/put
      
      	- struct bdev; /* defined in bdev.h */
      	- struct bdev_specs; /* defined in lxccontainer.h */
      	- struct lxc_conf; /* defined conf.h */
      
      as incomplete types in lxcbtrfs.h so that functions declared and defined in
      lxcbtrfs.{c,h} have access to it.
      
      Declare
      
      	- dir_new_path();
      
      in lxcbtrfs.c. It is defined in lxccontainer.c.
      
      Move definition of struct
      
      	- struct rsync_data_char;
      
      from bdev.c to bdev.h because the functions in lxcbtrfs.{c,h} need to access it.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • Split bdev into modules: btrfs · 3c16d0cb
      Christian Brauner authored
      Create a module for btrfs: lxcbtrfs.{c,h}.
      
      The functions:
      
      	- get_btrfs_subvol_path()
      	- btrfs_list_get_path_rootid()
      	- is_btrfs_fs()
      	- btrfs_detect()
      	- btrfs_mount()
      	- btrfs_umount()
      	- btrfs_subvolume_create()
      	- btrfs_same_fs()
      	- btrfs_snapshot()
      	- btrfs_snapshot_wrapper()
      	- btrfs_clonepaths()
      	- btrfs_do_destroy_subvol()
      	- get_btrfs_tree_idx()
      	- my_btrfs_tree *create_my_btrfs_tree()
      	- update_tree_node()
      	- add_btrfs_tree_node()
      	- free_btrfs_tree()
      	- do_remove_btrfs_children()
      	- btrfs_recursive_destroy()
      	- btrfs_try_remove_subvol()
      	- btrfs_destroy()
      	- btrfs_create()
      
      and the structs:
      
      	- struct mytree_node
      	- struct my_btrfs_tree
      
      move from bdev.{c,h} to lxcbtrfs.{c,h}.
      
      Rename the header file
      
      	- lxc-btrfs.h --> lxcbtrfs.h
      
      Adapt Makefile.am to include lxcbtrfs.{c,h} and remove lxc-btrfs.h.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • Add <linux/types.h> header to lxcbtrfs.h · fc58bf2c
      Christian Brauner authored
      Using
      
      	#include <sys/types.h>
      
      is not sufficient to guarantee that __le64 and other types are defined.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • Simplify overlay.{c,h} · e0d0f93b
      Christian Brauner authored
      The struct
      
      	struct ovl_rsync_data {
      		struct bdev *orig;
      		struct bdev *new;
      	};
      
      is simply a duplicate of
      
      	struct rsync_data {
      		struct bdev *orig;
      		struct bdev *new;
      	};
      
      So let's replace any references to ovl_rsync_data with rsync_data.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • Split bdev into modules: lxcrsync · cd0f1eeb
      Christian Brauner authored
      The functions:
      
              - do_rsync();
              - rsync_delta();
              - rsync_delta_wrapper();
              - rsync_rootfs();
              - rsync_rootfs_wrapper();
      
      and the structs
      
              - struct rsync_data;
              - struct rsync_data_char;
      
      move from bdev.{c,h} to lxcrsync.{c.h}. All functions previously declared as
      static become public.
      
      lxcrsync.{c,h} should allow for a reasonable amount of abstraction regarding
      our rsync functions. Some of the functions could easily be abstracted.
      
      Adapt Makefile.am to include lxcrsync.{c,h}.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • lxcbtrfs.{c,h} rework declarations and definitions · 93d4475e
      Christian Brauner authored
      Declare
      
      	- btrfs_same_fs();
      	- btrfs_snapshot();
      
      extern instead of static in lxcbtrfs.h. They are defined in lxcbtrfs.c.
      
      Forward declare/put
      
      	- struct bdev; /* defined in bdev.h */
      	- struct bdev_specs; /* defined in lxccontainer.h */
      	- struct lxc_conf; /* defined conf.h */
      
      as incomplete types in lxcbtrfs.h so that functions declared and defined in
      lxcbtrfs.{c,h} have access to it.
      
      Declare
      
      	- dir_new_path();
      
      in lxcbtrfs.c. It is defined in lxccontainer.c.
      
      Move definition of struct
      
      	- struct rsync_data_char;
      
      from bdev.c to bdev.h because the functions in lxcbtrfs.{c,h} need to access it.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • Split bdev into modules: btrfs · f2e50c44
      Christian Brauner authored
      Create a module for btrfs: lxcbtrfs.{c,h}.
      
      The functions:
      
      	- get_btrfs_subvol_path()
      	- btrfs_list_get_path_rootid()
      	- is_btrfs_fs()
      	- btrfs_detect()
      	- btrfs_mount()
      	- btrfs_umount()
      	- btrfs_subvolume_create()
      	- btrfs_same_fs()
      	- btrfs_snapshot()
      	- btrfs_snapshot_wrapper()
      	- btrfs_clonepaths()
      	- btrfs_do_destroy_subvol()
      	- get_btrfs_tree_idx()
      	- my_btrfs_tree *create_my_btrfs_tree()
      	- update_tree_node()
      	- add_btrfs_tree_node()
      	- free_btrfs_tree()
      	- do_remove_btrfs_children()
      	- btrfs_recursive_destroy()
      	- btrfs_try_remove_subvol()
      	- btrfs_destroy()
      	- btrfs_create()
      
      and the structs:
      
      	- struct mytree_node
      	- struct my_btrfs_tree
      
      move from bdev.{c,h} to lxcbtrfs.{c,h}.
      
      Rename the header file
      
      	- lxc-btrfs.h --> lxcbtrfs.h
      
      Adapt Makefile.am to include lxcbtrfs.{c,h} and remove lxc-btrfs.h.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
  5. 24 Dec, 2015 1 commit
  6. 23 Dec, 2015 2 commits
  7. 21 Dec, 2015 7 commits
  8. 15 Dec, 2015 6 commits
    • Move remaining overlay helpers to overlay.{c,h} · 5c484f79
      Christian Brauner authored
      Move
      	- ovl_get_rootfs_dir()
      	- mount_entry_create_overlay_dirs()
      
      from conf.h to overlay.{c,h} where they belong.
      
      Rename
      	- mount_entry_create_overlay_dirs() --> ovl_mkdir()
      
      in accordance with the ovl_ prefix naming scheme for types and functions
      associated with overlay.
      
      Take the chance to add whitespace between operators where missing.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • Unify naming for overlay types & functions · 83e79752
      Christian Brauner authored
      Use ovl_ as prefix for types and functions.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • Split bdev into modules: overlay · 38683db4
      Christian Brauner authored
      With this commit we start to split bdev.{c,h} into modules located in the
      subfolder bdev. We start by creating a module for overlay: overlay.{c,h}.
      
      - The functions:
      
      	- overlayfs_detect()
      	- overlayfs_mount()
      	- overlayfs_umount()
      	- overlayfs_clonepaths()
      	- overlayfs_destroy()
      	- overlayfs_create()
      
        move from bdev.{c,h} to overlay.{c,h}. The only thing that remains in bdev.c
        is the static definition of
      
      	- static const struct bdev_ops overlayfs_ops
      
      - The functions:
      
      	- update_ovl_paths()
      	- overlay_getlower()
      
        move from lxccontainer.c to overlay.{c,h}. update_ovl_paths() is used to
        update absolute paths for overlay lxc.mount.entry entries but it seems to fit
        more here than into lxccontainer.c.
        The Function overlay_getlower() is used to extract the lower directory for
        overlay (and aufs) rootfs. It should at some point become a common helper.
      
      - The functions:
      
      	- do_rsync()
      	- dir_new_path()
      
         remain in bdev.c for now but become extern. We declare them extern in
         overlay.c to be able to call them. As the comment to them correctly notices,
         they should at some point become common helpers and probably move to
         utils.{c,h} or some other more appropriate place.
      
      - The structs:
      
      	- struct bdev; /* defined in bdev.h */
      	- struct bdev_specs; /* defined in lxccontainer.h */
      	- struct lxc_conf; /* defined conf.h */
      
        are forward declared/put as incomplete types in overlay.h so that the
        functions have access to it.
      
      - The header overlay.h is *not* included in bdev.h but only in bdev.c so that
        when bdev.h is included the public functions in overlay.h cannot be accessed,
        i.e. if an implementation wants to call functions from overlay.h they need to
        explicitly include it. (As is e.g. done in the case of lxccontainer.c.)
      
      - The header
      
      	- lxc-btrfs.h
      
        also moves to the bdev subfolder.
      
      - Adapt Makefile.am to the new bdev layout.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
    • Merge pull request #727 from fanyeren/patch-17 · fbc617e8
      Stéphane Graber authored
      lxc-top: print new line after flush terminal
    • Merge pull request #719 from liqiu/li-dev2 · aafeda82
      Stéphane Graber authored
      Return immediately in save_phys_nics if not run as root