nbdkit build broken
by Nir Soffer
Looks like commit 05a8c47b9be8a6b8ffc091eab461fece9d40dcd0
(tests: Test all calls through multiple layers of filters and a plugin.)
introduced an issue.
$ git clean -dxf && autoreconf -i && ./configure && make
...
in.Tpo -c -o test_layers_plugin_la-test-layers-plugin.lo `test -f
'test-layers-plugin.c' || echo './'`test-layers-plugin.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT
test_layers_plugin_la-test-layers-plugin.lo -MD -MP -MF
.deps/test_layers_plugin_la-test-layers-plugin.Tpo -c test-layers-plugin.c
-fPIC -DPIC -o .libs/test_layers_plugin_la-test-layers-plugin.o
test-layers-plugin.c: In function ‘test_layers_plugin_can_fua’:
test-layers-plugin.c:137:10: error: ‘NBDKIT_FUA_NATIVE’ undeclared (first
use in this function); did you mean ‘NBDKIT_CXX_LANG_C’?
return NBDKIT_FUA_NATIVE;
^~~~~~~~~~~~~~~~~
NBDKIT_CXX_LANG_C
test-layers-plugin.c:137:10: note: each undeclared identifier is reported
only once for each function it appears in
test-layers-plugin.c: At top level:
test-layers-plugin.c:197:4: error: ‘struct nbdkit_plugin’ has no member
named ‘can_zero’; did you mean ‘can_trim’?
.can_zero = test_layers_plugin_can_zero,
^~~~~~~~
can_trim
test-layers-plugin.c:197:24: warning: initialization of ‘int (*)(void *,
void *, uint32_t, uint64_t)’ {aka ‘int (*)(void *, void *, unsigned int,
long unsigned int)’} from incompatible pointer type ‘int (*)(void *)’
[-Wincompatible-pointer-types]
.can_zero = test_layers_plugin_can_zero,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
test-layers-plugin.c:197:24: note: (near initialization for ‘plugin.pread’)
test-layers-plugin.c:198:4: error: ‘struct nbdkit_plugin’ has no member
named ‘can_fua’; did you mean ‘can_flush’?
.can_fua = test_layers_plugin_can_fua,
^~~~~~~
can_flush
test-layers-plugin.c:198:24: warning: initialization of ‘int (*)(void *,
const void *, uint32_t, uint64_t)’ {aka ‘int (*)(void *, const void *,
unsigned int, long unsigned int)’} from incompatible pointer type ‘int
(*)(void *)’ [-Wincompatible-pointer-types]
.can_fua = test_layers_plugin_can_fua,
^~~~~~~~~~~~~~~~~~~~~~~~~~
test-layers-plugin.c:198:24: note: (near initialization for ‘plugin.pwrite’)
test-layers-plugin.c:199:24: warning: initialization of ‘int (*)(void *,
void *, uint32_t, uint64_t)’ {aka ‘int (*)(void *, void *, unsigned int,
long unsigned int)’} from incompatible pointer type ‘int (*)(void *, void
*, uint32_t, uint64_t, uint32_t)’ {aka ‘int (*)(void *, void *, unsigned
int, long unsigned int, unsigned int)’} [-Wincompatible-pointer-types]
.pread = test_layers_plugin_pread,
^~~~~~~~~~~~~~~~~~~~~~~~
test-layers-plugin.c:199:24: note: (near initialization for ‘plugin.pread’)
test-layers-plugin.c:200:24: warning: initialization of ‘int (*)(void *,
const void *, uint32_t, uint64_t)’ {aka ‘int (*)(void *, const void *,
unsigned int, long unsigned int)’} from incompatible pointer type ‘int
(*)(void *, const void *, uint32_t, uint64_t, uint32_t)’ {aka ‘int
(*)(void *, const void *, unsigned int, long unsigned int, unsigned
int)’} [-Wincompatible-pointer-types]
.pwrite = test_layers_plugin_pwrite,
^~~~~~~~~~~~~~~~~~~~~~~~~
test-layers-plugin.c:200:24: note: (near initialization for ‘plugin.pwrite’)
test-layers-plugin.c:201:24: warning: initialization of ‘int (*)(void *)’
from incompatible pointer type ‘int (*)(void *, uint32_t)’ {aka ‘int
(*)(void *, unsigned int)’} [-Wincompatible-pointer-types]
.flush = test_layers_plugin_flush,
^~~~~~~~~~~~~~~~~~~~~~~~
test-layers-plugin.c:201:24: note: (near initialization for ‘plugin.flush’)
test-layers-plugin.c:202:24: warning: initialization of ‘int (*)(void *,
uint32_t, uint64_t)’ {aka ‘int (*)(void *, unsigned int, long unsigned
int)’} from incompatible pointer type ‘int (*)(void *, uint32_t,
uint64_t, uint32_t)’ {aka ‘int (*)(void *, unsigned int, long unsigned
int, unsigned int)’} [-Wincompatible-pointer-types]
.trim = test_layers_plugin_trim,
^~~~~~~~~~~~~~~~~~~~~~~
test-layers-plugin.c:202:24: note: (near initialization for ‘plugin.trim’)
test-layers-plugin.c:203:24: warning: initialization of ‘int (*)(void *,
uint32_t, uint64_t, int)’ {aka ‘int (*)(void *, unsigned int, long
unsigned int, int)’} from incompatible pointer type ‘int (*)(void *,
uint32_t, uint64_t, uint32_t)’ {aka ‘int (*)(void *, unsigned int, long
unsigned int, unsigned int)’} [-Wincompatible-pointer-types]
.zero = test_layers_plugin_zero,
^~~~~~~~~~~~~~~~~~~~~~~
test-layers-plugin.c:203:24: note: (near initialization for ‘plugin.zero’)
make[2]: *** [Makefile:1847: test_layers_plugin_la-test-layers-plugin.lo]
Error 1
Nir
6 years, 4 months
[PATCH] v2v: Add --mac option to machine-readable
by Tomáš Golembiovský
Patch fe1a8866 added --mac option that allows mapping bridges/networks
based on the MAC address. It would be nice to have that listed in
machine-readable output
Signed-off-by: Tomáš Golembiovský <tgolembi(a)redhat.com>
---
v2v/cmdline.ml | 1 +
1 file changed, 1 insertion(+)
diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
index 88cb67bbb..5b2df3555 100644
--- a/v2v/cmdline.ml
+++ b/v2v/cmdline.ml
@@ -347,6 +347,7 @@ read the man page virt-v2v(1).
printf "vdsm-compat-option\n";
printf "in-place\n";
printf "io/oo\n";
+ printf "mac-option\n";
List.iter (printf "input:%s\n") (Modules_list.input_modules ());
List.iter (printf "output:%s\n") (Modules_list.output_modules ());
List.iter (printf "convert:%s\n") (Modules_list.convert_modules ());
--
2.18.0
6 years, 4 months
[PATCH] v2v: -o rhv-upload: Properly replace SD_UUID in OVF (RHBZ#1612653).
by Richard W.M. Jones
The @SD_UUID@ pattern was not being replaced correctly.
Thanks: Daniel Erez.
---
v2v/rhv-upload-createvm.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/v2v/rhv-upload-createvm.py b/v2v/rhv-upload-createvm.py
index a34627ec8..1d0e8c95d 100644
--- a/v2v/rhv-upload-createvm.py
+++ b/v2v/rhv-upload-createvm.py
@@ -70,7 +70,7 @@ sds_service = system_service.storage_domains_service()
sd = sds_service.list(search=("name=%s" % params['output_storage']))[0]
sd_uuid = sd.id
-ovf.replace("@SD_UUID@", sd_uuid)
+ovf = ovf.replace("@SD_UUID@", sd_uuid)
vms_service = system_service.vms_service()
vm = vms_service.add(
--
2.18.0
6 years, 4 months
[PATCH] btrfs_balance_status: delay allocation of 'ret'
by Pino Toscano
Allocate 'ret' as late as possible, so there is no risk that early
returns will leak it.
---
daemon/btrfs.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 26757d4fb..5c4be6cf7 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -1683,12 +1683,6 @@ do_btrfs_balance_status (const char *path)
nlines = guestfs_int_count_strings (lines);
- ret = calloc (1, sizeof *ret);
- if (ret == NULL) {
- reply_with_perror ("calloc");
- return NULL;
- }
-
/* Output of `btrfs balance status' is like:
*
* running:
@@ -1711,6 +1705,12 @@ do_btrfs_balance_status (const char *path)
return NULL;
}
+ ret = calloc (1, sizeof *ret);
+ if (ret == NULL) {
+ reply_with_perror ("calloc");
+ return NULL;
+ }
+
if (strstr (lines[0], "No balance found on")) {
ret->btrfsbalance_status = strdup ("none");
if (ret->btrfsbalance_status == NULL) {
--
2.17.1
6 years, 4 months
[PATCH nbdkit] protocol: Implement NBD_OPT_GO.
by Richard W.M. Jones
This is only lightly tested (against just qemu NBD client), and the
code might be structured a little better as the
_negotiate_handshake_newstyle_options function has now grown to be
huge. Anyway works for me.
Rich.
6 years, 4 months
[PATCH] v2v: rhv-plugin: Use string literal concatenation
by Nir Soffer
When splitting long strings over multiple lines, we can use string
literal concatenation instead of +.
See https://docs.python.org/3/reference/lexical_analysis.html#string-literal-...
---
.gnulib | 2 +-
v2v/rhv-upload-plugin.py | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/.gnulib b/.gnulib
index 5b78831df..646a44e1b 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 5b78831df03b49408676227604cf16f90dee07ac
+Subproject commit 646a44e1b190c4a7f6a9f32c63230c619e38d251
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
index bdc1e104a..2d686c2da 100644
--- a/v2v/rhv-upload-plugin.py
+++ b/v2v/rhv-upload-plugin.py
@@ -95,8 +95,8 @@ def find_host(connection):
# - 'hw_id' equals to 'vdsm_id'
# - Its status is 'Up'
# - Belongs to the storage domain's datacenter
- debug("cannot find a running host with hw_id=%r, " +
- "that belongs to datacenter '%s', " +
+ debug("cannot find a running host with hw_id=%r, "
+ "that belongs to datacenter '%s', "
"using any host" % (vdsm_id, datacenter.name))
return None
@@ -193,15 +193,15 @@ def open(readonly):
if transfer.phase != types.ImageTransferPhase.INITIALIZING:
break
if time.time() > endt:
- raise RuntimeError("timed out waiting for transfer status " +
+ raise RuntimeError("timed out waiting for transfer status "
"!= INITIALIZING")
# Now we have permission to start the transfer.
if params['rhv_direct']:
if transfer.transfer_url is None:
- raise RuntimeError("direct upload to host not supported, " +
- "requires ovirt-engine >= 4.2 and only works " +
- "when virt-v2v is run within the oVirt/RHV " +
+ raise RuntimeError("direct upload to host not supported, "
+ "requires ovirt-engine >= 4.2 and only works "
+ "when virt-v2v is run within the oVirt/RHV "
"environment, eg. on an oVirt node.")
destination_url = urlparse(transfer.transfer_url)
else:
@@ -511,7 +511,7 @@ def close(h):
time.sleep(1)
tmp = transfer_service.get()
if time.time() > endt:
- raise RuntimeError("timed out waiting for transfer " +
+ raise RuntimeError("timed out waiting for transfer "
"to finalize")
except sdk.NotFoundError:
pass
--
2.17.1
6 years, 4 months
Uneeded []?
by Nir Soffer
Looking in recent patch:
Author: Richard W.M. Jones <rjones(a)redhat.com>
Date: Fri Aug 3 12:00:01 2018 +0100
v2v: python_script: Use correct syntax for array slices in
documentation.
Fixes commit 3d4df397320e8e86932f0b0b4d100644eefc99b4.
diff --git a/v2v/python_script.mli b/v2v/python_script.mli
index e30917833..cf137b142 100644
--- a/v2v/python_script.mli
+++ b/v2v/python_script.mli
@@ -44,7 +44,7 @@ with open(sys.argv[1], 'r') as fp:
v}
The extra arguments, if any, are passed verbatim on the
- script command line in [sys.argv[2..]].
+ script command line in [sys.argv[2:]].
If the slice should be python syntax, it cab be:
script command line in sys.argv[2:].
Nir
6 years, 4 months
nbdkit does not support NBD_OPT_GO?
by Nir Soffer
When trying to connect to nbdkit with imageio nbd client, I get this error:
$ rm -f /tmp/nbd.sock && nbdkit file file=/var/tmp/fedora-27.img -e export
-U /tmp/nbd.sock
$ python -c "import logging; logging.basicConfig(level=logging.DEBUG); from
ovirt_imageio_common import nbd; c = nbd.Client('/tmp/nbd.sock', 'export')"
INFO:nbd:Connecting to '/tmp/nbd.sock' 'export'
DEBUG:nbd:Received server flags: 3
DEBUG:nbd:Sending client flags: 1:
DEBUG:nbd:Sending option: 'IHAVEOPT\x00\x00\x00\x07\x00\x00\x00\x0c' data:
bytearray(b'\x00\x00\x00\x06export\x00\x00')
DEBUG:nbd:Received reply [magic=3e889045565a9 option=7 type=80000001 len=0]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "ovirt_imageio_common/nbd.py", line 126, in __init__
self._newstyle_handshake(export_name)
File "ovirt_imageio_common/nbd.py", line 181, in _newstyle_handshake
self._receive_go_reply()
File "ovirt_imageio_common/nbd.py", line 206, in _receive_go_reply
.format(ERROR_REPLY[reply], message))
ovirt_imageio_common.nbd.Error: The option sent by the client is unknown by
this server implementation [message=])
According to the NBD protocol:
For backwards compatibility, clients SHOULD be prepared to also handle
NBD_REP_ERR_UNSUP by falling back to using NBD_OPT_EXPORT_NAME.
Should I fall back to sending NBD_OPT_EXPORT_NAME, or nbkit needs
to implement NBD_OPT_GO?
The client code is here:
https://gerrit.ovirt.org/c/93384/
Nir
6 years, 4 months
[PATCH 0/3] file: Zero for block devices and older file systems
by Nir Soffer
This is the second version to support efficient zero for block devices
on older kernels (e.g. RHEL 7.5), and file systems that do not support
yet FALLOC_FS_ZERO_RANGE (e.g. NFS 4.2).
Changes since v1:
- Split to smaller patches
- Skip linux only includes on other systems
- Skip code using BLKZEROOUT if the macro is not defined
- Try BLKZEROOUT only if the offset and count are aligned to device
sector size.
v1 was here:
https://www.redhat.com/archives/libguestfs/2018-July/msg00084.html
Nir Soffer (3):
file: Avoid unsupported fallocate() calls
file: Support zero without ZERO_RANGE
file: Zero for block devices on old kernels
plugins/file/file.c | 194 +++++++++++++++++++++++++++++++++-----------
1 file changed, 147 insertions(+), 47 deletions(-)
--
2.17.1
6 years, 4 months