[PATCH] v2v: -o rhv-upload: adapt phony ovirtsdk4 module to recent changes
by Pino Toscano
Add the missing objects, methods, variables, and relations among the
various objects.
Followup/fixes commit c49aa4fe01aac82d4776dd2a3524ce16e6deed06, and
commit 8118f28b6ff93c11f92fd65873285c2eba10ea0a.
---
.../ovirtsdk4/__init__.py | 25 +++++++++++++------
.../ovirtsdk4/types.py | 19 ++++++++++----
2 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py b/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py
index 2ceb07c0c..09d861d35 100644
--- a/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py
+++ b/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py
@@ -32,12 +32,16 @@ class Connection(object):
ca_file = None,
log = None,
insecure = False,
+ debug=True,
):
pass
def close(self):
pass
+ def follow_link(self, objs):
+ return objs
+
def system_service(self):
return SystemService()
@@ -60,26 +64,31 @@ class SystemService(object):
def vms_service(self):
return VmsService()
+class ClusterService(object):
+ def get(self):
+ return types.Cluster()
+
class ClustersService(object):
- def list(self, search=None, case_sensitive=False):
- return ["Default"]
+ def cluster_service(self, id):
+ return ClusterService()
class DataCentersService(object):
def list(self, search=None, case_sensitive=False):
- return []
+ return [types.DataCenter()]
class DiskService(object):
def __init__(self, disk_id):
self._disk_id = disk_id
def get(self):
- return types.Disk()
+ return types.Disk(id=self._disk_id)
def remove(self):
pass
class DisksService(object):
def add(self, disk=None):
+ disk.id = "756d81b0-d5c0-41bc-9bbe-b343c3fa3490"
return disk
def disk_service(self, disk_id):
@@ -89,6 +98,9 @@ class ImageTransferService(object):
def __init__(self):
self._finalized = False
+ def cancel(self):
+ pass
+
def get(self):
if self._finalized:
raise NotFoundError
@@ -105,11 +117,8 @@ class ImageTransfersService(object):
def image_transfer_service(self, id):
return ImageTransferService()
-class StorageDomain(object):
- id = "ba87af68-b630-4211-a73a-694c1a689405"
-
class StorageDomainsService(object):
- def list(self, search=None):
+ def list(self, search=None, case_sensitive=False):
return [ StorageDomain() ]
class VmsService(object):
diff --git a/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/types.py b/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/types.py
index 60ba541cd..0b165c242 100644
--- a/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/types.py
+++ b/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/types.py
@@ -22,12 +22,13 @@ from enum import Enum
from ovirtsdk4 import imageio_port
class Cluster(object):
- def __init__(self, name):
- pass
+ id = "2e97537b-a783-4706-af9e-75cb2e032dcd"
+ name = "Default"
class Configuration(object):
def __init__(self, type=None, data=None):
pass
+
class ConfigurationType(Enum):
OVA = 'ova'
OVF = 'ovf'
@@ -71,9 +72,8 @@ class Disk(object):
sparse = False,
storage_domains = None
):
- pass
+ self.id = id
- id = "123"
status = DiskStatus.OK
class ImageTransferPhase(Enum):
@@ -104,7 +104,7 @@ class ImageTransfer(object):
):
pass
- id = "456"
+ id = "e26ac8ab-7090-4d5e-95ad-e707b511a359"
phase = ImageTransferPhase.TRANSFERRING
transfer_url = "http://localhost:" + str(imageio_port) + "/"
@@ -116,6 +116,9 @@ class StorageDomain(object):
def __init__(self, name = None):
pass
+ id = "ba87af68-b630-4211-a73a-694c1a689405"
+ name = "Storage"
+
class Vm(object):
def __init__(
self,
@@ -123,3 +126,9 @@ class Vm(object):
initialization = None
):
pass
+
+class DataCenter(object):
+ id = "31d8c73b-554b-4958-bb04-9ce97f0849e1"
+ name = "DC"
+ storage_domains = [StorageDomain()]
+ clusters = [Cluster()]
--
2.21.0
5 years, 1 month
[PATCH] build: remove unused gnulib modules
by Pino Toscano
Remove gnulib modules that provide stuff clearly not used within
libguestfs (library, daemon, and C tools). Among directly and
indirectly modules used previous (and now no more), they are:
cycle-check
dev-ino
dup3
dup3-tests
fcntl-safer
fcntl-safer-tests
filevercmp
filevercmp-tests
fts
getaddrinfo
getaddrinfo-tests
hostent
i-ring
i-ring-tests
inet_ntop
inet_ntop-tests
isatty
isatty-tests
openat-safer
openat-safer-tests
opendirat
ptsname_r
ptsname_r-tests
servent
ttyname_r
ttyname_r-tests
Some of the removed modules are still used pulled indirectly as
dependency of other modules. There should be no behaviour change on
recent Linux distros, although older distros were not tested (adding
a module back is easy, anyway).
Remove accordingly unused automake variables, and ignored files.
---
bootstrap | 9 ---------
daemon/Makefile.am | 4 ----
lib/Makefile.am | 4 ----
m4/.gitignore | 39 ---------------------------------------
4 files changed, 56 deletions(-)
diff --git a/bootstrap b/bootstrap
index aaf038d98..ee253b471 100755
--- a/bootstrap
+++ b/bootstrap
@@ -104,7 +104,6 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
modules='
accept4
-areadlink
areadlinkat
arpa_inet
base64
@@ -113,15 +112,11 @@ c-ctype
cloexec
closeout
connect
-dup3
error
-filevercmp
fstatat
-fts
full-read
full-write
futimens
-getaddrinfo
getline
getprogname
gitlog-to-changelog
@@ -143,22 +138,18 @@ mkstemps
netdb
netinet_in
nonblocking
-openat
perror
pipe2
pread
-ptsname_r
read-file
readlink
select
setenv
sleep
socket
-stat-time
strchrnul
strerror
strndup
-symlinkat
sys_select
sys_types
sys_wait
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 49dbf1998..7c71920c4 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -225,13 +225,9 @@ guestfsd_LDADD = \
$(HIVEX_LIBS) \
$(SD_JOURNAL_LIBS) \
$(top_builddir)/gnulib/lib/.libs/libgnu.a \
- $(GETADDRINFO_LIB) \
- $(HOSTENT_LIB) \
- $(INET_NTOP_LIB) \
$(LIBSOCKET) \
$(LIB_CLOCK_GETTIME) \
$(LIBINTL) \
- $(SERVENT_LIB) \
$(PCRE_LIBS) \
$(TSK_LIBS) \
$(RPC_LIBS) \
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 95b5edb4e..97d3d8d6b 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -154,15 +154,11 @@ libguestfs_la_LIBADD = \
$(SELINUX_LIBS) \
$(JANSSON_LIBS) \
../gnulib/lib/libgnu.la \
- $(GETADDRINFO_LIB) \
- $(HOSTENT_LIB) \
- $(INET_NTOP_LIB) \
$(LIBSOCKET) \
$(LIB_CLOCK_GETTIME) \
$(LTLIBINTL) \
$(LTLIBTHREAD) \
$(LTLIBICONV) \
- $(SERVENT_LIB) \
$(RPC_LIBS)
# Force libtool to name the library 'libguestfs.so.0.$(MAX_PROC_NR).0'.
diff --git a/m4/.gitignore b/m4/.gitignore
index 16ae9c415..705b090f5 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -2,51 +2,40 @@
/absolute-header.m4
/accept4.m4
/alloca.m4
-/argmatch.m4
/arpa_inet_h.m4
/asm-underscore.m4
/base64.m4
/btowc.m4
/builtin-expect.m4
/byteswap.m4
-/canonicalize-lgpl.m4
/chdir-long.m4
-/chown.m4
/clock_time.m4
-/cloexec.m4
/closedir.m4
/close.m4
/codeset.m4
/ctype.m4
-/cycle-check.m4
/d-ino.m4
/dirent_h.m4
/dirfd.m4
/dirname.m4
-/dos.m4
/double-slash-root.m4
/d-type.m4
/dup2.m4
-/dup3.m4
/dup.m4
/eealloc.m4
/environ.m4
/errno_h.m4
/error.m4
-/exitfail.m4
/exponentd.m4
/extensions.m4
/extern-inline.m4
/fatal-signal.m4
/fchdir.m4
-/fclose.m4
/fcntl_h.m4
/fcntl.m4
/fcntl-o.m4
-/fcntl-safer.m4
/fdopendir.m4
/fdopen.m4
-/fflush.m4
/filenamecat.m4
/flexmember.m4
/float_h.m4
@@ -54,23 +43,18 @@
/fnmatch.m4
/fpending.m4
/fpieee.m4
-/fpurge.m4
-/freading.m4
/fseeko.m4
/fstatat.m4
/fstat.m4
/ftell.m4
/ftello.m4
/ftruncate.m4
-/fts.m4
/futimens.m4
-/getaddrinfo.m4
/getcwd-abort-bug.m4
/getcwd.m4
/getcwd-path-max.m4
/getdelim.m4
/getdtablesize.m4
-/getgroups.m4
/getline.m4
/getlogin.m4
/getlogin_r.m4
@@ -79,20 +63,16 @@
/getprogname.m4
/gettime.m4
/gettimeofday.m4
-/getugroups.m4
/glob_h.m4
/glob.m4
/gnulib-common.m4
/gnulib-comp.m4
/gnulib-tool.m4
/gnu-make.m4
-/hash.m4
/host-cpu-c-abi.m4
-/hostent.m4
/human.m4
/iconv.m4
/include_next.m4
-/inet_ntop.m4
/inet_pton.m4
/__inline.m4
/intlmacosx.m4
@@ -103,13 +83,9 @@
/inttypes.m4
/inttypes-pri.m4
/ioctl.m4
-/i-ring.m4
-/isatty.m4
/isblank.m4
-/isc-posix.m4
/langinfo_h.m4
/largefile.m4
-/lchown.m4
/lcmessage.m4
/lib-ld.m4
/lib-link.m4
@@ -125,7 +101,6 @@
/locale-zh.m4
/localtime-buffer.m4
/lock.m4
-/longdouble.m4
/longlong.m4
/lseek.m4
/lstat.m4
@@ -143,7 +118,6 @@
/memmem.m4
/mempcpy.m4
/memrchr.m4
-/mgetgroups.m4
/minmax.m4
/mkdir.m4
/mkdtemp.m4
@@ -175,7 +149,6 @@
/pthread_rwlock_rdlock.m4
/pthread_sigmask.m4
/pthread-thread.m4
-/ptsname_r.m4
/putenv.m4
/quotearg.m4
/quote.m4
@@ -194,7 +167,6 @@
/save-cwd.m4
/sched_h.m4
/select.m4
-/servent.m4
/setenv.m4
/setlocale.m4
/sh-filename.m4
@@ -202,7 +174,6 @@
/sig_atomic_t.m4
/signalblocking.m4
/signal_h.m4
-/signed.m4
/size_max.m4
/sleep.m4
/snprintf.m4
@@ -230,11 +201,8 @@
/string_h.m4
/strndup.m4
/strnlen.m4
-/strtoimax.m4
/strtoll.m4
-/strtol.m4
/strtoull.m4
-/strtoul.m4
/strtoumax.m4
/symlinkat.m4
/symlink.m4
@@ -252,8 +220,6 @@
/time_h.m4
/timespec.m4
/tls.m4
-/ttyname_r.m4
-/ulonglong.m4
/ungetc.m4
/unistd_h.m4
/unistd-safer.m4
@@ -261,7 +227,6 @@
/unlinkdir.m4
/unlink.m4
/usleep.m4
-/utimbuf.m4
/utimecmp.m4
/utime_h.m4
/utime.m4
@@ -276,20 +241,16 @@
/warnings.m4
/warn-on-use.m4
/wchar_h.m4
-/wchar.m4
/wchar_t.m4
/wcrtomb.m4
/wctob.m4
/wctomb.m4
/wctype_h.m4
-/wctype.m4
/wint_t.m4
/write.m4
/xalloc.m4
/xgetcwd.m4
/xsize.m4
-/xstrndup.m4
-/xstrtol.m4
/xstrtol.m4
/xvasprintf.m4
/yield.m4
--
2.21.0
5 years, 1 month
[nbdkit PATCH] server: Saner filter .close calls
by Eric Blake
I found a core dump:
term1$ nbdkit -fv --filter=xz null xz-max-depth=$((0x4000000000000000))
term1...
term2$ qemu-nbd --list
term1...
nbdkit: debug: null: open readonly=1
nbdkit: error: calloc: Cannot allocate memory
nbdkit: debug: xz: close
Segmentation fault (core dumped)
(Note that the use of --run or daemonizing nbdkit makes it a bit
harder to see the core dump, but it is still happening.)
This happens because xz's .open fails after null's has succeeded, so
the cleanup code sees that it needs to call the .close chain (based
solely on whether the plugin's handle is non-NULL). However, our code
would call into a filter's .close even if handle was NULL (this is
because we did not distinguish between a filter that failed .open,
like xz, vs. a filter that lacks an override for .open). And calling
xz.close(NULL) causes a SIGSEGV. Of course, we could patch the xz
filter to paper over this by short-circuiting if handle is NULL, but a
more generic fix to this is to make filters.c always set a non-NULL
handle on .open success, then only call .close when the handle was
set, because that's the only time .open succeeded.
Conversely, if a plugin's .open fails, we skip .close for the entire
backend chain. This could be problematic (a memory leak) if any of
our filters had returned success to .open without calling the
backend's .open - but fortunately all of our filters called next()
prior to doing anything locally. Still, we can ensure that things are
sane by asserting that if .open succeeded, the backend's handle is
also set.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
server/backend.c | 9 ++++++++-
server/filters.c | 12 ++++++++----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/server/backend.c b/server/backend.c
index a637f754..b918adff 100644
--- a/server/backend.c
+++ b/server/backend.c
@@ -172,6 +172,7 @@ int
backend_open (struct backend *b, struct connection *conn, int readonly)
{
struct b_conn_handle *h = &conn->handles[b->i];
+ int r;
debug ("%s: open readonly=%d", b->name, readonly);
@@ -179,7 +180,13 @@ backend_open (struct backend *b, struct connection *conn, int readonly)
assert (h->can_write == -1);
if (readonly)
h->can_write = 0;
- return b->open (b, conn, readonly);
+ r = b->open (b, conn, readonly);
+ if (r == 0) {
+ assert (h->handle != NULL);
+ if (b->i)
+ assert (conn->handles[b->i - 1].handle);
+ }
+ return r;
}
int
diff --git a/server/filters.c b/server/filters.c
index 5bdc8aa7..1ee62829 100644
--- a/server/filters.c
+++ b/server/filters.c
@@ -210,10 +210,13 @@ filter_open (struct backend *b, struct connection *conn, int readonly)
if (handle == NULL)
return -1;
backend_set_handle (b, conn, handle);
- return 0;
}
- else
- return backend_open (b->next, conn, readonly);
+ else {
+ if (backend_open (b->next, conn, readonly) == -1)
+ return -1;
+ backend_set_handle (b, conn, NBDKIT_HANDLE_NOT_NEEDED);
+ }
+ return 0;
}
static void
@@ -224,8 +227,9 @@ filter_close (struct backend *b, struct connection *conn)
debug ("%s: close", b->name);
- if (f->filter.close)
+ if (handle && f->filter.close)
f->filter.close (handle);
+ backend_set_handle (b, conn, NULL);
b->next->close (b->next, conn);
}
--
2.21.0
5 years, 1 month
[p2v PATCH] Ignore 'rhv-upload' driver (RHBZ#1590220)
by Pino Toscano
The 'rhv-upload' output mode requires few options, and virt-p2v does not
have the GUI bits for specifying them.
---
ssh.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/ssh.c b/ssh.c
index 7d85b40..99eefbd 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1022,8 +1022,12 @@ add_input_driver (const char *name, size_t len)
static void
add_output_driver (const char *name, size_t len)
{
- /* Ignore the 'vdsm' driver, since that should only be used by VDSM. */
- if (len != 4 || memcmp (name, "vdsm", 4) != 0)
+ /* Ignore the 'vdsm' driver, since that should only be used by VDSM.
+ * Ignore the 'rhv-upload' driver, since we do not support passing all the
+ * options for it.
+ */
+ if ((len != 4 || memcmp (name, "vdsm", 4) != 0) &&
+ (len != 10 || memcmp (name, "rhv-upload", 10) != 0))
add_option ("output", &output_drivers, name, len);
}
--
2.21.0
5 years, 1 month
[p2v PATCH v2] Use URL to point to GNU licenses
by Pino Toscano
Adjust almost all the license headers to point to the GNU website
instead of the FSF postal address.
3rd party code copies are unchanged.
Spotted by Rpmlint.
---
v1 is:
https://www.redhat.com/archives/libguestfs/2019-September/msg00079.html
Makefile.am | 3 +--
autogen.sh | 3 +--
bash/Makefile.am | 3 +--
bash/test-complete-in-script.sh | 3 +--
bash/virt-p2v-make-disk | 3 +--
configure.ac | 3 +--
contrib/aux-scripts/do-build.sh | 3 +--
contrib/build-p2v-iso.sh | 3 +--
contrib/test-p2v-iso.sh | 3 +--
conversion.c | 3 +--
cpuid.c | 3 +--
docs/Makefile.am | 3 +--
generate-p2v-authors.pl | 3 +--
generate-p2v-config.pl | 3 +--
gui-gtk2-compat.h | 3 +--
gui-gtk3-compat.h | 3 +--
gui.c | 6 ++----
inhibit.c | 3 +--
kernel-cmdline.c | 3 +--
kernel.c | 3 +--
launch-virt-p2v | 3 +--
m4/p2v-bash-completion.m4 | 3 +--
m4/p2v-c.m4 | 3 +--
m4/p2v-libraries.m4 | 3 +--
m4/p2v-progs.m4 | 3 +--
m4/p2v-tests.m4 | 3 +--
main.c | 3 +--
nbd.c | 3 +--
p2v.h | 3 +--
p2v.ks.in | 3 +--
p2v.service | 3 +--
physical-xml.c | 3 +--
podcheck.pl | 3 +--
podwrapper.pl.in | 14 +++++---------
rtc.c | 3 +--
run.in | 5 ++---
ssh.c | 3 +--
subdir-rules.mk | 3 +--
test-functions.sh | 3 +--
test-virt-p2v-cmdline.sh | 3 +--
test-virt-p2v-docs.sh | 3 +--
test-virt-p2v-nbdkit.sh | 3 +--
test-virt-p2v-pxe.sh | 3 +--
test-virt-p2v-pxe.sshd_config.in | 3 +--
test-virt-p2v-scp.sh | 3 +--
test-virt-p2v-ssh.sh | 3 +--
test-virt-p2v.sh | 3 +--
utils.c | 3 +--
valgrind-suppressions | 3 +--
virt-p2v-make-disk.in | 3 +--
virt-p2v-make-kickstart.in | 3 +--
virt-p2v-make-kiwi.in | 3 +--
whole-file.c | 5 ++---
53 files changed, 60 insertions(+), 117 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index b868d1b..d27219d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
include $(top_srcdir)/subdir-rules.mk
diff --git a/autogen.sh b/autogen.sh
index fcdd0ce..f055ffc 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Rebuild the autotools environment.
diff --git a/bash/Makefile.am b/bash/Makefile.am
index 2a59f75..c8e54c8 100644
--- a/bash/Makefile.am
+++ b/bash/Makefile.am
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
include $(top_srcdir)/subdir-rules.mk
diff --git a/bash/test-complete-in-script.sh b/bash/test-complete-in-script.sh
index 7fff0bc..d369dda 100755
--- a/bash/test-complete-in-script.sh
+++ b/bash/test-complete-in-script.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Test that the correct 'complete' command is included in the script.
# Mainly prevents symlinking errors and some omissions.
diff --git a/bash/virt-p2v-make-disk b/bash/virt-p2v-make-disk
index 6a879a1..c892b41 100644
--- a/bash/virt-p2v-make-disk
+++ b/bash/virt-p2v-make-disk
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
_p2v_options_only ()
{
diff --git a/configure.ac b/configure.ac
index 8838de1..72843bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# The major, minor, and release fields MUST be numbers. Packagers can
# add extra information using --with-extra="..." which may be any
diff --git a/contrib/aux-scripts/do-build.sh b/contrib/aux-scripts/do-build.sh
index dd6424b..53a844d 100644
--- a/contrib/aux-scripts/do-build.sh
+++ b/contrib/aux-scripts/do-build.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# See build-p2v-iso.sh
diff --git a/contrib/build-p2v-iso.sh b/contrib/build-p2v-iso.sh
index 2c6bd10..1bc4d24 100755
--- a/contrib/build-p2v-iso.sh
+++ b/contrib/build-p2v-iso.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# This script is used to build the virt-p2v ISO on RHEL 5/6/7,
# for 32 bit (i686) and 64 bit (x86-64).
diff --git a/contrib/test-p2v-iso.sh b/contrib/test-p2v-iso.sh
index ff6453b..9ac4c6a 100755
--- a/contrib/test-p2v-iso.sh
+++ b/contrib/test-p2v-iso.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Once you have built a virt-p2v ISO (see build-p2v-iso.sh), you
# can interactively test it using this script.
diff --git a/conversion.c b/conversion.c
index 044cee3..d7e91a8 100644
--- a/conversion.c
+++ b/conversion.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
diff --git a/cpuid.c b/cpuid.c
index ef3574d..c12224a 100644
--- a/cpuid.c
+++ b/cpuid.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 9ad83aa..afb797e 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
include $(top_srcdir)/subdir-rules.mk
diff --git a/generate-p2v-authors.pl b/generate-p2v-authors.pl
index 18a825b..cd1c509 100755
--- a/generate-p2v-authors.pl
+++ b/generate-p2v-authors.pl
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
use strict;
use warnings;
diff --git a/generate-p2v-config.pl b/generate-p2v-config.pl
index be98838..06a2e2c 100755
--- a/generate-p2v-config.pl
+++ b/generate-p2v-config.pl
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
use strict;
use warnings;
diff --git a/gui-gtk2-compat.h b/gui-gtk2-compat.h
index 65569dd..ac9cb60 100644
--- a/gui-gtk2-compat.h
+++ b/gui-gtk2-compat.h
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/* Backwards compatibility for ancient RHEL 5 Gtk 2.10. */
diff --git a/gui-gtk3-compat.h b/gui-gtk3-compat.h
index 212c3af..5388c3a 100644
--- a/gui-gtk3-compat.h
+++ b/gui-gtk3-compat.h
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/* Backwards compatibility for some deprecated functions in Gtk 3. */
diff --git a/gui.c b/gui.c
index 32c56dd..3463637 100644
--- a/gui.c
+++ b/gui.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
@@ -152,8 +151,7 @@ static const char gplv2plus[] =
"GNU General Public License for more details.\n"
"\n"
"You should have received a copy of the GNU General Public License\n"
- "along with this program; if not, write to the Free Software\n"
- "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n";
+ "along with this program. If not, see <https://www.gnu.org/licenses/>.\n";
#endif
/**
diff --git a/inhibit.c b/inhibit.c
index 7615d65..d902e2b 100644
--- a/inhibit.c
+++ b/inhibit.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
diff --git a/kernel-cmdline.c b/kernel-cmdline.c
index c53b978..008f3f6 100644
--- a/kernel-cmdline.c
+++ b/kernel-cmdline.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
diff --git a/kernel.c b/kernel.c
index e9a0630..7adf659 100644
--- a/kernel.c
+++ b/kernel.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
diff --git a/launch-virt-p2v b/launch-virt-p2v
index 925aa6d..9d1e8d3 100755
--- a/launch-virt-p2v
+++ b/launch-virt-p2v
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# This normally runs from systemd which deals with logging.
diff --git a/m4/p2v-bash-completion.m4 b/m4/p2v-bash-completion.m4
index eee5067..9589d7d 100644
--- a/m4/p2v-bash-completion.m4
+++ b/m4/p2v-bash-completion.m4
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
dnl Bash completion.
PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [
diff --git a/m4/p2v-c.m4 b/m4/p2v-c.m4
index e3d045f..772e48d 100644
--- a/m4/p2v-c.m4
+++ b/m4/p2v-c.m4
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
dnl The C compiler environment.
dnl Define the host CPU architecture (defines 'host_cpu')
diff --git a/m4/p2v-libraries.m4 b/m4/p2v-libraries.m4
index c776a10..9e1236a 100644
--- a/m4/p2v-libraries.m4
+++ b/m4/p2v-libraries.m4
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
dnl Any C libraries required by virt-p2v.
diff --git a/m4/p2v-progs.m4 b/m4/p2v-progs.m4
index b3d0ce7..3ddb13c 100644
--- a/m4/p2v-progs.m4
+++ b/m4/p2v-progs.m4
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Check for external programs required to either build or run
# virt-p2v.
diff --git a/m4/p2v-tests.m4 b/m4/p2v-tests.m4
index 7de356d..9b4a77f 100644
--- a/m4/p2v-tests.m4
+++ b/m4/p2v-tests.m4
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
dnl Should we run the gnulib tests?
AC_MSG_CHECKING([if we should run the GNUlib tests])
diff --git a/main.c b/main.c
index 424bccf..9039e82 100644
--- a/main.c
+++ b/main.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <config.h>
diff --git a/nbd.c b/nbd.c
index 8b80803..3bbde1e 100644
--- a/nbd.c
+++ b/nbd.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
diff --git a/p2v.h b/p2v.h
index 52842bd..eb518f7 100644
--- a/p2v.h
+++ b/p2v.h
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef P2V_H
diff --git a/p2v.ks.in b/p2v.ks.in
index 32f3665..9bb31ab 100644
--- a/p2v.ks.in
+++ b/p2v.ks.in
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Generated by virt-p2v-make-kickstart __PACKAGE_VERSION_FULL__
diff --git a/p2v.service b/p2v.service
index 7096eb1..2c431b5 100644
--- a/p2v.service
+++ b/p2v.service
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# NB: This cannot be called "virt-p2v.service" because on Fedora the
# virt- prefix will cause it to get the wrong SELinux label.
diff --git a/physical-xml.c b/physical-xml.c
index 08f4430..1855190 100644
--- a/physical-xml.c
+++ b/physical-xml.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
diff --git a/podcheck.pl b/podcheck.pl
index 527a2e4..0f1f2e9 100755
--- a/podcheck.pl
+++ b/podcheck.pl
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
use warnings;
use strict;
diff --git a/podwrapper.pl.in b/podwrapper.pl.in
index ea24b5e..dad667b 100755
--- a/podwrapper.pl.in
+++ b/podwrapper.pl.in
@@ -14,8 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
use warnings;
use strict;
@@ -374,10 +373,8 @@ WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA
+You should have received a copy of the GNU Lesser General Public License
+along with this program. If not, see <https://www.gnu.org/licenses/>.
";
my $GPLv2plus =
@@ -391,9 +388,8 @@ WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <https://www.gnu.org/licenses/>.
";
my $examples_license =
diff --git a/rtc.c b/rtc.c
index 28884fc..05d0fae 100644
--- a/rtc.c
+++ b/rtc.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
diff --git a/run.in b/run.in
index fbb1247..7329856 100755
--- a/run.in
+++ b/run.in
@@ -14,9 +14,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
#----------------------------------------------------------------------
diff --git a/ssh.c b/ssh.c
index 59d1891..7d85b40 100644
--- a/ssh.c
+++ b/ssh.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
diff --git a/subdir-rules.mk b/subdir-rules.mk
index ce05874..7896105 100644
--- a/subdir-rules.mk
+++ b/subdir-rules.mk
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# subdir-rules.mk should be included in every *subdirectory* Makefile.am.
diff --git a/test-functions.sh b/test-functions.sh
index 1b5ac00..f6c9ee3 100755
--- a/test-functions.sh
+++ b/test-functions.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Most of the tests written in shell script source this file for
# useful functions.
diff --git a/test-virt-p2v-cmdline.sh b/test-virt-p2v-cmdline.sh
index 2fbca1e..cd76044 100755
--- a/test-virt-p2v-cmdline.sh
+++ b/test-virt-p2v-cmdline.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Test virt-p2v command line parsing in non-GUI mode.
diff --git a/test-virt-p2v-docs.sh b/test-virt-p2v-docs.sh
index d4942de..8d17fce 100755
--- a/test-virt-p2v-docs.sh
+++ b/test-virt-p2v-docs.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
set -e
diff --git a/test-virt-p2v-nbdkit.sh b/test-virt-p2v-nbdkit.sh
index cf7a416..9adb195 100755
--- a/test-virt-p2v-nbdkit.sh
+++ b/test-virt-p2v-nbdkit.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Test virt-p2v in non-GUI mode using nbdkit instead of qemu-nbd.
diff --git a/test-virt-p2v-pxe.sh b/test-virt-p2v-pxe.sh
index bad4188..f0cadf4 100755
--- a/test-virt-p2v-pxe.sh
+++ b/test-virt-p2v-pxe.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Test virt-p2v in non-GUI mode with something resembling the
# PXE boot code path. This tests:
diff --git a/test-virt-p2v-pxe.sshd_config.in b/test-virt-p2v-pxe.sshd_config.in
index d6ce578..6475e2b 100644
--- a/test-virt-p2v-pxe.sshd_config.in
+++ b/test-virt-p2v-pxe.sshd_config.in
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Minimal sshd_config used by test-virt-p2v-pxe.ssh when it runs
# a captive sshd.
diff --git a/test-virt-p2v-scp.sh b/test-virt-p2v-scp.sh
index 53f9781..ca85101 100755
--- a/test-virt-p2v-scp.sh
+++ b/test-virt-p2v-scp.sh
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# This is an scp substitute used by test-virt-p2v.sh.
diff --git a/test-virt-p2v-ssh.sh b/test-virt-p2v-ssh.sh
index 79dc883..2442b7d 100755
--- a/test-virt-p2v-ssh.sh
+++ b/test-virt-p2v-ssh.sh
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# This is an ssh substitute used by test-virt-p2v.sh.
diff --git a/test-virt-p2v.sh b/test-virt-p2v.sh
index a6b0727..9629e1b 100755
--- a/test-virt-p2v.sh
+++ b/test-virt-p2v.sh
@@ -13,8 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Test virt-p2v in non-GUI mode.
diff --git a/utils.c b/utils.c
index 4b5e723..932c1c1 100644
--- a/utils.c
+++ b/utils.c
@@ -12,8 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <config.h>
diff --git a/valgrind-suppressions b/valgrind-suppressions
index 1687c82..ca4149e 100644
--- a/valgrind-suppressions
+++ b/valgrind-suppressions
@@ -12,8 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Valgrind suppressions used when testing only. There are no known
# resource leaks in virt-p2v. This file is only for leaks in
diff --git a/virt-p2v-make-disk.in b/virt-p2v-make-disk.in
index e353f3f..1bec4e3 100644
--- a/virt-p2v-make-disk.in
+++ b/virt-p2v-make-disk.in
@@ -14,8 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
unset CDPATH
diff --git a/virt-p2v-make-kickstart.in b/virt-p2v-make-kickstart.in
index 97610cd..779ba62 100644
--- a/virt-p2v-make-kickstart.in
+++ b/virt-p2v-make-kickstart.in
@@ -14,8 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
unset CDPATH
diff --git a/virt-p2v-make-kiwi.in b/virt-p2v-make-kiwi.in
index 405b629..987de11 100644
--- a/virt-p2v-make-kiwi.in
+++ b/virt-p2v-make-kiwi.in
@@ -14,8 +14,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
unset CDPATH
diff --git a/whole-file.c b/whole-file.c
index 63597e0..156bb9b 100644
--- a/whole-file.c
+++ b/whole-file.c
@@ -11,9 +11,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <config.h>
--
2.21.0
5 years, 1 month
[PATCH libnbd 0/5] interop: Check that LIBNBD_TLS_ALLOW works against nbdkit.
by Richard W.M. Jones
I was a little surprised to find that LIBNBD_TLS_ALLOW worked out of
the box, so I had to examine the logs whereupon I saw the magic
message ...
libnbd: debug: nbd1: nbd_connect_command: server refused TLS (policy), continuing with unencrypted connection
I don't believe this path has ever been tested before.
It's possible the tests could be improved if they actually checked for
this message, but the patches as posted try to use regular APIs.
Rich.
5 years, 1 month
[PATCH nbdkit] server: Remove useless thread local sockaddr.
by Richard W.M. Jones
When accepting a connection on a TCP or Unix domain socket we recorded
the peer address in both the thread_data struct and thread-local
storage. But for no reason because it was never used anywhere. Since
we were only allocating a ‘struct sockaddr’ (rather than a ‘struct
sockaddr_storage’) it's likely that some peer addresses would have
been truncated.
Remove all this code, it had no effect.
Plugins that want to get the peer address can use nbdkit_peer_name()
which was added in commit 03a2cc3d766e and doesn't suffer from the
above truncation problem.
(I considered an alternative where we use the saved address to answer
nbdkit_peer_name but since that call will in general be used very
rarely it doesn't make sense to do the extra work for all callers.)
---
server/internal.h | 4 ----
server/sockets.c | 12 ++----------
server/threadlocal.c | 19 -------------------
3 files changed, 2 insertions(+), 33 deletions(-)
diff --git a/server/internal.h b/server/internal.h
index 1f72b01..c31bb34 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -431,10 +431,6 @@ extern void threadlocal_set_name (const char *name)
extern const char *threadlocal_get_name (void);
extern void threadlocal_set_instance_num (size_t instance_num);
extern size_t threadlocal_get_instance_num (void);
-extern void threadlocal_set_sockaddr (const struct sockaddr *addr,
- socklen_t addrlen)
- __attribute__((__nonnull__ (1)));
-/*extern void threadlocal_get_sockaddr ();*/
extern void threadlocal_set_error (int err);
extern int threadlocal_get_error (void);
extern void *threadlocal_buffer (size_t size);
diff --git a/server/sockets.c b/server/sockets.c
index dfaa3ea..3514c69 100644
--- a/server/sockets.c
+++ b/server/sockets.c
@@ -260,8 +260,6 @@ free_listening_sockets (int *socks, size_t nr_socks)
struct thread_data {
int sock;
size_t instance_num;
- struct sockaddr addr;
- socklen_t addrlen;
};
static void *
@@ -274,7 +272,6 @@ start_thread (void *datav)
/* Set thread-local data. */
threadlocal_new_server_thread ();
threadlocal_set_instance_num (data->instance_num);
- threadlocal_set_sockaddr (&data->addr, data->addrlen);
handle_single_connection (data->sock, data->sock);
@@ -299,12 +296,9 @@ accept_connection (int listen_sock)
}
thread_data->instance_num = instance_num++;
- thread_data->addrlen = sizeof thread_data->addr;
again:
#ifdef HAVE_ACCEPT4
- thread_data->sock = accept4 (listen_sock,
- &thread_data->addr, &thread_data->addrlen,
- SOCK_CLOEXEC);
+ thread_data->sock = accept4 (listen_sock, NULL, NULL, SOCK_CLOEXEC);
#else
/* If we were fully parallel, then this function could be accepting
* connections in one thread while another thread could be in a
@@ -316,9 +310,7 @@ accept_connection (int listen_sock)
assert (backend->thread_model (backend) <=
NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS);
lock_request (NULL);
- thread_data->sock = set_cloexec (accept (listen_sock,
- &thread_data->addr,
- &thread_data->addrlen));
+ thread_data->sock = set_cloexec (accept (listen_sock, NULL, NULL));
unlock_request (NULL);
#endif
if (thread_data->sock == -1) {
diff --git a/server/threadlocal.c b/server/threadlocal.c
index a796fce..71cc2d2 100644
--- a/server/threadlocal.c
+++ b/server/threadlocal.c
@@ -55,8 +55,6 @@
struct threadlocal {
char *name; /* Can be NULL. */
size_t instance_num; /* Can be 0. */
- struct sockaddr *addr;
- socklen_t addrlen;
int err;
void *buffer;
size_t buffer_size;
@@ -71,7 +69,6 @@ free_threadlocal (void *threadlocalv)
struct threadlocal *threadlocal = threadlocalv;
free (threadlocal->name);
- free (threadlocal->addr);
free (threadlocal->buffer);
free (threadlocal);
}
@@ -133,22 +130,6 @@ threadlocal_set_instance_num (size_t instance_num)
threadlocal->instance_num = instance_num;
}
-void
-threadlocal_set_sockaddr (const struct sockaddr *addr, socklen_t addrlen)
-{
- struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key);
-
- if (threadlocal) {
- free (threadlocal->addr);
- threadlocal->addr = calloc (1, addrlen);
- if (threadlocal->addr == NULL) {
- perror ("calloc");
- exit (EXIT_FAILURE);
- }
- memcpy (threadlocal->addr, addr, addrlen);
- }
-}
-
const char *
threadlocal_get_name (void)
{
--
2.23.0
5 years, 1 month
[libnbd PATCH] api: Add nbd_get_structured_replies_negotiated
by Eric Blake
Similar to nbd_get_tls_negotiated, for observing what we actually
settled on with the server, rather than what was requested.
---
generator/generator | 30 +++++++++++++++++++++++++-----
lib/handle.c | 6 ++++++
tests/meta-base-allocation.c | 15 +++++++++++++++
tests/oldstyle.c | 7 ++++++-
4 files changed, 52 insertions(+), 6 deletions(-)
diff --git a/generator/generator b/generator/generator
index 5f538b2..3b63665 100755
--- a/generator/generator
+++ b/generator/generator
@@ -1312,6 +1312,7 @@ rather than find a way to alter the server to fail the negotiation
request.";
see_also = ["L<nbd_get_request_structured_replies(3)>";
"L<nbd_set_handshake_flags(3)>";
+ "L<nbd_get_structured_replies_negotiated(3)>";
"L<nbd_can_meta_context(3)>"; "L<nbd_can_df(3)>"];
};
@@ -1322,10 +1323,26 @@ request.";
shortdesc = "see if structured replies are attempted";
longdesc = "\
Return the state of the request structured replies flag on this
-handle. Note that this only reports whether the client attempts
-to negotiate structured replies, and not whether the server was
-able to honor that request";
- see_also = ["L<nbd_set_request_structured_replies(3)>"];
+handle.
+
+B<Note:> If you want to find out if structured replies were actually
+negotiated on a particular connection use
+C<nbd_get_structured_replies_negotiated> instead.";
+ see_also = ["L<nbd_set_request_structured_replies(3)>";
+ "L<nbd_get_structured_replies_negotiated(3)>"];
+ };
+
+ "get_structured_replies_negotiated", {
+ default_call with
+ args = []; ret = RBool;
+ permitted_states = [ Connected; Closed ];
+ shortdesc = "see if structured replies are in use";
+ longdesc = "\
+After connecting you may call this to find out if the connection is
+using structured replies.";
+ see_also = ["L<nbd_set_request_structured_replies(3)>";
+ "L<nbd_get_request_structured_replies(3)>";
+ "L<nbd_get_protocol(3)>"];
};
"set_handshake_flags", {
@@ -1673,7 +1690,9 @@ be returned in the future.
Most modern NBD servers use C<\"newstyle-fixed\">.
"
^ non_blocking_test_call_description;
- see_also = ["L<nbd_get_handshake_flags(3)>"];
+ see_also = ["L<nbd_get_handshake_flags(3)>";
+ "L<nbd_get_structured_replies_negotiated(3)>";
+ "L<nbd_get_tls_negotiated(3)>"];
};
"get_size", {
@@ -2654,6 +2673,7 @@ let first_version = [
"can_fast_zero", (1, 2);
"set_request_structured_replies", (1, 2);
"get_request_structured_replies", (1, 2);
+ "get_structured_replies_negotiated", (1, 2);
"get_tls_negotiated", (1, 2);
"get_protocol", (1, 2);
"set_handshake_flags", (1, 2);
diff --git a/lib/handle.c b/lib/handle.c
index 36e6434..2af25fe 100644
--- a/lib/handle.c
+++ b/lib/handle.c
@@ -260,6 +260,12 @@ nbd_unlocked_get_request_structured_replies (struct nbd_handle *h)
return h->request_sr;
}
+int
+nbd_unlocked_get_structured_replies_negotiated (struct nbd_handle *h)
+{
+ return h->structured_replies;
+}
+
int
nbd_unlocked_set_handshake_flags (struct nbd_handle *h,
uint32_t flags)
diff --git a/tests/meta-base-allocation.c b/tests/meta-base-allocation.c
index f6be463..3de4c34 100644
--- a/tests/meta-base-allocation.c
+++ b/tests/meta-base-allocation.c
@@ -41,6 +41,8 @@ main (int argc, char *argv[])
struct nbd_handle *nbd;
char plugin_path[256];
int id;
+ int r;
+ const char *s;
snprintf (plugin_path, sizeof plugin_path, "%s/meta-base-allocation.sh",
getenv ("srcdir") ? : ".");
@@ -77,6 +79,19 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
+ /* Protocol should be "newstyle-fixed", with structured replies. */
+ s = nbd_get_protocol (nbd);
+ if (strcmp (s, "newstyle-fixed") != 0) {
+ fprintf (stderr,
+ "incorrect protocol \"%s\", expected \"newstyle-fixed\"\n", s);
+ exit (EXIT_FAILURE);
+ }
+ if ((r = nbd_get_structured_replies_negotiated (nbd)) != 1) {
+ fprintf (stderr,
+ "incorrect structured replies %d, expected 1\n", r);
+ exit (EXIT_FAILURE);
+ }
+
switch (nbd_can_meta_context (nbd, "x-libnbd:nosuch")) {
case -1:
fprintf (stderr, "%s\n", nbd_get_error ());
diff --git a/tests/oldstyle.c b/tests/oldstyle.c
index b90b775..c9c01f8 100644
--- a/tests/oldstyle.c
+++ b/tests/oldstyle.c
@@ -115,13 +115,18 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
- /* Protocol should be "oldstyle". */
+ /* Protocol should be "oldstyle", with no structured replies. */
s = nbd_get_protocol (nbd);
if (strcmp (s, "oldstyle") != 0) {
fprintf (stderr,
"incorrect protocol \"%s\", expected \"oldstyle\"\n", s);
exit (EXIT_FAILURE);
}
+ if ((r = nbd_get_structured_replies_negotiated (nbd)) != 0) {
+ fprintf (stderr,
+ "incorrect structured replies %" PRId64 ", expected 0\n", r);
+ exit (EXIT_FAILURE);
+ }
if ((r = nbd_get_size (nbd)) == -1) {
fprintf (stderr, "%s\n", nbd_get_error ());
--
2.21.0
5 years, 1 month
[PATCH libnbd] docs: Document limits on export name.
by Richard W.M. Jones
This commit documents the limits on export name, encoding, etc.
---
generator/generator | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/generator/generator b/generator/generator
index a72f36c..87a8cdf 100755
--- a/generator/generator
+++ b/generator/generator
@@ -1066,10 +1066,16 @@ C<\"nbd2\">, etc.";
longdesc = "\
For servers which require an export name or can serve different
content on different exports, set the C<export_name> to
-connect to. This is only relevant for the newstyle protocol.
+connect to. The default is the empty string C<\"\">.
+
+This is only relevant when connecting to servers using the
+newstyle protocol as the oldstyle protocol did not support
+export names. The NBD protocol limits export names to
+4096 bytes, but servers may not support the full length.
+The encoding of export names is always UTF-8.
+
This call may be skipped if using L<nbd_connect_uri(3)> to connect
-to a URI that includes an export name. The default is to use
-the empty string.";
+to a URI that includes an export name.";
};
"get_export_name", {
--
2.23.0
5 years, 1 month
[PATCH libnbd 1/2] api: Add new API to read whether TLS was negotiated.
by Richard W.M. Jones
When LIBNBD_TLS_ALLOW is used we don't have a way to find out if TLS
was really negotiated. This adds a flag and a way to read it back.
Unfortunately there is no test yet, because LIBNBD_TLS_ALLOW is not
tested -- it really should be but requires quite a complicated set of
tests because ideally we'd like to find out whether it falls back
correctly for all supported servers.
---
TODO | 3 +++
generator/generator | 34 +++++++++++++++++++++---
generator/states-newstyle-opt-starttls.c | 1 +
lib/crypto.c | 6 +++++
lib/internal.h | 3 +++
5 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/TODO b/TODO
index 642d39f..21feb2f 100644
--- a/TODO
+++ b/TODO
@@ -17,6 +17,9 @@ NBD_INFO_BLOCK_SIZE.
TLS should properly shut down the session (calling gnutls_bye).
+LIBNBD_TLS_ALLOW is not tested. Related to this,
+nbd_get_tls_negotiated is not tested.
+
Implement nbd_connect + systemd socket activation.
Improve function trace output so that:
diff --git a/generator/generator b/generator/generator
index 87a8cdf..28248ed 100755
--- a/generator/generator
+++ b/generator/generator
@@ -1132,17 +1132,42 @@ TLS are not handled automatically. Setting the level higher than
zero will fail if libnbd was not compiled against gnutls; you can
test whether this is the case with L<nbd_supports_tls(3)>.";
example = Some "examples/encryption.c";
- see_also = ["L<libnbd(3)/ENCRYPTION AND AUTHENTICATION>"];
+ see_also = ["L<libnbd(3)/ENCRYPTION AND AUTHENTICATION>";
+ "L<nbd_get_tls(3)>"; "L<nbd_get_tls_negotiated(3)>"];
};
"get_tls", {
default_call with
args = []; ret = RInt;
may_set_error = false;
- shortdesc = "get the current TLS setting";
+ shortdesc = "get the TLS request setting";
longdesc = "\
-Get the current TLS setting.";
- see_also = ["L<nbd_set_tls(3)>"];
+Get the TLS request setting.
+
+B<Note:> If you want to find out if TLS was actually negotiated
+on a particular connection use L<nbd_get_tls_negotiated(3)> instead.";
+ see_also = ["L<nbd_set_tls(3)>"; "L<nbd_get_tls_negotiated(3)>"];
+ };
+
+ "get_tls_negotiated", {
+ default_call with
+ args = []; ret = RBool;
+ permitted_states = [ Connected; Closed ];
+ shortdesc = "find out if TLS was negotiated on a connection";
+ longdesc = "\
+After connecting you may call this to find out if the
+connection is using TLS.
+
+This is only really useful if you set the TLS request mode
+to C<LIBNBD_TLS_ALLOW> (see L<nbd_set_tls(3)>), because in this
+mode we try to use TLS but fall back to unencrypted if it was
+not available. This function will tell you if TLS was
+negotiated or not.
+
+In C<LIBNBD_TLS_REQUIRE> mode (the most secure) the connection
+would have failed if TLS could not be negotiated, and in
+C<LIBNBD_TLS_DISABLE> mode TLS is not tried.";
+ see_also = ["L<nbd_set_tls(3)>"; "L<nbd_get_tls(3)>"];
};
"set_tls_certificates", {
@@ -2527,6 +2552,7 @@ let first_version = [
"can_fast_zero", (1, 2);
"set_request_structured_replies", (1, 2);
"get_request_structured_replies", (1, 2);
+ "get_tls_negotiated", (1, 2);
(* These calls are proposed for a future version of libnbd, but
* have not been added to any released version so far.
diff --git a/generator/states-newstyle-opt-starttls.c b/generator/states-newstyle-opt-starttls.c
index 0a18db0..a35e10b 100644
--- a/generator/states-newstyle-opt-starttls.c
+++ b/generator/states-newstyle-opt-starttls.c
@@ -116,6 +116,7 @@
}
if (r == 0) {
/* Finished handshake. */
+ h->tls_negotiated = true;
nbd_internal_crypto_debug_tls_enabled (h);
/* Continue with option negotiation. */
diff --git a/lib/crypto.c b/lib/crypto.c
index c0a57d7..3274954 100644
--- a/lib/crypto.c
+++ b/lib/crypto.c
@@ -57,6 +57,12 @@ nbd_unlocked_get_tls (struct nbd_handle *h)
return h->tls;
}
+int
+nbd_unlocked_get_tls_negotiated (struct nbd_handle *h)
+{
+ return h->tls_negotiated;
+}
+
int
nbd_unlocked_set_tls_certificates (struct nbd_handle *h, const char *dir)
{
diff --git a/lib/internal.h b/lib/internal.h
index ccaca32..eb76ac1 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -87,6 +87,9 @@ struct nbd_handle {
uint64_t exportsize;
uint16_t eflags;
+ /* Flag set by the state machine to tell whether TLS was negotiated. */
+ bool tls_negotiated;
+
int64_t unique; /* Used for generating cookie numbers. */
/* For debugging. */
--
2.23.0
5 years, 1 month