ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Linux-NBD/README
(Generate patch)

Comparing Linux-NBD/README (file contents):
Revision 1.3 by root, Fri Sep 8 19:29:06 2006 UTC vs.
Revision 1.4 by root, Sun Nov 21 03:24:38 2010 UTC

18 OTOH, it works relatively reliable when you don't stop the servers, so 18 OTOH, it works relatively reliable when you don't stop the servers, so
19 watch out and keep your fingers crossed. 19 watch out and keep your fingers crossed.
20 20
21METHODS 21METHODS
22 $client = new Linux::NBD::Client [socket => $fh][, device => 22 $client = new Linux::NBD::Client [socket => $fh][, device =>
23 "/dev/ndx"], ... 23 "/dev/nbdX"], ...
24 Create a new client. 24 Create a new client.
25 25
26 Unless "device" is given, an unused device node is looked up using 26 Unless "device" is given, an unused device node is looked up using
27 the "device" method (this might result in an exception!). 27 the "device" method (this might result in an exception!).
28 28
29 The other arguments correspond to calls to methods of the same name.
30
31 $client->socket([$tcp_socket]) 29 $client->socket ([$tcp_socket])
32 Returns the current socket after setting a new one (if an argument 30 Returns the current socket after setting a new one (if an argument
33 is supplied). The socket *MUST* be a tcp socket. Believe, bad things 31 is supplied). The socket *MUST* be a tcp socket. Believe me, bad
34 will happen. 32 things will happen if not.
35 33
36 The special argument "undef" will try to clear the socket, if any 34 The special argument "undef" will try to clear the socket, if any
37 was set. 35 was set.
38 36
39 $client->device([$new_device]) 37 $client->device ([$new_device])
40 Returns the current device node (e.g. "/dev/nd2") after setting a 38 Returns the current device node (e.g. "/dev/nbd2") after setting a
41 new one if an argument is supplied. 39 new one if an argument is supplied.
42 40
43 If the argument is "undef" it will search for an unallocated 41 If the argument is "undef" it will search for an unallocated
44 nbd-device and use it. 42 nbd-device and use it.
45 43
46 $client->disconnect 44 $client->disconnect
47 Tries to exit the server by ending a special disconnect message. 45 Tries to exit the server by sending a special disconnect message.
48 46
49 $client->clear_queue 47 $client->clear_queue
50 Clears the request queue, if possible. Should be used before setting 48 Clears the request queue, if possible. Should be used before setting
51 a new socket. 49 a new socket.
52 50
53 $client->set_blocksize($blksize) 51 $client->set_timeout ($timeout)
54 Set the device blocksize in bytes (must be >512, <PAGESIZE and a 52 Set the request timeout, in seconds.
55 power of two).
56 53
57 $client->set_size($bytes) 54 $client->set_blocksize ($blksize)
58 Set the device size in bytes. 55 Set the device block size in bytes, i.e. how big each block is (must
56 be >512, <PAGESIZE and a power of two).
59 57
58 Also rounds down the device size to be a multiple of the block size.
59
60 $client->set_blocks($nblocks) 60 $client->set_blocks ($nblocks)
61 Set the size in blocks. 61 Set the device size in block units.
62
63 $client->set_size ($bytes)
64 Set the device size in octet units, will be rounded down to be a
65 multiple of the block size.
62 66
63 $client->run 67 $client->run
68 Closes all file descriptors except the server socket and enters the
64 Enters the service loop (waits for read/write requests on the device 69 service loop (waits for read/write requests on the device and
65 and forwards them over the given socket). Only returns when somebody 70 forwards them over the given socket). Only returns when somebody
66 calls "disconnect" or the server is killed. 71 calls "disconnect" or the server is killed.
67 72
68 $pid = $client->run_async 73 $pid = $client->run_async
69 Runs the service loop asynchronously and returns the pid of the 74 Runs the service loop asynchronously and returns the pid of the
70 newly created service process. 75 newly created service process.
75 80
76AUTHOR 81AUTHOR
77 Marc Lehmann <schmorp@schmorp.de> 82 Marc Lehmann <schmorp@schmorp.de>
78 http://home.schmorp.de/ 83 http://home.schmorp.de/
79 84
85POD ERRORS
86 Hey! The above document had some coding errors, which are explained
87 below:
88
89 Around line 258:
90 =cut found outside a pod block. Skipping to next block.
91

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines