1. 13 Jan, 2010 5 commits
    • Don't mess descr->ev · 5df6b18f
      Clement Calmels authored
      A simple test program to show up the issue:
      
      -8<---
      #include <stdio.h>
      #include <unistd.h>
      
      #include "mainloop.h"
      
      struct lxc_epoll_descr loop;
      
      int cb1(int fd, void *data, struct lxc_epoll_descr *descr)
      {
      	fprintf(stderr, "cb1\n");
              return 1;
      }
      
      int cb2(int fd, void *data, struct lxc_epoll_descr *descr)
      {
      	fprintf(stderr, "cb2\n");
              return 1;
      }
      
      int main(int argc, char *argv[])
      {
              int ret;
              int fds[2];
      
              ret = pipe(fds);
              if (ret) {
                      perror("pipe:");
                      return -1;
              }
      
              ret = lxc_mainloop_open(&loop);
              if (ret) {
                      fprintf(stderr, "lxc_mainloop_open: %d\n", ret);
                      return -1;
              }
      
              ret = lxc_mainloop_add_handler(&loop, fds[1], cb1, NULL);
              if (ret) {
                      fprintf(stderr, "lxc_mainloop_add_handler(fds[1]): %d\n", ret);
                      return -1;
              }
      
              ret = lxc_mainloop_add_handler(&loop, fds[0], cb2, NULL);
              if (ret) {
                      fprintf(stderr, "lxc_mainloop_add_handler(fds[0]): %d\n", ret);
                      return -1;
              }
      
              write(fds[1], &ret, sizeof(ret));
      
              ret = lxc_mainloop(&loop);
              if (ret) {
      	        fprintf(stderr, "lxc_mainloop: %d\n", ret);
      				return -1;
              }
      
              ret = lxc_mainloop_close(&loop);
              if (ret) {
                      fprintf(stderr, "lxc_mainloop_close: %d\n", ret);
                      return -1;
              }
      
              return 0;
      }
      
      Compile and run:
      $ gcc test.c -o test -I ./src/lxc/ ./src/lxc/liblxc_so-mainloop.o && ./test
      cb2
    • If epoll_ctl fails, the descr->ev array isinconsistent · 3ce45e64
      Clement Calmels authored
      Let's take an example:
      
      fd = open(..) /* fd = 3 for example */
      
      lxc_mainloop_add_handler(descr, fd, cb1, data1) fails.
      
      the program take care of the error, it closes the fd
      
      Later, reopen a fd (get 3 for again)
      
      lxc_mainloop_add_handler(desc, fd, cb2, data2) is ok.
      
      When something happen on fd, cb1 with data1 will be called instead of
      cb2 with data2, because descr->ev contains 2 entries for fd == 3.
      Signed-off-by: 's avatarClement Calmels <clement.calmels@fr.ibm.com>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • fix lxc_mainloop_del_handler · 312b3ca2
      Clement Calmels authored
      Fix bad index.
      Signed-off-by: 's avatarClement Calmels <clement.calmels@fr.ibm.com>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • use different log categories in commands · 77075659
      Cedric Le Goater authored
      lxc_<cmd>.c and <cmd>.c files use the same log category : lxc_<cmd>.
      The symbol is multiply defined and linking statically lxc commands is
      not possible.
      
      The patch introduces new log categories with a '_ui' suffix to
      differentiate the command line interface from the library routine.
      Reported-by: 's avatarCiprian Dorin, Craciun <ciprian.craciun@gmail.com>
      Signed-off-by: 's avatarCedric Le Goater <clg@fr.ibm.com>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • fix lxc_file_cb prototype · 7a7ff0c6
      Cedric Le Goater authored
      Signed-off-by: 's avatarCedric Le Goater <clg@fr.ibm.com>
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
  2. 08 Jan, 2010 9 commits
  3. 05 Jan, 2010 1 commit
  4. 28 Dec, 2009 1 commit
    • add macvlan vepa and bridge mode · e892973e
      Daniel Lezcano authored
      The future kernel 2.6.33 will incorporate the macvlan bridge
      mode where all the macvlan will be able to communicate if they are
      using the same physical interface. This is an interesting feature
      to have containers to communicate together. If we are outside of the
      container, we have to setup a macvlan on the same physical interface than
      the containers and use it to communicate with them.
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
  5. 27 Dec, 2009 4 commits
    • busybox template · eb960fea
      Daniel Lezcano authored
      This script builds a busybox rootfs and provides the associated
      configuration to run the busybox.
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • adapt lxc-sshd to be a template · 418c73ad
      Daniel Lezcano authored
      Cleanup the script, simplify it and pass the arguments to this
      script to be callable by lxc-create template logic.
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • add template option for lxc-create · 1b6d8e71
      Daniel Lezcano authored
      The lxc-create command is now able to call a sub script to install
      a mini template.
      Right now, debian is supported.
      
      The rootfs is stored automatically in <lxcpath>/<name>/rootfs
      So the rootfs is a subdirectory of the container configuration directory.
      
      When lxc-destroy is called, the rootfs is deleted with the container
      configuration.
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
    • cleanup lxc-debian script · fb7460fe
      Daniel Lezcano authored
      The lxc-debian is epurated and consolidated with a better
      error handling.
      
      This script is no longer interactive but it installs in a specified
      place the debian rootfs.
      
      This script is not supposed to be called directly so it will fall in
      libexec path very soon. This script is called by lxc-create
      as a template with the right option and the right place.
      
      The debian network configuration is by dhcp.
      Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
  6. 18 Dec, 2009 1 commit
  7. 15 Dec, 2009 3 commits
  8. 26 Nov, 2009 9 commits
  9. 24 Nov, 2009 3 commits
  10. 20 Nov, 2009 4 commits