qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jun Sheng <chaoseternal@gmail.com>
To: qemu-devel@nongnu.org
Cc: Jun Sheng <chaoseternal@gmail.com>
Subject: [Qemu-devel] [PATCH] [v2] inetd enabled qemu-nbd
Date: Sun,  2 Nov 2014 23:23:26 +0800	[thread overview]
Message-ID: <1414941807-5080-1-git-send-email-chaoseternal@gmail.com> (raw)

run qemu-nbd as an inetd service has some benefits
* more scriptable, such as serve multiple images to different clients
on one ip/port
* access control using tcpd

simple usage:
#!/bin/sh
# qemu-nbd wrapper, select image file according to client ip address
IMG_FILE=`sed -n "s/$REMOTE_HOST //p" /path/to/image_list.txt`
qemu-nbd -i 10 $IMG_FILE 10<&0- 1>/tmp/log 2>/tmp/log2

#end

#xinetd.conf
service nbd
{
        flags                   = REUSE
        socket_type             = stream
        wait                    = no
        user                    = some_user
        server                  = /path/to/qemu-nbd-wrapper.sh
        log_on_failure          += USERID
        disable                 = no
}

Signed-off-by: Jun Sheng <chaoseternal@gmail.com>

             reply	other threads:[~2014-11-02 15:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-02 15:23 Jun Sheng [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-02 15:26 [Qemu-devel] [PATCH][v2] inetd enabled qemu-nbd Jun Sheng
2014-11-03 14:43 ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414941807-5080-1-git-send-email-chaoseternal@gmail.com \
    --to=chaoseternal@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).