Hello community,
here is the log from the commit of package nbd for openSUSE:Factory
checked in at Thu Jul 9 13:57:11 CEST 2009.
--------
--- nbd/nbd.changes 2009-05-04 13:38:00.000000000 +0200
+++ nbd/nbd.changes 2009-07-09 11:46:55.000000000 +0200
@@ -1,0 +2,21 @@
+Thu Jul 9 11:41:55 CEST 2009 - ms@suse.de
+
+- Update to nbd-2.9.13:
+ * Documentation update
+ * Don't try working on partitions
+ When a partition is given to the -d or -c command line options, reduce
+ it to the master device instead. This assumes udev-style naming
+ of device entries, though.
+ * Fix autodetection
+ Everything else in nbd-server was already 64bit-clean, but this part,
+ where the size of a block device is autodected, wasn't.
+ Replace the ioctl() to BLKGETSIZE with its 64bit version, so that trying
+ to detect the size of a multi-terabyte block device does not fail.
+ * Avoid unaligned access
+ * Actually go daemon
+ just doing chdir("/") leave file descriptors open, which is not ideal.
+ Doing it this way closes everything, including any system-specific
+ things we're not aware of.
+ * Remove support for timeout option
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
nbd-2.9.12-doc.diff
nbd-2.9.12-warn.diff
nbd-2.9.12.tar.bz2
New:
----
nbd-2.9.13-doc.diff
nbd-2.9.13-warn.diff
nbd-2.9.13.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nbd.spec ++++++
--- /var/tmp/diff_new_pack.iUx1q9/_old 2009-07-09 13:56:53.000000000 +0200
+++ /var/tmp/diff_new_pack.iUx1q9/_new 2009-07-09 13:56:53.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package nbd (Version 2.9.12)
+# spec file for package nbd (Version 2.9.13)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -21,15 +21,15 @@
Name: nbd
BuildRequires: doxygen glib2-devel
PreReq: %insserv_prereq coreutils
-Version: 2.9.12
+Version: 2.9.13
Release: 1
License: GPL v2 or later
Group: Productivity/Networking/Other
AutoReqProv: on
Source: %{name}-%{version}.tar.bz2
Source2: init.nbd-server
-Patch2: nbd-2.9.12-warn.diff
-Patch3: nbd-2.9.12-doc.diff
+Patch2: nbd-2.9.13-warn.diff
+Patch3: nbd-2.9.13-doc.diff
Summary: Network Block Device Server and Client Utilities
Url: http://nbd.sourceforge.net/
Prefix: /usr
@@ -166,106 +166,5 @@
%preun
%{stop_on_removal nbd-server}
+
%changelog
-* Mon May 04 2009 ms@suse.de
-- Update to nbd-2.9.12:
- * use atoll instead of atol ... so that multi-terabyte exports work, too
- * Change meaning of -swap option: rather than trying to use a kernel patch
- which has been effectively dead since sometime around 2.1.something, do an
- mlockall() so that the kernel won't throw us out. The MCL_CURRENT | MCL_FUTURE
- bit might prove to be problematic, but if so, we'll deal with it when
- we get there
- * Use right printf() format string
-* Wed Aug 20 2008 garloff@suse.de
-- Update to nbd-2.9.11:
- * nbd-client: new option -c to check for connection, -d to
- drop connection, -persist to infinitely retry connections
- dropped by server. timeout= setting
- * nbd-server: drop autoreadonly option
-* Thu Nov 15 2007 garloff@suse.de
-- Update to nbd-2.9.9:
- * Document -C option of nbd-server.
- * Fix name of /var/run/ file.
-* Wed Nov 07 2007 garloff@suse.de
-- Split nbd into nbd and nbd-doc packages.
-- Update to nbd-2.9.8:
- * nbd-server can now setuid to specified user and group.
- * prerun and postrun scripts can be specified.
- * IP address to bind to (listenaddress) can be configured.
- * Socket Direct Protocol (sdp) -- not enabled.
- * server exits now after connection has gone (oops!).
- * nbd-client: timeout parameter.
-* Mon Jul 30 2007 garloff@suse.de
-- Convert options from old nbd-server.conf to new nbd-server/config
- on update and drop support for old config file syntax.
-- Fix daemonize(0) segfault and pid filename.
-- Fix compiler warnings.
-- Fix /dev filename docu.
-- Use startproc, killproc, checkproc in init script
-- nbd-server does not support SIGHUP, fix init script accordingly.
-* Tue Jul 17 2007 garloff@suse.de
-- Update to nbd-2.9.5:
- * Support for more platforms, pkgconfig, debug build.
- * -o option to convert cmdline options to config file.
- * Fix duplication in handling nonblocking server socket.
-* Tue Mar 13 2007 garloff@suse.de
-- Update to 2.9.2:
- * make child socket nonblocking
- * Reintegrate fix for 64bit on looking for file size.
- * Fix cross-compiling
- * Search for libraries to allow linking on Solaris
-- Update to 2.9.1:
- * A fix for a piece of code following a null pointer, and one
- for a memory leak (if only minor).
-- Update to 2.9.0:
- * * Configuration file support
- * The ability to server multiple nbd-server exports from one server
- * Better multiple-file support (files can now be of any random size)
- * Better support for virtualizing servers (in addition to replacing
- %%s with the client's IP address, it is now also possible to use
- other options which allow for hashed directories)
- * Support for changing uid and gid after startup
- * The ability to do the copy-on-write stuff with a sparse file rather
- than a mapped file (specified by a config file option), which may be
- slightly faster.
-* Sat Nov 18 2006 garloff@suse.de
-- Add nbd-server init script (parses /etc/nbd-server.conf).
-* Thu Oct 19 2006 garloff@suse.de
-- Update to nbd-2.8.7:
- * A fix for build against nbd.h for kernel 2.6.18 (and above,
- presumably)
-* Fri Oct 13 2006 ro@suse.de
-- include linux/types.h before linux/nbd.h
-* Mon Aug 07 2006 garloff@suse.de
-- Update to nbd-2.8.6:
- * performance/reliability improvements: Use select() rather than
- accept() and waitpid() with WNOHANG rather than wait().
-- Update to nbd-2.8.5:
- * -persist option.
- * Add export verification.
- * Make sure queue is empty for write requests to read-only export.
-- Update to nbd-2.8.4:
- * Includes the previous fix (closing server socket)
-* Mon Mar 06 2006 garloff@suse.de
-- Make sure children quit when they finish serving, rather than
- trying to do stuff with a server socket that they've closed
- already in a loop. Whoops. (Fix from nbd-2.8.4.)
-* Wed Jan 25 2006 mls@suse.de
-- converted neededforbuild to BuildRequires
-* Mon Jan 23 2006 garloff@suse.de
-- Enable -fstack-protector.
-* Mon Jan 09 2006 garloff@suse.de
-- Update to nbd-2.8.3:
- * CVE-2005-3534.
- * A fix for 64bit systems regarding the BLKGETSIZE ioctl().
- * Better handling of SIGCHLD.
-* Tue Dec 20 2005 garloff@suse.de
-- Update to nbd-2.8.2:
- * Enable LFS by default.
-* Wed Nov 02 2005 dmueller@suse.de
-- don't build as root
-* Fri Oct 28 2005 garloff@suse.de
-- Update to version 2.8.1.
-- Documentation added.
-* Mon Jul 04 2005 garloff@suse.de
-- Initial creation of package.
++++++ nbd-2.9.12-doc.diff -> nbd-2.9.13-doc.diff ++++++
++++++ nbd-2.9.12-warn.diff -> nbd-2.9.13-warn.diff ++++++
++++++ nbd-2.9.12.tar.bz2 -> nbd-2.9.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbd-2.9.12/configure new/nbd-2.9.13/configure
--- old/nbd-2.9.12/configure 2009-04-30 15:05:58.000000000 +0200
+++ new/nbd-2.9.13/configure 2009-07-09 10:50:52.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for nbd 2.9.12.
+# Generated by GNU Autoconf 2.63 for nbd 2.9.13.
#
# Report bugs to .
#
@@ -596,8 +596,8 @@
# Identity of this package.
PACKAGE_NAME='nbd'
PACKAGE_TARNAME='nbd'
-PACKAGE_VERSION='2.9.12'
-PACKAGE_STRING='nbd 2.9.12'
+PACKAGE_VERSION='2.9.13'
+PACKAGE_STRING='nbd 2.9.13'
PACKAGE_BUGREPORT='wouter@debian.org'
# Factoring default headers for most tests.
@@ -1309,7 +1309,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures nbd 2.9.12 to adapt to many kinds of systems.
+\`configure' configures nbd 2.9.13 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1379,7 +1379,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of nbd 2.9.12:";;
+ short | recursive ) echo "Configuration of nbd 2.9.13:";;
esac
cat <<\_ACEOF
@@ -1477,7 +1477,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-nbd configure 2.9.12
+nbd configure 2.9.13
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1491,7 +1491,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by nbd $as_me 2.9.12, which was
+It was created by nbd $as_me 2.9.13, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2207,7 +2207,7 @@
# Define the identity of the package.
PACKAGE='nbd'
- VERSION='2.9.12'
+ VERSION='2.9.13'
cat >>confdefs.h <<_ACEOF
@@ -8962,7 +8962,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by nbd $as_me 2.9.12, which was
+This file was extended by nbd $as_me 2.9.13, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -9025,7 +9025,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-nbd config.status 2.9.12
+nbd config.status 2.9.13
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbd-2.9.12/configure.ac new/nbd-2.9.13/configure.ac
--- old/nbd-2.9.12/configure.ac 2009-04-30 15:04:43.000000000 +0200
+++ new/nbd-2.9.13/configure.ac 2009-07-01 16:20:22.000000000 +0200
@@ -1,7 +1,7 @@
dnl Configure script for NBD system
dnl (c) 1998 Martin Mares , (c) 2000 Pavel Machek ,
dnl (c) 2003-2006 Wouter Verhelst
-AC_INIT([nbd],[2.9.12],[wouter@debian.org])
+AC_INIT([nbd],[2.9.13],[wouter@debian.org])
AM_INIT_AUTOMAKE(foreign dist-bzip2)
AM_MAINTAINER_MODE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbd-2.9.12/nbd-client.8.in new/nbd-2.9.13/nbd-client.8.in
--- old/nbd-2.9.12/nbd-client.8.in 2009-04-30 14:52:55.000000000 +0200
+++ new/nbd-2.9.13/nbd-client.8.in 2009-06-05 21:52:09.000000000 +0200
@@ -3,13 +3,13 @@
.\" http://shell.ipoline.com/~elmert/comp/docbook2X/
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
-.TH "NBD-CLIENT" "8" "30 April 2009" "" ""
+.TH "NBD-CLIENT" "8" "26 May 2009" "" ""
.SH NAME
nbd-client \- connect to a server running nbd-server(1), to use its exported block device
.SH SYNOPSIS
-\fBnbd-client\fR [ \fBbs=\fIblocksize\fB\fR ] [ \fBtimeout=\fIseconds\fB\fR ] \fB\fIhost\fB\fR \fB\fIport\fB\fR \fB\fInbd-device\fB\fR [ \fB-sdp\fR ] [ \fB-swap\fR ] [ \fB-persist\fR ]
+\fBnbd-client\fR [ \fBbs=\fIblocksize\fB\fR ] [ \fBtimeout=\fIseconds\fB\fR ] \fB\fIhost\fB\fR \fB\fIport\fB\fR \fB\fInbd-device\fB\fR [ \fB-sdp\fR ] [ \fB-swap\fR ] [ \fB-persist\fR ] [ \fB-nofork\fR ]
\fBnbd-client\fR \fB-d \fInbd-device\fB\fR
@@ -87,10 +87,13 @@
.TP
\fB-swap\fR
Specifies that this NBD device will be used as
-swapspace. If you intend to do that, please use this
-option to prevent deadlocks. You'll need a special kernel
-patch, available at NBD's homepage:
-http://atrey.karlin.mff.cuni.cz/~pavel
+swapspace. This option attempts to prevent deadlocks by
+performing mlockall() at an appropriate time. It does not
+however guarantee that such deadlocks can be avoided.
+.TP
+\fB-nofork\fR
+Specifies that the NBD client should not detach and
+daemonize itself. This is mostly useful for debugging.
.SH "EXAMPLES"
.PP
Some examples of nbd-client usage:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbd-2.9.12/nbd-client.8.sgml new/nbd-2.9.13/nbd-client.8.sgml
--- old/nbd-2.9.12/nbd-client.8.sgml 2009-04-30 14:49:38.000000000 +0200
+++ new/nbd-2.9.13/nbd-client.8.sgml 2009-06-05 21:43:02.000000000 +0200
@@ -63,6 +63,7 @@
<arg><option>-sdp</option></arg>
<arg><option>-swap</option></arg>
<arg><option>-persist</option></arg>
+ <arg><option>-nofork</option></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>&dhpackage;</command>
@@ -175,12 +176,17 @@
<term><option>-swap</option></term>
<listitem>
<para>Specifies that this NBD device will be used as
- swapspace. If you intend to do that, please use this
- option to prevent deadlocks. You'll need a special kernel
- patch, available at NBD's homepage:
- http://atrey.karlin.mff.cuni.cz/~pavel</para>
+ swapspace. This option attempts to prevent deadlocks by
+ performing mlockall() at an appropriate time. It does not
+ however guarantee that such deadlocks can be avoided.</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>-nofork</option></term>
+ <listitem>
+ <para>Specifies that the NBD client should not detach and
+ daemonize itself. This is mostly useful for debugging.</para>
+ </varlistentry>
</variablelist>
</refsect1>
<refsect1>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbd-2.9.12/nbd-client.c new/nbd-2.9.13/nbd-client.c
--- old/nbd-2.9.12/nbd-client.c 2009-04-30 14:49:38.000000000 +0200
+++ new/nbd-2.9.13/nbd-client.c 2009-06-06 10:51:11.000000000 +0200
@@ -41,11 +41,16 @@
int check_conn(char* devname, int do_print) {
char buf[256];
+ char* p;
int fd;
int len;
if(!strncmp(devname, "/dev/", 5)) {
devname+=5;
}
+ if((p=strchr(devname, 'p'))) {
+ /* We can't do checks on partitions. */
+ *p='\0';
+ }
snprintf(buf, 256, "/sys/block/%s/pid", devname);
if((fd=open(buf, O_RDONLY))<0) {
if(errno==ENOENT) {
@@ -209,6 +214,7 @@
int cont=0;
int timeout=0;
int sdp=0;
+ int nofork=0;
u64 size64;
u32 flags;
@@ -217,7 +223,7 @@
if (argc < 3) {
errmsg:
fprintf(stderr, "nbd-client version %s\n", PACKAGE_VERSION);
- fprintf(stderr, "Usage: nbd-client [bs=blocksize] [timeout=sec] host port nbd_device [-swap] [-persist]\n");
+ fprintf(stderr, "Usage: nbd-client [bs=blocksize] [timeout=sec] host port nbd_device [-swap] [-persist] [-nofork]\n");
fprintf(stderr, "Or : nbd-client -d nbd_device\n");
fprintf(stderr, "Or : nbd-client -c nbd_device\n");
fprintf(stderr, "Default value for blocksize is 1024 (recommended for ethernet)\n");
@@ -232,7 +238,7 @@
if (strcmp(argv[0], "-d")==0) {
nbd = open(argv[1], O_RDWR);
if (nbd < 0)
- err("Can not open NBD: %m");
+ err("Cannot open NBD: %m\nPlease ensure the 'nbd' module is loaded.");
printf("Disconnecting: que, ");
if (ioctl(nbd, NBD_CLEAR_QUE)< 0)
err("Ioctl failed: %m\n");
@@ -276,7 +282,7 @@
nbddev = argv[0];
nbd = open(nbddev, O_RDWR);
if (nbd < 0)
- err("Can not open NBD: %m");
+ err("Cannot open NBD: %m\nPlease ensure the 'nbd' module is loaded.");
++argv; --argc; /* skip device */
if (argc>3) goto errmsg;
@@ -298,6 +304,12 @@
++argv;--argc;
}
}
+ if (argc) {
+ if(strncmp(argv[0], "-nofork", 7)==0) {
+ nofork=1;
+ ++argv;--argc;
+ }
+ }
if(argc) goto errmsg;
sock = opennet(hostname, port, sdp);
argv=NULL; argc=0; /* don't use it later suddenly */
@@ -309,15 +321,17 @@
/* Go daemon */
- chdir("/");
+ daemon(0,0);
do {
#ifndef NOFORK
- if (fork()) {
- while(check_conn(nbddev, 0)) {
- sleep(1);
+ if (!nofork) {
+ if (fork()) {
+ while(check_conn(nbddev, 0)) {
+ sleep(1);
+ }
+ open(nbddev, O_RDONLY);
+ exit(0);
}
- open(nbddev, O_RDONLY);
- exit(0);
}
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbd-2.9.12/nbd-server.1.in new/nbd-2.9.13/nbd-server.1.in
--- old/nbd-2.9.12/nbd-server.1.in 2009-04-30 14:49:38.000000000 +0200
+++ new/nbd-2.9.13/nbd-server.1.in 2009-07-09 10:51:01.000000000 +0200
@@ -3,13 +3,13 @@
.\" http://shell.ipoline.com/~elmert/comp/docbook2X/
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
-.TH "NBD-SERVER" "1" "03 January 2009" "" ""
+.TH "NBD-SERVER" "1" "09 July 2009" "" ""
.SH NAME
nbd-server \- serve a file as a block device to other computers running the GNU/Linux(tm) or GNU/Hurd Operating System
.SH SYNOPSIS
-\fBnbd-server \fR \fB\fI[ip:]port\fB\fR \fB\fIfilename\fB\fR [ \fB\fIsize\fB\fR ] [ \fB-r\fR ] [ \fB-m\fR ] [ \fB-c\fR ] [ \fB-a \fItimeout\fB\fR ] [ \fB-l \fIhost list filename\fB\fR ] [ \fB-o \fIsection name\fB\fR ] [ \fB-C \fIconfig file\fB\fR ]
+\fBnbd-server \fR \fB\fI[ip:]port\fB\fR \fB\fIfilename\fB\fR [ \fB\fIsize\fB\fR ] [ \fB-r\fR ] [ \fB-m\fR ] [ \fB-c\fR ] [ \fB-l \fIhost list filename\fB\fR ] [ \fB-o \fIsection name\fB\fR ] [ \fB-C \fIconfig file\fB\fR ]
.SH "DESCRIPTION"
.PP
@@ -99,12 +99,12 @@
file entirely, either move it away or use the -C option to
point \fBnbd-server\fR(1) to a non-existing or
empty configuration file.
-.TP
-\fBtimeout\fR
-Maximum number of idle seconds. If a connection is
-inactive for this amount of time, it is terminated; this is to
-avoid stale nbd-server processes staying in memory. Use of
-this option is strongly recommended.
+
+Also note that if an empty, incomplete, or invalid
+configuration file is specified, nbd-server will produce a
+warning about failure to parse the config file. If the
+command line contains a fully specified configuration, this
+warning is harmless and may be ignored.
.TP
\fBhost list filename\fR
This argument should contain a list of IP-addresses
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbd-2.9.12/nbd-server.1.sgml new/nbd-2.9.13/nbd-server.1.sgml
--- old/nbd-2.9.12/nbd-server.1.sgml 2009-04-30 14:49:38.000000000 +0200
+++ new/nbd-2.9.13/nbd-server.1.sgml 2009-07-09 10:49:50.000000000 +0200
@@ -63,7 +63,6 @@
<arg><option>-r</option></arg>
<arg><option>-m</option></arg>
<arg><option>-c</option></arg>
- <arg><option>-a <replaceable>timeout</replaceable></option></arg>
<arg><option>-l <replaceable>host list filename</replaceable></option></arg>
<arg><option>-o <replaceable>section name</replaceable></option></arg>
<arg><option>-C <replaceable>config file</replaceable></option></arg>
@@ -184,15 +183,11 @@
file entirely, either move it away or use the -C option to
point <command>nbd-server</command>(1) to a non-existing or
empty configuration file.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><option>timeout</option></term>
- <listitem>
- <para>Maximum number of idle seconds. If a connection is
- inactive for this amount of time, it is terminated; this is to
- avoid stale nbd-server processes staying in memory. Use of
- this option is strongly recommended.</para>
+ <para>Also note that if an empty, incomplete, or invalid
+ configuration file is specified, nbd-server will produce a
+ warning about failure to parse the config file. If the
+ command line contains a fully specified configuration, this
+ warning is harmless and may be ignored.</para>
</listitem>
</varlistentry>
<varlistentry>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbd-2.9.12/nbd-server.c new/nbd-2.9.13/nbd-server.c
--- old/nbd-2.9.12/nbd-server.c 2009-04-30 14:49:38.000000000 +0200
+++ new/nbd-2.9.13/nbd-server.c 2009-06-08 23:02:02.000000000 +0200
@@ -176,8 +176,6 @@
unsigned int port; /**< port we're exporting this file at */
char* authname; /**< filename of the authorization file */
int flags; /**< flags associated with this exported file */
- unsigned int timeout;/**< how long a connection may be idle
- (0=forever) */
int socket; /**< The socket of this server. */
VIRT_STYLE virtstyle;/**< The style of virtualization, if any */
uint8_t cidrlen; /**< The length of the mask when we use
@@ -335,7 +333,7 @@
*/
void usage() {
printf("This is nbd-server version " VERSION "\n");
- printf("Usage: [ip:]port file_to_export [size][kKmM] [-l authorize_file] [-r] [-m] [-c] [-a timeout_sec] [-C configuration file] [-p PID file name] [-o section name]\n"
+ printf("Usage: [ip:]port file_to_export [size][kKmM] [-l authorize_file] [-r] [-m] [-c] [-C configuration file] [-p PID file name] [-o section name]\n"
"\t-r|--read-only\t\tread only\n"
"\t-m|--multi-file\t\tmultiple file\n"
"\t-c|--copy-on-write\tcopy on write\n"
@@ -372,9 +370,6 @@
if(serve->authname) {
printf("\tauthfile = %s\n", serve->authname);
}
- if(serve->timeout) {
- printf("\ttimeout = %d\n", serve->timeout);
- }
exit(EXIT_SUCCESS);
}
@@ -478,9 +473,6 @@
g_free(serve->authname);
serve->authname=g_strdup(optarg);
break;
- case 'a':
- serve->timeout=strtol(optarg, NULL, 0);
- break;
default:
usage();
exit(EXIT_FAILURE);
@@ -549,7 +541,6 @@
{ "exportname", TRUE, PARAM_STRING, NULL, 0 },
{ "port", TRUE, PARAM_INT, NULL, 0 },
{ "authfile", FALSE, PARAM_STRING, NULL, 0 },
- { "timeout", FALSE, PARAM_INT, NULL, 0 },
{ "filesize", FALSE, PARAM_INT, NULL, 0 },
{ "virtstyle", FALSE, PARAM_STRING, NULL, 0 },
{ "prerun", FALSE, PARAM_STRING, NULL, 0 },
@@ -600,14 +591,13 @@
lp[0].target=&(s.exportname);
lp[1].target=&(s.port);
lp[2].target=&(s.authname);
- lp[3].target=&(s.timeout);
- lp[4].target=&(s.expected_size);
- lp[5].target=&(virtstyle);
- lp[6].target=&(s.prerun);
- lp[7].target=&(s.postrun);
- lp[8].target=lp[9].target=lp[10].target=
- lp[11].target=lp[12].target=&(s.flags);
- lp[13].target=&(s.listenaddr);
+ lp[3].target=&(s.expected_size);
+ lp[4].target=&(virtstyle);
+ lp[5].target=&(s.prerun);
+ lp[6].target=&(s.postrun);
+ lp[7].target=lp[8].target=lp[9].target=
+ lp[10].target=lp[11].target=&(s.flags);
+ lp[12].target=&(s.listenaddr);
/* After the [generic] group, start parsing exports */
if(i==1) {
@@ -780,19 +770,18 @@
**/
off_t size_autodetect(int fhandle) {
off_t es;
- unsigned long sectors;
+ u64 bytes;
struct stat stat_buf;
int error;
#ifdef HAVE_SYS_MOUNT_H
#ifdef HAVE_SYS_IOCTL_H
-#ifdef BLKGETSIZE
- DEBUG("looking for export size with ioctl BLKGETSIZE\n");
- if (!ioctl(fhandle, BLKGETSIZE, §ors) && sectors) {
- es = (off_t)sectors * (off_t)512;
- return es;
+#ifdef BLKGETSIZE64
+ DEBUG("looking for export size with ioctl BLKGETSIZE64\n");
+ if (!ioctl(fhandle, BLKGETSIZE64, bytes) && bytes) {
+ return (off_t)bytes;
}
-#endif /* BLKGETSIZE */
+#endif /* BLKGETSIZE64 */
#endif /* HAVE_SYS_IOCTL_H */
#endif /* HAVE_SYS_MOUNT_H */
@@ -1117,8 +1106,6 @@
i++;
printf("%d: ", i);
#endif
- if (client->server->timeout)
- alarm(client->server->timeout);
readit(client->net, &request, sizeof(request));
request.from = ntohll(request.from);
request.type = ntohl(request.type);
@@ -1647,6 +1634,35 @@
}
}
+#ifndef ISSERVER
+void glib_message_syslog_redirect(const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *message,
+ gpointer user_data)
+{
+ int level=LOG_DEBUG;
+
+ switch( log_level )
+ {
+ case G_LOG_FLAG_FATAL:
+ case G_LOG_LEVEL_CRITICAL:
+ case G_LOG_LEVEL_ERROR:
+ level=LOG_ERR;
+ break;
+ case G_LOG_LEVEL_WARNING:
+ level=LOG_WARNING;
+ break;
+ case G_LOG_LEVEL_MESSAGE:
+ case G_LOG_LEVEL_INFO:
+ level=LOG_INFO;
+ break;
+ case G_LOG_LEVEL_DEBUG:
+ level=LOG_DEBUG;
+ }
+ syslog(level, message);
+}
+#endif
+
/**
* Main entry point...
**/
@@ -1666,10 +1682,7 @@
config_file_pos = g_strdup(CFILE);
serve=cmdline(argc, argv);
servers = parse_cfile(config_file_pos, &err);
- if(!servers || !servers->len) {
- g_warning("Could not parse config file: %s",
- err ? err->message : "Unknown error");
- }
+
if(serve) {
g_array_append_val(servers, *serve);
@@ -1684,6 +1697,7 @@
close(2);
open("/dev/null", O_WRONLY);
open("/dev/null", O_WRONLY);
+ g_log_set_default_handler( glib_message_syslog_redirect, NULL );
#endif
client=g_malloc(sizeof(CLIENT));
client->server=serve;
@@ -1694,6 +1708,12 @@
return 0;
}
}
+
+ if(!servers || !servers->len) {
+ g_warning("Could not parse config file: %s",
+ err ? err->message : "Unknown error");
+ }
+
if((!serve) && (!servers||!servers->len)) {
g_message("Nothing to do! Bye!");
exit(EXIT_FAILURE);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbd-2.9.12/nbd-tester-client.c new/nbd-2.9.13/nbd-tester-client.c
--- old/nbd-2.9.12/nbd-tester-client.c 2009-01-07 13:03:35.000000000 +0100
+++ new/nbd-2.9.13/nbd-tester-client.c 2009-06-05 21:52:20.000000000 +0200
@@ -245,7 +245,7 @@
}
for(i=0;i+1024<=size;i+=1024) {
if(do_write) {
- *((u64*)req.handle)=i;
+ memcpy(&(req.handle),&i,sizeof(i));
req.from=htonll(i);
write(sock, &req, sizeof(req));
printf("Requests(+): %d\n", ++requests);
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org