qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] A Patch to enable qemu-nbd run as an inetd service


From: Jun Sheng
Subject: [Qemu-devel] [PATCH] A Patch to enable qemu-nbd run as an inetd service
Date: Wed, 29 Oct 2014 11:36:24 +0800

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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]