public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
* Transforming stdin and stdout pair into a socket
@ 2009-05-10 18:19 Ciprian Dorin, Craciun
  2009-05-11  8:03 ` [Nbd] " Laurent Vivier
  2009-05-11 12:02 ` [Qemu-devel] " Anthony Liguori
  0 siblings, 2 replies; 8+ messages in thread
From: Ciprian Dorin, Craciun @ 2009-05-10 18:19 UTC (permalink / raw)
  To: linux-newbie; +Cc: qemu-devel, nbd-general

    Hello all!

    Today I've played around with NBD (Network Block Disk), and
qemu-nbd (a NBD client that exports QEMU disks as NBD's).

    My problem is the following: both NBD kernel module and qemu-nbd
implementation expect to use a socket in order to communicate.
    This means that in order to securely tunnel the connection over
SSH (OpenSSH), I need an intermediary process that creates a socket
and forwards all input / output between this socket and stdin / stdout
(which are in fact pipes received from OpenSSH).

    My question is: can I somehow make the pair of stdin / stdout seem
as a socket to the Linux syscalls (read and write)? (I would have to
make stdin / stdout pair look like a single file descriptor.) (This
would eliminate the intermediate process that just pipes data, and
thus reduce the overhead.)

    Just to be clear: I know how to trick an application to have it's
stdin and stdout be an opened socket (by using dup syscall). But in
this case I need to trick the Linux kernel into thinking that stdin /
stdout pair is a socket (or a single file descriptor).

    Thank you,
    Ciprian Craciun.
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-05-12  2:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-10 18:19 Transforming stdin and stdout pair into a socket Ciprian Dorin, Craciun
2009-05-11  8:03 ` [Nbd] " Laurent Vivier
2009-05-11 13:28   ` Ciprian Dorin, Craciun
2009-05-11 12:02 ` [Qemu-devel] " Anthony Liguori
2009-05-11 13:32   ` Ciprian Dorin, Craciun
     [not found]     ` <8e04b5820905110632q1a3b9ad4u49d4f3208d994755-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-11 19:31       ` Wouter Verhelst
2009-05-11 23:07     ` Paul Brook
2009-05-12  2:24       ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox