Re: [Nbd] [NBD]Some confusions when i read the nbd codes
- To: Paul Clements <paul.clements@...856...>, Wouter Verhelst <w@...112...>
- Cc: nbd-general@lists.sourceforge.net, hua kang <xiyoucloud@...17...>
- Subject: Re: [Nbd] [NBD]Some confusions when i read the nbd codes
- From: harryxiyou <harryxiyou@...17...>
- Date: Tue, 9 Aug 2011 12:22:21 +0800
- Message-id: <CAD+1EGMUwDkU+17_rJ0HUTFTn2p-JazQtEPrJ=rA9FrNDqoB5Q@...18...>
- In-reply-to: <CAD+1EGN-DitPskNDvc6op4+iYu9auj7U46K6-Fc6eS8z13TVAA@...18...>
- References: <CAD+1EGN-DitPskNDvc6op4+iYu9auj7U46K6-Fc6eS8z13TVAA@...18...>
On Tue, Aug 9, 2011 at 11:56 AM, harryxiyou <harryxiyou@...17...> wrote:
> Hi all,
>
> NOTE: my nbd source code's version is nbd-2.9.15.tar.bz2.
>
> 1, Why do we handle the
>
Sorry for sending the mail unfinished just now, okay, see following
for the rest.
1, Why do we handle the 'serve->port == 0' in nbd-server.c
particularly? I don't know
the differences for 'port == 0'.
1889 if(serve) {
1890 serve->socket_family = AF_UNSPEC;
1891
1892 append_serve(serve, servers);
1893
1894 if (!(serve->port)) {
1895 CLIENT *client;
1896 #ifndef ISSERVER
1897 /* You really should define ISSERVER if
you're going to use
1898 * inetd mode, but if you don't, closing
stdout and stderr
1899 * (which inetd had connected to the
client socket) will let it
1900 * work. */
1901 close(1);
2, Can you just describe the relationships among nbd.c in kernel as a module
and nbd-client.c && nbd-server.c in our nbd package ?
3, Okay, now i have a nbd client and a nbd server. I just know nbd client can
get disk space from nbd server but how server can get the exact datas which
entered by user from nbd client?
4, We have three functions in nbd-server.c like following.
rawexpwrite(...)
rawexpwrite_fully(...)
expwrite(...)
I am not sure if these functions write datas to client device or server?
I just see datas in client but server.
5, i have a nbd client and server. Now they have establish the
nbd connections. Client just use /dev/nbd0. And format /dev/nbd0
to ext3 FS. Then i mount it to /mnt/nbd0. I copy /root to /mnt/nbd0.
Now how can i get the /root directory from the nbd server?
Thanks for anyone's feedback
Harry Wei
Reply to: