annotate toys/pending/nbd_client.c @ 1276:d48bdc1cb017 draft

Switch human_readable() to just outputing decimal kilo/mega/gigabytes, make du use it, move it from lib/pending.c to lib.c.
author Rob Landley <rob@landley.net>
date Tue, 06 May 2014 06:31:28 -0500
parents e11684e3bbc5
children 85f297591693
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 /* vi: set sw=4 ts=4:
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
2 *
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 * nbd-client.c - network block device client
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
4 *
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 * Copyright 2010 Rob Landley <rob@landley.net>
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
6 *
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
7 * Not in SUSv4.
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
8
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
9 USE_NBD_CLIENT(NEWTOY(nbd_client, "<3>3ns", TOYFLAG_USR|TOYFLAG_BIN))
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
10
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
11 config NBD_CLIENT
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
12 bool "nbd-client"
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
13 default n
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
14 help
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
15 usage: nbd-client [-ns] HOST PORT DEVICE
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
16
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
17 -n Do not fork into background
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
18 -s nbd swap support (lock server into memory)
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
19 */
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
20
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
21 /*
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
22 Usage: nbd-client [-sSpn] [-b BLKSZ] [-t SECS] [-N name] HOST PORT DEVICE
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
23
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
24 -b block size
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
25 -t timeout in seconds
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 -S sdp
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
27 -p persist
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
28 -n nofork
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
29 -d DEVICE
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
30 -c DEVICE
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
31 */
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
32
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
33 #define FOR_nbd_client
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
34 #include "toys.h"
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
35
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
36 #define NBD_SET_SOCK _IO(0xab, 0)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
37 #define NBD_SET_BLKSIZE _IO(0xab, 1)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
38 #define NBD_SET_SIZE _IO(0xab, 2)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
39 #define NBD_DO_IT _IO(0xab, 3)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
40 #define NBD_CLEAR_SOCK _IO(0xab, 4)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
41 #define NBD_CLEAR_QUEUE _IO(0xab, 5)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
42 #define NBD_PRINT_DEBUG _IO(0xab, 6)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
43 #define NBD_SET_SIZE_BLOCKS _IO(0xab, 7)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
44 #define NBD_DISCONNECT _IO(0xab, 8)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
45 #define NBD_SET_TIMEOUT _IO(0xab, 9)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
46
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
47 void nbd_client_main(void)
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
48 {
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
49 int sock = -1, nbd, flags;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
50 unsigned long timeout = 0;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
51 struct addrinfo *addr, *p;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
52 char *host=toys.optargs[0], *port=toys.optargs[1], *device=toys.optargs[2];
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
53 uint64_t devsize;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
54
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
55 // Repeat until spanked
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
56
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
57 nbd = xopen(device, O_RDWR);
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
58 for (;;) {
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
59 int temp;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
60 struct addrinfo hints;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
61
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
62 // Find and connect to server
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
63
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
64 memset(&hints, 0, sizeof(hints));
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
65 hints.ai_family = PF_UNSPEC;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
66 hints.ai_socktype = SOCK_STREAM;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
67 if (getaddrinfo(host, port, &hints, &addr)) addr = 0;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
68 for (p = addr; p; p = p->ai_next) {
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
69 sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
70 if (-1 != connect(sock, p->ai_addr, p->ai_addrlen)) break;
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
71 close(sock);
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
72 }
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
73 freeaddrinfo(addr);
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
74
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
75 if (!p) perror_exit("%s:%s", host, port);
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
76
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
77 temp = 1;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
78 setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &temp, sizeof(int));
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
79
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
80 // Read login data
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
81
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
82 xreadall(sock, toybuf, 152);
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
83 if (memcmp(toybuf, "NBDMAGIC\x00\x00\x42\x02\x81\x86\x12\x53", 16))
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
84 error_exit("bad login %s:%s", host, port);
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
85 devsize = SWAP_BE64(*(uint64_t *)(toybuf+16));
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
86 flags = SWAP_BE32(*(int *)(toybuf+24));
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
87
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
88 // Set 4k block size. Everything uses that these days.
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
89 ioctl(nbd, NBD_SET_BLKSIZE, 4096);
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
90 ioctl(nbd, NBD_SET_SIZE_BLOCKS, devsize/4096);
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
91 ioctl(nbd, NBD_CLEAR_SOCK);
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
92
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
93 // If the sucker was exported read only, respect that locally.
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
94 temp = (flags & 2) ? 1 : 0;
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
95 xioctl(nbd, BLKROSET, &temp);
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
96
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
97 if (timeout && ioctl(nbd, NBD_SET_TIMEOUT, timeout)<0) break;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
98 if (ioctl(nbd, NBD_SET_SOCK, sock) < 0) break;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
99
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
100 if (toys.optflags & FLAG_s) mlockall(MCL_CURRENT|MCL_FUTURE);
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
101
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
102 // Open the device to force reread of the partition table.
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
103 if ((toys.optflags & FLAG_n) || !fork()) {
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
104 char *s = strrchr(device, '/');
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
105 int i;
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
106
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
107 sprintf(toybuf, "/sys/block/%.32s/pid", s ? s+1 : device);
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
108 // Is it up yet? (Give it 10 seconds.)
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
109 for (i=0; i<100; i++) {
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
110 temp = open(toybuf, O_RDONLY);
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
111 if (temp == -1) msleep(100);
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
112 else {
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
113 close(temp);
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
114 break;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
115 }
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
116 }
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
117 close(open(device, O_RDONLY));
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
118 if (!(toys.optflags & FLAG_n)) exit(0);
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
119 }
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
120
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
121 // Daemonize here.
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
122
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
123 daemon(0,0);
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
124
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
125 // Process NBD requests until further notice.
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
126
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
127 if (ioctl(nbd, NBD_DO_IT)>=0 || errno==EBADR) break;
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
128 close(sock);
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
129 }
893
6f5fed66c722 Some work I did over the weekend on nbd_client, not sure where I left off...
Rob Landley <rob@landley.net>
parents: 822
diff changeset
130 close(nbd);
822
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
131
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
132 // Flush queue and exit.
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
133
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
134 ioctl(nbd, NBD_CLEAR_QUEUE);
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
135 ioctl(nbd, NBD_CLEAR_SOCK);
84959a5529e8 The old nbd-client I wrote in 2010. Needs cleanup.
Rob Landley <rob@landley.net>
parents:
diff changeset
136 }