Skip to content

Commits

Permalink
windows
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Commits on Jan 18, 2019

  1. WINDOWS: HACK ACCEPT.

    Returns EFAULT for no discernable reason.
    rwmjones committed Jan 18, 2019
    Copy the full SHA
    8b8a440 View commit details
    Browse the repository at this point in the history
  2. plugins: Port some plugins to Windows.

    Now ‘--disable-plugins’ can be removed from the previous commit to
    enable some plugins and run them under wine:
    
      sudo dnf install mingw64-gcc mingw64-dlfcn \
                       mingw64-gnutls mingw64-xz mingw64-zlib
      mingw64-configure
      make
      wine ./server/nbdkit.exe -fv \
           ./plugins/memory/.libs/nbdkit-memory-plugin.dll size=1M
    rwmjones committed Jan 18, 2019
    Copy the full SHA
    f9bf9a7 View commit details
    Browse the repository at this point in the history
  3. server: Port to Windows using mingw-w64.

    This allows nbdkit to be cross-compiled for Windows (from Linux).  On
    Fedora[1] you would use the commands below:
    
      sudo dnf install mingw64-gcc mingw64-dlfcn \
                       mingw64-gnutls mingw64-xz mingw64-zlib
      mingw64-configure --disable-plugins
      make
    
    This results in a Windows binary which can be run on Windows or on
    Linux under Wine.
    
    It also probably allows nbdkit to be compiled on Windows natively
    using the mingw-w64 port of GCC, but I did not test that.
    
    There are several limitations compared to running nbdkit on a real
    server, see ‘TODO’ for the complete list.
    
    [1] Note that mingw64-configure is a Fedora-specific script which runs
    ./configure with extra parameters to make cross-compilation for
    Windows work.  You can add other configure parameters to the command
    or if you're not using Fedora then use ‘./configure --host=...’
    instead.
    rwmjones committed Jan 18, 2019
    Copy the full SHA
    b294061 View commit details
    Browse the repository at this point in the history
  4. lib: Use replacement strategy for get_current_dir_name.

    This is really a replacement for a missing platform function, so use
    the same LIBOBJS mechanism to replace it.
    rwmjones committed Jan 18, 2019
    Copy the full SHA
    780a0ef View commit details
    Browse the repository at this point in the history
  5. server: Add general replacements for missing functions using LIBOBJS.

    Especially on Windows, some common functions are missing.  Use the
    autoconf LIBOBJS mechanism to replace these functions.
    
    This includes replacement functions for:
    
      Function names     Implementation   Origin
    
      getdelim, getline  general purpose  NetBSD under a compatible license
    
      openlog, syslog,   Win32            written by me
      vsyslog
    
      realpath           Win32            written by me
    
      strndup            general purpose  written by me
    
    This should do nothing on existing supported platforms.  It is only
    intended in preparation for porting nbdkit to Windows.
    rwmjones committed Jan 18, 2019
    Copy the full SHA
    71d541f View commit details
    Browse the repository at this point in the history
  6. Version 1.10.0.

    rwmjones committed Jan 18, 2019
    Copy the full SHA
    d4d209f View commit details
    Browse the repository at this point in the history
  7. tests: Test that public headers are ANSI (ISO C90) compatible.

    In commit 3775916 (and before that in
    discussions with Eric) we decided that we should try to allow plugins
    to be compiled with C compilers other than GCC or Clang (or with very
    old / peculiar / incompatible versions of those compilers).
    
    However until we test this we cannot guarantee that changes to the
    code will not break this in future, hence this test.
    
    Note that GCC or Clang is still required to compile nbdkit itself.
    rwmjones committed Jan 18, 2019
    Copy the full SHA
    25eef3a View commit details
    Browse the repository at this point in the history
  8. include: Fix NBDKIT_HANDLE_NOT_NEEDED for C90 compilers.

    When an ANSI/C90 plugin compiled with ‘-pedantic’ uses
    NBDKIT_HANDLE_NOT_NEEDED it gets the error:
    
      ISO C forbids conversion of function pointer to object pointer type
    
    This is because the existing macro worked by returning a function
    pointer but in C90 function pointers cannot be cast to data pointers
    since on some ancient architectures code and data pointers were
    incompatible.
    
    We only need a convenient global data pointer here, and the address of
    ‘errno’ should be fine.
    rwmjones committed Jan 18, 2019
    Copy the full SHA
    d5733ec View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2019

  1. build: Don't link everything, only the server, with libselinux.

    The server can link to libselinux to support SELinux socket labelling.
    However because we added the library to $LIBS it got linked into
    everything, eg:
    
    $ eu-readelf -d /usr/lib64/nbdkit/plugins/nbdkit-memory-plugin.so |
        grep NEEDED
      NEEDED            Shared library: [libselinux.so.1]
      NEEDED            Shared library: [libc.so.6]
    
    Libselinux has a pkg-config file so we can use that to detect
    the library and adjust server/Makefile.am so it is only linked
    into the server.
    
    This dependency is still optional.
    rwmjones committed Jan 16, 2019
    Copy the full SHA
    6c51add View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2019

  1. Version 1.9.10.

    rwmjones committed Jan 15, 2019
    Copy the full SHA
    7ed7e09 View commit details
    Browse the repository at this point in the history
  2. server: Include <errno.h> in some files.

    Fixes FreeBSD and OpenBSD compilation which was broken by the code
    refactoring in commit 6193863.
    rwmjones committed Jan 15, 2019
    Copy the full SHA
    8ce27da View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    deb8f99 View commit details
    Browse the repository at this point in the history
  4. server: connections: Use send(2) and recv(2) instead of write and read.

    Winsock only lets you use send/recv, and it shouldn't make any
    difference on Linux either.
    rwmjones committed Jan 15, 2019
    Copy the full SHA
    327ddff View commit details
    Browse the repository at this point in the history
  5. server: sockets: Refactor accept_incoming_connections.

    This is a simple refactoring of the function, allowing us to
    reimplement the inner loop for Windows in a future commit.  Note that
    I made explicit that fds[nr_socks] is used for the quit_fd entry,
    previously this was implicit which was somewhat confusing.
    rwmjones committed Jan 15, 2019
    Copy the full SHA
    512a000 View commit details
    Browse the repository at this point in the history
  6. server: Refactor more parts of main.c into separate files.

    This split is simple code motion.  However it does allow two things:
    we can document more clearly the interfaces between the main code and
    these functions, and it makes it a bit easier to provide alternative
    implementations for Windows.
    rwmjones committed Jan 15, 2019
    Copy the full SHA
    6193863 View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2019

  1. server: Move quit pipe code to a separate file.

    No functional change, simply refactoring.
    rwmjones committed Jan 13, 2019
    Copy the full SHA
    b2819d3 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    59fce61 View commit details
    Browse the repository at this point in the history
  3. data: Print correct final size.

    This fixes a debugging message which showed the incorrect size
    variable.
    rwmjones committed Jan 13, 2019
    Copy the full SHA
    59a9f9f View commit details
    Browse the repository at this point in the history
  4. server: Use special attribute((format)) for varargs print functions.

    Also tidy up an existing declaration so it matches similar decls
    elsewhere in the header file.
    rwmjones committed Jan 13, 2019
    Copy the full SHA
    9783c78 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2019

  1. tests: cxx: Return NBDKIT_HANDLE_NOT_NEEDED from open callback.

    In commit 6c4092a we introduced the
    concept of the open callback returning NBDKIT_HANDLE_NOT_NEEDED for
    plugins which do not need a handle.  The C++ test uses this archetype
    too, but in a slightly different form so that commit did not modify
    this test plugin before.
    rwmjones committed Jan 12, 2019
    Copy the full SHA
    4f070eb View commit details
    Browse the repository at this point in the history
  2. sh: Document can_multi_conn callback in the manual.

    Fixes commit 627727e which omitted to
    updated the manual.
    rwmjones committed Jan 12, 2019
    Copy the full SHA
    4cffc76 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    09cae96 View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2019

  1. Update todo.

    rwmjones committed Jan 11, 2019
    Copy the full SHA
    1cac7e4 View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2019

  1. Copy the full SHA
    b55d856 View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2019

  1. Version 1.9.9.

    rwmjones committed Jan 7, 2019
    Copy the full SHA
    b8d80d3 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2019

  1. data, memory: Use fine-grained locking and change thread model to par…

    …allel.
    
    Instead of implicitly locking around every request, use an explicit
    and (slightly) more fine-grained lock, and change the thread model to
    parallel.  The same change is made to the memory plugin and the data
    plugin.
    
    This improves performance slightly.  Using fio with 8 threads and
    multi-conn enabled with -C 8:
    
    Before:
       read: IOPS=103k, BW=401MiB/s (420MB/s)(46.0GiB/120002msec)
      write: IOPS=103k, BW=401MiB/s (420MB/s)(46.0GiB/120002msec)
    
    After:
       read: IOPS=112k, BW=437MiB/s (458MB/s)(51.2GiB/120001msec)
      write: IOPS=112k, BW=437MiB/s (458MB/s)(51.2GiB/120001msec)
    
    For comparison:
    
    The memory plugin implemented using a simple malloc instead of a
    sparse array:
       read: IOPS=133k, BW=518MiB/s (544MB/s)(60.7GiB/120002msec)
      write: IOPS=133k, BW=518MiB/s (543MB/s)(60.7GiB/120002msec)
    
    Directly running fio against /dev/shm:
       read: IOPS=1018k, BW=3978MiB/s (4171MB/s)(466GiB/120001msec)
      write: IOPS=1018k, BW=3979MiB/s (4172MB/s)(466GiB/120001msec)
    rwmjones committed Jan 5, 2019
    Copy the full SHA
    a76cc95 View commit details
    Browse the repository at this point in the history
  2. data, memory: Return NBD_FLAG_CAN_MULTI_CONN.

    These plugins use NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS because
    of their use of the global sparse array.  However since they are both
    RAM disks, and thus (a) flush is a no-op, and (b) the locked part of
    each request is short, it is both safe and there is some performance
    benefit to using NBD_FLAG_CAN_MULTI_CONN.
    
    Without multi-conn:
    
       read: IOPS=52.8k, BW=206MiB/s (216MB/s)(24.2GiB/120002msec)
      write: IOPS=52.8k, BW=206MiB/s (216MB/s)(24.2GiB/120002msec)
    
    With multi-conn (-C 8):
    
       read: IOPS=103k, BW=401MiB/s (420MB/s)(46.0GiB/120002msec)
      write: IOPS=103k, BW=401MiB/s (420MB/s)(46.0GiB/120002msec)
    rwmjones committed Jan 5, 2019
    Copy the full SHA
    dbd8629 View commit details
    Browse the repository at this point in the history
  3. partitioning: Return NBD_FLAG_CAN_MULTI_CONN.

    This plugin has a parallel thread model and handles flush correctly
    across connections, so return NBD_FLAG_CAN_MULTI_CONN.
    rwmjones committed Jan 5, 2019
    Copy the full SHA
    048c34e View commit details
    Browse the repository at this point in the history
  4. file: Return NBD_FLAG_CAN_MULTI_CONN for the file plugin.

    This allows multiple connections from a single client, and should be
    safe assuming flush/FUA has been implemented correctly in the previous
    commit.
    
    Using the file plugin, but locating the file on /dev/shm, I obtained
    the following results.
    
    No multi-conn:
    
       read: IOPS=52.0k, BW=203MiB/s (213MB/s)(23.8GiB/120002msec)
      write: IOPS=52.0k, BW=203MiB/s (213MB/s)(23.8GiB/120002msec)
    
    Multi-conn (-C 8):
    
       read: IOPS=122k, BW=477MiB/s (500MB/s)(55.9GiB/120002msec)
      write: IOPS=122k, BW=477MiB/s (500MB/s)(55.9GiB/120002msec)
    rwmjones committed Jan 5, 2019
    Copy the full SHA
    910a220 View commit details
    Browse the repository at this point in the history
  5. file: Implement NBDKIT_API_VERSION 2.

    Upgrade this plugin to version 2 of the API.  The main change is
    implementing FUA support.
    rwmjones committed Jan 5, 2019
    Copy the full SHA
    aa46540 View commit details
    Browse the repository at this point in the history
  6. plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins.

    It is safe to return NBD_FLAG_CAN_MULTI_CONN from almost all readonly
    plugins.  However only do it where the plugin thread model is
    NBDKIT_THREAD_MODEL_PARALLEL and the plugin could plausibly be used in
    a high performance situation.
    rwmjones committed Jan 5, 2019
    Copy the full SHA
    0ced3f9 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    627727e View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    133c4e6 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    71b2251 View commit details
    Browse the repository at this point in the history
  10. blocksize: Implement filtering of .can_multi_conn (forcing it to false).

    I examined each filter to see which ones implement a cache and do not
    properly consider consistency across clients for flush requests.  For
    these filters we should force .can_multi_conn to return false.
    
    I believe only one filter (blocksize) needs to be updated and all the
    other ones are safe.
    rwmjones committed Jan 5, 2019
    Copy the full SHA
    a68c101 View commit details
    Browse the repository at this point in the history
Older