projects
/
nbd.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
44fbce1
)
r280: Revert recent nbd-client timeout changes; revised changes to follow
author
snitm <snitm>
Sat, 25 Aug 2007 22:35:53 +0000
(22:35 +0000)
committer
snitm <snitm>
Sat, 25 Aug 2007 22:35:53 +0000
(22:35 +0000)
nbd-client.8.sgml
patch
|
blob
|
history
nbd-client.c
patch
|
blob
|
history
diff --git
a/nbd-client.8.sgml
b/nbd-client.8.sgml
index
5362f85
..
17a147a
100644
(file)
--- a/
nbd-client.8.sgml
+++ b/
nbd-client.8.sgml
@@
-61,7
+61,6
@@
manpage.1: manpage.sgml
<arg choice=plain><option><replaceable>nbd-device</replaceable></option></arg>
<arg><option>-swap</option></arg>
<arg><option>-persist</option></arg>
<arg choice=plain><option><replaceable>nbd-device</replaceable></option></arg>
<arg><option>-swap</option></arg>
<arg><option>-persist</option></arg>
- <arg><option>-timeout <replaceable>timeout</replaceable></option></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>&dhpackage;</command>
</cmdsynopsis>
<cmdsynopsis>
<command>&dhpackage;</command>
diff --git
a/nbd-client.c
b/nbd-client.c
index
8771d40
..
f4836c5
100644
(file)
--- a/
nbd-client.c
+++ b/
nbd-client.c
@@
-160,7
+160,6
@@
int main(int argc, char *argv[]) {
char *hostname, *nbddev;
int swap=0;
int cont=0;
char *hostname, *nbddev;
int swap=0;
int cont=0;
- int timeout=0;
u64 size64;
u32 flags;
u64 size64;
u32 flags;
@@
-223,7
+222,7
@@
int main(int argc, char *argv[]) {
err("Can not open NBD: %m");
++argv; --argc; /* skip device */
err("Can not open NBD: %m");
++argv; --argc; /* skip device */
- if (argc>3) goto errmsg;
+ if (argc>2) goto errmsg;
if (argc!=0) {
if(strncmp(argv[0], "-swap", 5)==0) {
swap=1;
if (argc!=0) {
if(strncmp(argv[0], "-swap", 5)==0) {
swap=1;
@@
-236,17
+235,6
@@
int main(int argc, char *argv[]) {
++argv;--argc;
}
}
++argv;--argc;
}
}
- if(argc!=0) {
- if(strncmp(argv[0], "-timeout", 8)==0) {
-#ifdef NBD_SET_TIMEOUT
- timeout=strtol(++argv, NULL, 0);
- ++argv;--argc--;
-#else
- fprintf(stderr, "This nbd-client does not support -timeout yet; please recompile on a more recent kernel");
- exit(EXIT_FAILURE);
-#endif
- }
- }
argv=NULL; argc=0; /* don't use it later suddenly */
negotiate(sock, &size64, &flags);
argv=NULL; argc=0; /* don't use it later suddenly */
negotiate(sock, &size64, &flags);
@@
-261,12
+249,6
@@
int main(int argc, char *argv[]) {
exit(0);
#endif
exit(0);
#endif
-#ifdef NBD_SET_TIMEOUT
- if(ioctl(nbd, NBD_SET_TIMEOUT, &timeout)<0) {
- fprintf(stderr, "Setting timeout failed: %m");
- exit(EXIT_FAILURE);
- }
-#endif
do {
if (ioctl(nbd, NBD_DO_IT) < 0) {
fprintf(stderr, "Kernel call returned: %m");
do {
if (ioctl(nbd, NBD_DO_IT) < 0) {
fprintf(stderr, "Kernel call returned: %m");