r280: Revert recent nbd-client timeout changes; revised changes to follow
authorsnitm <snitm>
Sat, 25 Aug 2007 22:35:53 +0000 (22:35 +0000)
committersnitm <snitm>
Sat, 25 Aug 2007 22:35:53 +0000 (22:35 +0000)
nbd-client.8.sgml
nbd-client.c

index 5362f85..17a147a 100644 (file)
@@ -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><option>-timeout <replaceable>timeout</replaceable></option></arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>&dhpackage;</command>
index 8771d40..f4836c5 100644 (file)
@@ -160,7 +160,6 @@ int main(int argc, char *argv[]) {
        char *hostname, *nbddev;
        int swap=0;
        int cont=0;
-       int timeout=0;
        u64 size64;
        u32 flags;
 
@@ -223,7 +222,7 @@ int main(int argc, char *argv[]) {
          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;
@@ -236,17 +235,6 @@ int main(int argc, char *argv[]) {
                        ++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);
@@ -261,12 +249,6 @@ int main(int argc, char *argv[]) {
                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");