Compare commits
259 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52bc4aaa23 | ||
|
|
c93b337646 | ||
|
|
b40df154df | ||
|
|
ab7ede0a9b | ||
|
|
055f24bfaa | ||
|
|
3c50b61630 | ||
|
|
9e84e3362d | ||
|
|
6589f88457 | ||
|
|
784e0b4cf2 | ||
|
|
9553da9d22 | ||
|
|
b431f95159 | ||
|
|
b59ab82af6 | ||
|
|
fc47dd5116 | ||
|
|
65680b6e8a | ||
|
|
a5480b3b28 | ||
|
|
84bc896229 | ||
|
|
6e02963b5b | ||
|
|
09d3b12f3a | ||
|
|
a0006d68f8 | ||
|
|
ccf3b02aa3 | ||
|
|
2c12500745 | ||
|
|
b8617fc901 | ||
|
|
18db9f91c2 | ||
|
|
11e9de17e0 | ||
|
|
57639c22ce | ||
|
|
b18ba07620 | ||
|
|
5236afe58a | ||
|
|
0ea810d042 | ||
|
|
2c10c7b60e | ||
|
|
531f758ec1 | ||
|
|
c7dfce169f | ||
|
|
ae6ac870e2 | ||
|
|
a8fffa93cc | ||
|
|
8614c3ab29 | ||
|
|
73d6ed92ce | ||
|
|
26ff2416ab | ||
|
|
1c3217a14a | ||
|
|
9cd593e565 | ||
|
|
f177c4d92a | ||
|
|
36efbc1533 | ||
|
|
e16eec116b | ||
|
|
f130496e84 | ||
|
|
90e4639bd6 | ||
|
|
46f219c79e | ||
|
|
c87ac3e4a5 | ||
|
|
ef2af37ed7 | ||
|
|
11a78d929d | ||
|
|
000f656542 | ||
|
|
5b53adfdeb | ||
|
|
335d1d6234 | ||
|
|
0b21d0faef | ||
|
|
af896bec5c | ||
|
|
e53297ca42 | ||
|
|
28ab0a30b9 | ||
|
|
698987b479 | ||
|
|
d11eba1050 | ||
|
|
2725836076 | ||
|
|
eabcd4d6b3 | ||
|
|
4d3f01730a | ||
|
|
262c25de1f | ||
|
|
e1221bb7aa | ||
|
|
9ae55d1c19 | ||
|
|
a32f7f984c | ||
|
|
378ef997e0 | ||
|
|
64f4694063 | ||
|
|
9f4da8e5df | ||
|
|
7e6c7ba0d6 | ||
|
|
67fcbe599b | ||
|
|
1fb6c2eeb1 | ||
|
|
a23f99a011 | ||
|
|
9044c5f85a | ||
|
|
cacc31d129 | ||
|
|
d6a8129e57 | ||
|
|
267af1b608 | ||
|
|
0858d4ff45 | ||
|
|
2ff59d2801 | ||
|
|
ae2163df21 | ||
|
|
23f48cf633 | ||
|
|
00201fa860 | ||
|
|
fc1674bdc2 | ||
|
|
704cc15c49 | ||
|
|
3087f68c51 | ||
|
|
f953f4fbc2 | ||
|
|
07504a7ac2 | ||
|
|
64f779d6fb | ||
|
|
f817d55251 | ||
|
|
02b1f5d39d | ||
|
|
efb2cea238 | ||
|
|
91c55f0608 | ||
|
|
46c79ec2b2 | ||
|
|
b1584dedf3 | ||
|
|
49e64ebaf1 | ||
|
|
9ecdb73b85 | ||
|
|
684757a280 | ||
|
|
3811a948e5 | ||
|
|
8aae86855d | ||
|
|
886812b61b | ||
|
|
74cbbf9efd | ||
|
|
338922ef6c | ||
|
|
6da6547d79 | ||
|
|
5fce862c60 | ||
|
|
4d4b41cbf9 | ||
|
|
a34fe5827e | ||
|
|
89aee3bed6 | ||
|
|
5c8b7171a8 | ||
|
|
6bf2ec6727 | ||
|
|
3a2dc7862a | ||
|
|
0ce6737b9f | ||
|
|
75c3b8f382 | ||
|
|
c0247e1ac5 | ||
|
|
7cc5223c9c | ||
|
|
c17d1b3dbf | ||
|
|
b0cb06815c | ||
|
|
db6090551f | ||
|
|
75a8e8de07 | ||
|
|
df49bfbfb1 | ||
|
|
03ce2d731b | ||
|
|
cccba16e0c | ||
|
|
8a2827c5c4 | ||
|
|
37f8da7463 | ||
|
|
949a638b64 | ||
|
|
5291815656 | ||
|
|
5fd28d2eae | ||
|
|
7f3b2face1 | ||
|
|
156655dcb8 | ||
|
|
ecbcec1d10 | ||
|
|
3a1b3b1576 | ||
|
|
5048e5e810 | ||
|
|
626d85b5d6 | ||
|
|
b48123a872 | ||
|
|
468417340d | ||
|
|
51de4333dc | ||
|
|
80ecaa9148 | ||
|
|
a32a64e05f | ||
|
|
cf3590826c | ||
|
|
497ebcdb3a | ||
|
|
1eeaae2c74 | ||
|
|
a0ab4f095a | ||
|
|
59885957bc | ||
|
|
e3b1d1773f | ||
|
|
89d1ac2f07 | ||
|
|
566cb50dc3 | ||
|
|
f763475cef | ||
|
|
986d8db1a9 | ||
|
|
798a0e9f91 | ||
|
|
8413727de1 | ||
|
|
192c26cf0a | ||
|
|
72ebc60a1a | ||
|
|
1bfaf0bf7a | ||
|
|
8e3e1e7a2d | ||
|
|
6f6d130e91 | ||
|
|
0f0b4e2454 | ||
|
|
b4031f3c03 | ||
|
|
b26f4d4a58 | ||
|
|
1517376dc2 | ||
|
|
33b026f366 | ||
|
|
f68255b020 | ||
|
|
3ef448ba38 | ||
|
|
55dc474f1c | ||
|
|
8aa2e0239c | ||
|
|
97f7e68546 | ||
|
|
0c527635f2 | ||
|
|
e48262409d | ||
|
|
d0ce32c4ec | ||
|
|
b0414abaa4 | ||
|
|
8c3ed0fafd | ||
|
|
21c6a0606b | ||
|
|
32b53143f8 | ||
|
|
13a35576f0 | ||
|
|
dc985ae172 | ||
|
|
68c179cec9 | ||
|
|
975fd0407b | ||
|
|
9fb600fb49 | ||
|
|
566819509e | ||
|
|
8da4b69cb6 | ||
|
|
68451ea34c | ||
|
|
53085876a6 | ||
|
|
b57878aba5 | ||
|
|
6fca1977b0 | ||
|
|
b5a71ab87a | ||
|
|
3d807e8f17 | ||
|
|
654f8d029d | ||
|
|
4aff44eced | ||
|
|
8c37651ac6 | ||
|
|
41eaea3549 | ||
|
|
c81b6ed16c | ||
|
|
cef4a03029 | ||
|
|
e1c4d7ae4c | ||
|
|
b76726d608 | ||
|
|
0221752ff7 | ||
|
|
2a84fec15c | ||
|
|
e4160545b0 | ||
|
|
77f5ff090f | ||
|
|
26b60ce381 | ||
|
|
26d7189fc3 | ||
|
|
91281b622f | ||
|
|
184572b10f | ||
|
|
1800474bc1 | ||
|
|
a94ba526ac | ||
|
|
f7ee0a7c74 | ||
|
|
cc775c4fcd | ||
|
|
879c5ff41b | ||
|
|
6be63283f3 | ||
|
|
7e1b1a1eed | ||
|
|
3260ab1883 | ||
|
|
203e436b96 | ||
|
|
ca2f5a5856 | ||
|
|
3af0b9db53 | ||
|
|
263ec22d74 | ||
|
|
2f034284f1 | ||
|
|
b34ae35b92 | ||
|
|
efc81ca624 | ||
|
|
95b1374fa0 | ||
|
|
97b5eb6936 | ||
|
|
f04019de58 | ||
|
|
4c77d51e2a | ||
|
|
2f5d7ec575 | ||
|
|
d0c412677d | ||
|
|
8b50ca5ec6 | ||
|
|
fd6b61d061 | ||
|
|
ddcfecfa6f | ||
|
|
4f792d0a40 | ||
|
|
d62b63765d | ||
|
|
885d0082f8 | ||
|
|
79787ca9ed | ||
|
|
dd99682db2 | ||
|
|
488d479179 | ||
|
|
7708b43ae1 | ||
|
|
38a64717ae | ||
|
|
2ab58018c8 | ||
|
|
78c8600f66 | ||
|
|
7278e9942f | ||
|
|
03954e70df | ||
|
|
d80bb85d98 | ||
|
|
452725e80a | ||
|
|
6f99e81880 | ||
|
|
84455b03d5 | ||
|
|
e71e650b32 | ||
|
|
24eee05c86 | ||
|
|
0be9b10393 | ||
|
|
185e538f28 | ||
|
|
8335789202 | ||
|
|
62c5a6b9f0 | ||
|
|
3c2113e64a | ||
|
|
b0b2d070c4 | ||
|
|
c564a96e30 | ||
|
|
16a44127c6 | ||
|
|
1733204ca9 | ||
|
|
66d4819399 | ||
|
|
fbdbf8269c | ||
|
|
d02c3f499b | ||
|
|
9b268e8c07 | ||
|
|
76965c3e53 | ||
|
|
d92b1f1ae5 | ||
|
|
db2bc69d7d | ||
|
|
0e8ebe7ca2 | ||
|
|
46c80ed0b2 | ||
|
|
52e6bd7cc3 | ||
|
|
2f41901700 |
10 changed files with 945 additions and 203 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
|||
/libnbd-*.tar.gz
|
||||
/libnbd-*.tar.gz.sig
|
||||
/*~
|
||||
|
|
|
|||
|
|
@ -1,83 +0,0 @@
|
|||
From d2d3940a65dab60a2caeaf824eaff12fcc85e1f0 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 12 Sep 2019 10:28:19 +0100
|
||||
Subject: [PATCH 2/3] nbd_connect_tcp: Try to return errno from underlying
|
||||
connect(2) call.
|
||||
|
||||
When we make a TCP connection we have to make multiple underlying
|
||||
connect(2) calls, once for each address returned by getaddrinfo.
|
||||
Unfortunately this meant that we lost the errno from any of these
|
||||
calls:
|
||||
|
||||
$ nbdsh -c 'h.connect_tcp ("localhost", "nbd")'
|
||||
nbd.Error: nbd_connect_tcp: connect: localhost:nbd: could not connect to remote host
|
||||
|
||||
This commit saves the errno from the first failed connect(2):
|
||||
|
||||
$ ./run nbdsh -c 'h.connect_tcp ("localhost", "nbd")'
|
||||
nbd.Error: nbd_connect_tcp: connect: localhost:nbd: could not connect to remote host: Connection refused (ECONNREFUSED)
|
||||
---
|
||||
generator/states-connect.c | 12 ++++++++++--
|
||||
lib/internal.h | 1 +
|
||||
2 files changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/generator/states-connect.c b/generator/states-connect.c
|
||||
index 9e2e1d4..e9b3582 100644
|
||||
--- a/generator/states-connect.c
|
||||
+++ b/generator/states-connect.c
|
||||
@@ -128,6 +128,8 @@ disable_nagle (int sock)
|
||||
h->result = NULL;
|
||||
}
|
||||
|
||||
+ h->connect_errno = 0;
|
||||
+
|
||||
memset (&h->hints, 0, sizeof h->hints);
|
||||
h->hints.ai_family = AF_UNSPEC;
|
||||
h->hints.ai_socktype = SOCK_STREAM;
|
||||
@@ -160,7 +162,8 @@ disable_nagle (int sock)
|
||||
* Save errno from most recent connect(2) call. XXX
|
||||
*/
|
||||
SET_NEXT_STATE (%^START);
|
||||
- set_error (0, "connect: %s:%s: could not connect to remote host",
|
||||
+ set_error (h->connect_errno,
|
||||
+ "connect: %s:%s: could not connect to remote host",
|
||||
h->hostname, h->port);
|
||||
return -1;
|
||||
}
|
||||
@@ -182,6 +185,8 @@ disable_nagle (int sock)
|
||||
|
||||
if (connect (fd, h->rp->ai_addr, h->rp->ai_addrlen) == -1) {
|
||||
if (errno != EINPROGRESS) {
|
||||
+ if (h->connect_errno == 0)
|
||||
+ h->connect_errno = errno;
|
||||
SET_NEXT_STATE (%NEXT_ADDRESS);
|
||||
return 0;
|
||||
}
|
||||
@@ -203,8 +208,11 @@ disable_nagle (int sock)
|
||||
/* This checks the status of the original connect call. */
|
||||
if (status == 0)
|
||||
SET_NEXT_STATE (%^MAGIC.START);
|
||||
- else
|
||||
+ else {
|
||||
+ if (h->connect_errno == 0)
|
||||
+ h->connect_errno = status;
|
||||
SET_NEXT_STATE (%NEXT_ADDRESS);
|
||||
+ }
|
||||
return 0;
|
||||
|
||||
CONNECT_TCP.NEXT_ADDRESS:
|
||||
diff --git a/lib/internal.h b/lib/internal.h
|
||||
index a48edff..ccaca32 100644
|
||||
--- a/lib/internal.h
|
||||
+++ b/lib/internal.h
|
||||
@@ -188,6 +188,7 @@ struct nbd_handle {
|
||||
char *hostname, *port;
|
||||
struct addrinfo hints;
|
||||
struct addrinfo *result, *rp;
|
||||
+ int connect_errno;
|
||||
|
||||
/* When sending metadata contexts, this is used. */
|
||||
size_t querynum;
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
From b23b5b32250e5a03e4cc38ccf973e25e63ccc6d9 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 12 Sep 2019 10:38:48 +0100
|
||||
Subject: [PATCH 3/3] interop: Retry TCP connections to qemu-nbd.
|
||||
|
||||
The test interop-qemu-nbd-tls-certs frequently fails on slow (32 bit)
|
||||
machines in Fedora Koji. (Is crypto slow on these already overloaded
|
||||
machines?)
|
||||
|
||||
As we cannot wait for a signal when qemu-nbd is ready start serving,
|
||||
we have to use a sleep. The current sleep is 5 seconds, which is not
|
||||
long enough. Making the sleep longer would work but is inconsiderate
|
||||
for people using faster machines. Therefore replace this with a retry
|
||||
loop with exponential backoff.
|
||||
|
||||
I tested this with a simple wrapper around qemu-nbd which did:
|
||||
|
||||
sleep 5; exec /usr/bin/qemu-nbd "$@"
|
||||
---
|
||||
interop/interop.c | 19 +++++++++++++------
|
||||
1 file changed, 13 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/interop/interop.c b/interop/interop.c
|
||||
index 662d871..a3ab39b 100644
|
||||
--- a/interop/interop.c
|
||||
+++ b/interop/interop.c
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
+#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <libnbd.h>
|
||||
@@ -44,6 +45,7 @@ main (int argc, char *argv[])
|
||||
int port;
|
||||
char port_str[16];
|
||||
pid_t pid = -1;
|
||||
+ int retry;
|
||||
#endif
|
||||
int64_t actual_size;
|
||||
char buf[512];
|
||||
@@ -114,14 +116,19 @@ main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Unfortunately there's no good way to wait for qemu-nbd to start
|
||||
- * serving, so ...
|
||||
+ * serving, so we need to retry here.
|
||||
*/
|
||||
- sleep (5);
|
||||
-
|
||||
- if (nbd_connect_tcp (nbd, "localhost", port_str) == -1) {
|
||||
- fprintf (stderr, "%s\n", nbd_get_error ());
|
||||
- goto out;
|
||||
+ for (retry = 0; retry < 5; ++retry) {
|
||||
+ sleep (1 << retry);
|
||||
+ if (nbd_connect_tcp (nbd, "localhost", port_str) == -1) {
|
||||
+ fprintf (stderr, "%s\n", nbd_get_error ());
|
||||
+ if (nbd_get_errno () != ECONNREFUSED)
|
||||
+ goto out;
|
||||
+ }
|
||||
+ else break;
|
||||
}
|
||||
+ if (retry == 5)
|
||||
+ goto out;
|
||||
|
||||
#else /* !SERVE_OVER_TCP */
|
||||
|
||||
--
|
||||
2.23.0
|
||||
|
||||
55
copy-patches.sh
Executable file
55
copy-patches.sh
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash -
|
||||
|
||||
set -e
|
||||
|
||||
# Maintainer script to copy patches from the git repo to the current
|
||||
# directory. Use it like this:
|
||||
# ./copy-patches.sh
|
||||
|
||||
rhel_version=8.3
|
||||
|
||||
# Check we're in the right directory.
|
||||
if [ ! -f libnbd.spec ]; then
|
||||
echo "$0: run this from the directory containing 'libnbd.spec'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git_checkout=$HOME/d/libnbd-rhel-$rhel_version
|
||||
if [ ! -d $git_checkout ]; then
|
||||
echo "$0: $git_checkout does not exist"
|
||||
echo "This script is only for use by the maintainer when preparing a"
|
||||
echo "libnbd release on RHEL."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the base version of libnbd.
|
||||
version=`grep '^Version:' libnbd.spec | awk '{print $2}'`
|
||||
tag="v$version"
|
||||
|
||||
# Remove any existing patches.
|
||||
git rm -f [0-9]*.patch ||:
|
||||
rm -f [0-9]*.patch
|
||||
|
||||
# Get the patches.
|
||||
(cd $git_checkout; rm -f [0-9]*.patch; git format-patch -N $tag)
|
||||
mv $git_checkout/[0-9]*.patch .
|
||||
|
||||
# Remove any not to be applied.
|
||||
rm -f *NOT-FOR-RPM*.patch
|
||||
|
||||
# Add the patches.
|
||||
git add [0-9]*.patch
|
||||
|
||||
# Print out the patch lines.
|
||||
echo
|
||||
echo "--- Copy the following text into libnbd.spec file"
|
||||
echo
|
||||
|
||||
echo "# Patches."
|
||||
for f in [0-9]*.patch; do
|
||||
n=`echo $f | awk -F- '{print $1}'`
|
||||
echo "Patch$n: $f"
|
||||
done
|
||||
|
||||
echo
|
||||
echo "--- End of text"
|
||||
6
gating.yaml
Executable file
6
gating.yaml
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-*
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
Binary file not shown.
901
libnbd.spec
901
libnbd.spec
File diff suppressed because it is too large
Load diff
4
sources
4
sources
|
|
@ -1,2 +1,2 @@
|
|||
SHA512 (libnbd-1.0.3.tar.gz) = 47980c6b323046e983ee3c717b832e7cf29ba89e7c2f001a27ecb17ed55a2259ece78d71d661ddec3af45d316a198d80f253d13a265f60ae5a28c30ef84477a1
|
||||
SHA512 (libnbd-1.0.3.tar.gz.sig) = 07637d69abea513dfb03982776292a5e8cf5bc2962a3dd6ed36f9ed32e58d52795fa4eb3ba7ca7eee916a7271dba37bb3c2ee57f04a585070e0ba986da3f5cfc
|
||||
SHA512 (libnbd-1.24.0.tar.gz) = db05b606a19b3efb6a53c05b5b7ea96571892b7540fff1f4df0c53d0f82e3817f724fd0aa665597b58a4613545b03d7df6e1ac8f3fa64c7f85e824ca2221f3ae
|
||||
SHA512 (libnbd-1.24.0.tar.gz.sig) = 718b0ebeb3f3fa487682ef93184fc1851f44d3e74695b61e64f32d5de508833dba885aaea9366a29293ad60badce3cfafb8881b61a103559185517a2202fae27
|
||||
|
|
|
|||
15
tests/basic-test.sh
Executable file
15
tests/basic-test.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash -
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# Enable libnbd debugging.
|
||||
export LIBNBD_DEBUG=1
|
||||
|
||||
# Connect to nbdkit.
|
||||
nbdsh -c - <<EOF
|
||||
h.connect_command (["nbdkit", "-s", "--exit-with-parent",
|
||||
"memory", "size=1G"])
|
||||
size = h.get_size ()
|
||||
print ("size = %s" % size)
|
||||
assert size == 1073741824
|
||||
EOF
|
||||
12
tests/tests.yml
Executable file
12
tests/tests.yml
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-basic
|
||||
tags:
|
||||
- classic
|
||||
required_packages:
|
||||
- python3-libnbd
|
||||
- nbdkit
|
||||
tests:
|
||||
- simple:
|
||||
dir: .
|
||||
run: ./basic-test.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue