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
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
---
src/Makefile.am | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/Makefile.am b/src
On Mon, 21 Apr 2014 16:05:28 -0600
Eric Blake 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 (succe
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
---
src/util/virfile.c | 14 ++
src/util/virfile.h | 3 +++
2 files changed, 17 insertions
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
---
On Tue, 15 Apr 2014 12:30:47 +0100
"Daniel P. Berrange" 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" wrote:
> >
> > > On Tue, Apr 15, 2014 at 11:31:23A
On Tue, 15 Apr 2014 10:37:40 +0100
"Daniel P. Berrange" 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. T
s the total memory be correctly reported on musl libc and
uclibc.
Signed-off-by: Natanael Copa
---
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 100644
On Thu, 10 Apr 2014 15:53:57 -0600
Eric Blake 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)
> >>
On Thu, 10 Apr 2014 15:53:57 -0600
Eric Blake 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)
> >>
On Thu, 10 Apr 2014 09:22:42 -0600
Eric Blake 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) {
> &g
On Thu, 10 Apr 2014 08:24:20 -0600
Eric Blake 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.
> >
> > Sig
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
---
src/nodeinfo.c | 15 +++
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/src/nodeinfo.c b/src/nodein
We pass over the address/port start/end values many times so we put
them in structs.
Signed-off-by: Natanael Copa
---
Skip this patch if there are doubts.
src/conf/network_conf.c | 50 ++---
src/conf/network_conf.h | 13 +++-
src/network
Support setting which public ip to use for NAT via attribute
address in subelement in :
...
...
This will construct an iptables line using:
'-j SNAT --to-source -'
instead of:
'-j MASQUERADE'
Signed-off-by: Natanael Copa
---
docs/formatnetwork.html.i
Let users set the port range to be used for forward mode NAT:
...
...
Signed-off-by: Natanael Copa
---
docs/formatnetwork.html.in | 21 ++---
src/conf/network_conf.c | 56 +++--
src/conf/network_conf.h | 3
f snprintf and avoid strings 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 an
On Fri, 15 Feb 2013 14:03:37 -0500
Laine Stump wrote:
> On 02/11/2013 09:54 AM, Natanael Copa wrote:
> > Let users set the port range to be used for forward mode NAT:
> >
> > ...
> >
> >
> >
> >
> >
...
> > diff
Let users set the port range to be used for forward mode NAT:
...
...
Signed-off-by: Natanael Copa
---
docs/formatnetwork.html.in | 21 ++---
src/conf/network_conf.c | 57 +++--
src/conf/network_conf.h | 3
Support setting which public ip to use for NAT via attribute
address in subelement in :
...
...
This will construct an iptables line using:
'-j SNAT --to-source -'
instead of:
'-j MASQUERADE'
Signed-off-by: Natanael Copa
---
docs/formatnetwork.html.i
Changes v4:
- barf if 'end' attribute is missing in
- 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
On Fri, 8 Feb 2013 17:25:11 +
"Daniel P. Berrange" 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 in :
> >
> > ...
> >
> >
Let users set the port range to be used for forward mode NAT:
...
...
Signed-off-by: Natanael Copa
---
docs/formatnetwork.html.in | 21 ++---
src/conf/network_conf.c | 57 +++--
src/conf/network_conf.h | 3
Support setting which public ip to use for NAT via attribute
address in subelement in :
...
...
This will construct an iptables line using:
'-j SNAT --to-source -'
instead of:
'-j MASQUERADE'
Signed-off-by: Natanael Copa
---
docs/formatnetwork.html.i
Rebased patch[1].
Changes v3:
- remove support for 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 ip range for forward
Let users set the port range to be used for forward mode NAT:
...
...
Signed-off-by: Natanael Copa
---
docs/formatnetwork.html.in | 15 --
src/conf/network_conf.c | 50 +
src/conf/network_conf.h | 3
Support setting which public ip to use for NAT via attribute
address in subelement in :
...
...
This will construct an iptables line using:
'-j SNAT --to-source '
instead of:
'-j MASQUERADE'
Signed-off-by: Natanael Copa
---
docs/formatnetwork.html.i
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
---
This patch is unmodified since last time i sent it [1].
[1] https
00140.html
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
Allow setting a range of public ip addresses to be used as
source address for forward mode nat:
...
...
Signed-off-by: Natanael Copa
---
docs/formatnetwork.html.in | 13
src/conf/network_conf.c | 72 ++---
src/conf
Support setting which public ip to use for NAT via attribute
publicaddr. This will construct an iptables line using '-j SNAT
--to-source ' instead of '-j MASQUERADE'.
Signed-off-by: Natanael Copa
---
This depends on previous sent iptables refactor patch.
http://www.mail-arc
On Thu, 22 Nov 2012 15:02:18 +0100
Natanael Copa 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
On Thu, 22 Nov 2012 15:02:18 +0100
Natanael Copa 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
On Thu, 22 Nov 2012 06:53:12 -0700
Eric Blake 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
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
---
This started with me wanting to add support for setting the public
On Thu, 22 Nov 2012 13:36:14 +
"Daniel P. Berrange" 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/p
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
---
sr
40 matches
Mail list logo