On Wed, 19 Aug 2020 11:55:06 +0100
Daniel P. Berrangé wrote:
> On Wed, Aug 19, 2020 at 12:03:41PM +0200, Natanael Copa wrote:
> > Add a portable generic implementation of virMassClose as fallback on
> > non-FreeBSD and non-glibc.
> >
> > This implementation uses pol
Fix a couple of deadlocks due to use of async-unsafe calls (malloc/free)
after fork() and before exec(). They don't fix all theoretical problems
but at least they make libvirt usable again with musl 1.2 on Alpine Linux.
Natanael Copa (2):
util: avoid free() when reset log after fork
util
Doing malloc/free after fork is techincally not allowed in POSIX and
deadlocks[1] with musl libc.
[1]: https://gitlab.com/libvirt/libvirt/-/issues/52
Signed-off-by: Natanael Copa
---
src/util/vircommand.c | 4 ++--
src/util/virlog.c | 44 +--
src
Add a portable generic implementation of virMassClose as fallback on
non-FreeBSD and non-glibc.
This implementation uses poll(2) to look for open files to keep
performance reasonable while not using any mallocs.
This solves a deadlock with musl libc.
Signed-off-by: Natanael Copa
---
src/util
Always add udev linker flags when WITH_UDEV is enabled to avoid
underlinking.
See commit 43dbcb15 (interface: always build all available backends)
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
src/Makefile.am | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src
On Mon, 21 Apr 2014 16:05:28 -0600
Eric Blake ebl...@redhat.com wrote:
On 04/20/2014 05:53 AM, Natanael Copa wrote:
...
+/* return 0 = success, 1 = end-of-dir and -1 = error */
This logic is a bit odd to reason about. I think 1 = success (returned
1 entry), 0 = end-of-dir (successfully
Introduce a wrapper for readdir. This helps us make sure that we always
set errno before calling readdir and it will make sure errors are
properly logged.
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
src/util/virfile.c | 14 ++
src/util/virfile.h | 3 +++
2 files changed
This makes sure that errno is reset before readdir is called, even if
the loop does a 'continue'.
This fixes issue with musl libc which sets errno on sscanf. The
following 'continue' makes the errno be set before calling readdir.
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
src
On Thu, 10 Apr 2014 15:53:57 -0600
Eric Blake ebl...@redhat.com wrote:
On 04/10/2014 02:52 PM, Natanael Copa wrote:
I suppose we could use helper function to make it more readable:
int virReaddir(DIR *dirp, struct dirent **ent)
{
errno = 0;
*ent = readdir(dirp
the total memory be correctly reported on musl libc and
uclibc.
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
configure.ac | 2 +-
src/nodeinfo.c | 22 --
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 52c50df..32a2e5a
On Tue, 15 Apr 2014 10:37:40 +0100
Daniel P. Berrange berra...@redhat.com wrote:
On Tue, Apr 15, 2014 at 11:31:23AM +0200, Natanael Copa wrote:
The gnulib's physmem_total will as a fallback report 64MB as total
memory if sysconf(_SC_PHYS_PAGES) is unimplemented on linux. This makes
On Tue, 15 Apr 2014 12:30:47 +0100
Daniel P. Berrange berra...@redhat.com wrote:
On Tue, Apr 15, 2014 at 01:26:27PM +0200, Natanael Copa wrote:
On Tue, 15 Apr 2014 10:37:40 +0100
Daniel P. Berrange berra...@redhat.com wrote:
On Tue, Apr 15, 2014 at 11:31:23AM +0200, Natanael Copa wrote
On Thu, 10 Apr 2014 15:53:57 -0600
Eric Blake ebl...@redhat.com wrote:
On 04/10/2014 02:52 PM, Natanael Copa wrote:
I suppose we could use helper function to make it more readable:
int virReaddir(DIR *dirp, struct dirent **ent)
{
errno = 0;
*ent = readdir(dirp
We must always reset errno to 0 even if we do 'continue'.
This fixes runtime with musl libc which will set errno on sscanf.
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
src/nodeinfo.c | 15 +++
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/src/nodeinfo.c b
On Thu, 10 Apr 2014 08:24:20 -0600
Eric Blake ebl...@redhat.com wrote:
On 04/10/2014 08:04 AM, Natanael Copa wrote:
We must always reset errno to 0 even if we do 'continue'.
This fixes runtime with musl libc which will set errno on sscanf.
Signed-off-by: Natanael Copa nc
On Thu, 10 Apr 2014 09:22:42 -0600
Eric Blake ebl...@redhat.com wrote:
On 04/10/2014 08:38 AM, Natanael Copa wrote:
-errno = 0;
-while ((cpudirent = readdir(cpudir))) {
+for (errno = 0; (cpudirent = readdir(cpudir)); errno = 0) {
if (sscanf(cpudirent-d_name, cpu%u
on stack
- Add an optional 3rd patch that uses structs for addr and port ranges.
Natanael Copa (3):
net: support set public ip range for forward mode nat
net: add support for specifying port range for forward mode nat
net: use structs for address and port ranges
docs/formatnetwork.html.in
Let users set the port range to be used for forward mode NAT:
...
forward mode='nat'
nat
port start='1024' end='65535'/
/nat
/forward
...
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
docs/formatnetwork.html.in | 21 ++---
src/conf/network_conf.c | 56
'
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
docs/formatnetwork.html.in | 18 ++
src/conf/network_conf.c | 152 ++--
src/conf/network_conf.h | 3 +
src/network/bridge_driver.c | 16 +
src/util/viriptables.c | 63
We pass over the address/port start/end values many times so we put
them in structs.
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
Skip this patch if there are doubts.
src/conf/network_conf.c | 50 ++---
src/conf/network_conf.h | 13
On Fri, 15 Feb 2013 14:03:37 -0500
Laine Stump la...@laine.org wrote:
On 02/11/2013 09:54 AM, Natanael Copa wrote:
Let users set the port range to be used for forward mode NAT:
...
forward mode='nat'
nat
port start='1024' end='65535'/
/nat
/forward
...
diff
Rebased patch[1].
Changes v3:
- remove support for nat address='1.2.3.4'/ format, the 2/4 patch[2].
[1] http://www.redhat.com/archives/libvir-list/2013-February/msg00088.html
[2] http://www.redhat.com/archives/libvir-list/2013-February/msg00090.html
Natanael Copa (2):
net: support set public
'
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
docs/formatnetwork.html.in | 17 ++
src/conf/network_conf.c | 146 ++--
src/conf/network_conf.h | 3 +
src/network/bridge_driver.c | 16 +
src/util/viriptables.c | 56
Let users set the port range to be used for forward mode NAT:
...
forward mode='nat'
nat
port start='1024' end='65535'/
/nat
/forward
...
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
docs/formatnetwork.html.in | 21 ++---
src/conf/network_conf.c | 57
On Fri, 8 Feb 2013 17:25:11 +
Daniel P. Berrange berra...@redhat.com wrote:
On Mon, Feb 04, 2013 at 10:45:24AM +0100, Natanael Copa wrote:
Support setting which public ip to use for NAT via attribute
address in subelement nat in forward:
...
forward mode='nat'
nat
Changes v4:
- barf if 'end' attribute is missing in address
- update doc to tell how to properly set single address
Natanael Copa (2):
net: support set public ip range for forward mode nat
net: add support for specifying port range for forward mode nat
docs/formatnetwork.html.in | 33
'
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
docs/formatnetwork.html.in | 18 ++
src/conf/network_conf.c | 152 ++--
src/conf/network_conf.h | 3 +
src/network/bridge_driver.c | 16 +
src/util/viriptables.c | 56
Let users set the port range to be used for forward mode NAT:
...
forward mode='nat'
nat
port start='1024' end='65535'/
/nat
/forward
...
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
docs/formatnetwork.html.in | 21 ++---
src/conf/network_conf.c | 57
Allow setting a range of public ip addresses to be used as
source address for forward mode nat:
...
forward mode='nat'
nat
address start='1.2.3.4' end='1.2.3.10'/
/nat
/forward
...
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
docs/formatnetwork.html.in | 13
Natanael Copa (4):
util: refactor iptables command construction into multiple steps
net: support set public ip for forward mode nat
net: support a public address range for forward mode nat
net: add support for specifying port range for forward mode nat
docs/formatnetwork.html.in | 37
Instead of creating an iptables command in one shot, do it in steps
so we can add conditional options like physdev and protocol.
This removes code duplication while keeping existing behaviour.
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
This patch is unmodified since last time i sent
-by: Natanael Copa nc...@alpinelinux.org
---
docs/formatnetwork.html.in | 13 ++
src/conf/network_conf.c | 100 +---
src/conf/network_conf.h | 3 ++
src/network/bridge_driver.c | 8
src/util/viriptables.c | 45 +++-
src
Let users set the port range to be used for forward mode NAT:
...
forward mode='nat'
nat
port start='1024' end='65535'/
/nat
/forward
...
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
docs/formatnetwork.html.in | 15 --
src/conf/network_conf.c | 50
Support setting which public ip to use for NAT via attribute
publicaddr. This will construct an iptables line using '-j SNAT
--to-source publicaddr' instead of '-j MASQUERADE'.
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
This depends on previous sent iptables refactor patch.
http
On Thu, 22 Nov 2012 15:02:18 +0100
Natanael Copa nc...@alpinelinux.org wrote:
Instead of creating an iptables command in one shot, do it in steps
so we can add conditional options like physdev and protocol.
This removes code duplication while keeping existing behaviour.
Signed-off
Fixes this error when building with -Werror on Alpine Linux:
util/processinfo.c: In function 'virProcessInfoSetAffinity':
util/processinfo.c:52:5: error: implicit declaration of function 'malloc'
[-Werror=implicit-function-declaration]
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
src
On Thu, 22 Nov 2012 13:36:14 +
Daniel P. Berrange berra...@redhat.com wrote:
On Thu, Nov 22, 2012 at 01:28:08PM +0100, Natanael Copa wrote:
Fixes this error when building with -Werror on Alpine Linux:
...
--- a/src/util/processinfo.c
+++ b/src/util/processinfo.c
@@ -21,6 +21,7
Instead of creating an iptables command in one shot, do it in steps
so we can add conditional options like physdev and protocol.
This removes code duplication while keeping existing behaviour.
Signed-off-by: Natanael Copa nc...@alpinelinux.org
---
This started with me wanting to add support
On Thu, 22 Nov 2012 06:53:12 -0700
Eric Blake ebl...@redhat.com wrote:
On 11/22/2012 06:46 AM, Natanael Copa wrote:
If your headers are defining this in terms of malloc(), then IMHO,
the sched.h should be including stdlib.h on our behalf. IOW, I
think this is a bug in the c library headers
On Thu, 22 Nov 2012 15:02:18 +0100
Natanael Copa nc...@alpinelinux.org wrote:
Instead of creating an iptables command in one shot, do it in steps
so we can add conditional options like physdev and protocol.
This removes code duplication while keeping existing behaviour.
Signed-off
40 matches
Mail list logo