1. 26 Dec, 2011 5 commits
    • Pavel Emelyanov's avatar
      Unix sockets initial support · c5eb61e8
      Pavel Emelyanov authored
      Currently it can only work with stream sockets, which have no skbs in queues
      (listening or established -- both work OK).
      
      The cpt part uses the sock_diag engine that was merged to Dave recently to
      collect sockets. Then it dumps sockets by checking the filesystem ID of a
      failed-to-open through /proc/pid/fd descriptors (sockets do not allow for
      such tricks with opens through proc) against SOCKFS_TYPE.
      
      The rst part is more tricky. Listen sockets are just restored, this is simple.
      Connected sockets are restored like this:
      
      1. One end establishes a listening anon socket at the desired descriptor;
      2. The other end just creates a socket at the desired descriptor;
      3. All sockets, that are to be connect()-ed call connect. Unix sockets
         do not block connect() till the accept() time and thus we continue with...
      4. ... all listening sockets call accept() and ... dup2 the new fd into the
         accepting end.
      
      There's a problem with this approach -- socket names are not preserved, but
      looking into our OpenVZ implementation I think this is OK for existing apps.
      
      What should be done next is:
      
      1. Need to merge the file IDs patches in our tree and make Andrey to
         support files sharing. This will solve the
      
      	sk = socket();
      	fork();
      
         case. Currently it simply doesn't work :(
      
      2. Need to add support for DGRAM sockets -- I wrote comment how to do it
         in the can_dump_unix_sk()
      
      3. Need to add support for in-flight connections
      
      4. Implement support for UDP sockets (quite simple)
      
      5. Implement support for listening TCP sockets (also not very complex)
      
      6. Implement support for connected TCP scokets (hard one, Tejun's patches are not
         very good for this from my POV)
      
      Cyrill, plz, apply this patch and put the above descriptions onto wiki docs (do we
      have the plans page yet?).
      
      Andrey, plz, take care of unix sockets tests in zdtm. Most likely it won't work till
      you do the shared files support for sockets.
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      c5eb61e8
    • Pavel Emelyanov's avatar
      Helper for moving image fd · bf7a74d4
      Pavel Emelyanov authored
      When opening an fd at a position where the current image fd sits
      the latter one should be moved.
      
      Introduce a helper for this.
      
      Signed-off-by; Pavel Emelyanov <xemul@parallels.com>
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      bf7a74d4
    • Pavel Emelyanov's avatar
      reopn_fd_as return code fixlet and cleanup · 99cc8794
      Pavel Emelyanov authored
      Nobody cares the returned fd, so just make it 0/-1 and clean up the callers.
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      99cc8794
    • Cyrill Gorcunov's avatar
      restorer: Implement own BUG_ON_HANDLER · d7ab5f2f
      Cyrill Gorcunov authored
      Due to code specifics (we're running without
      glibc support) we need own one.
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      d7ab5f2f
    • Cyrill Gorcunov's avatar
      util: Add BUG_ON helper · f5a87742
      Cyrill Gorcunov authored
      Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      f5a87742
  2. 25 Dec, 2011 7 commits
  3. 20 Dec, 2011 4 commits
  4. 19 Dec, 2011 20 commits
  5. 16 Dec, 2011 3 commits
  6. 13 Dec, 2011 1 commit