pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NVMM not working anymore in qemu since 6.1.0 upgrade



Dear Marc,

On 2021-09-06, Marc Baudoin wrote:
> nia <nia%NetBSD.org@localhost> écrit :
> > On Sun, Sep 05, 2021 at 09:46:26PM +0200, Marc Baudoin wrote:
> > > nia <nia%NetBSD.org@localhost> écrit :
> > > > On Sun, Sep 05, 2021 at 08:38:14PM +0200, Marc Baudoin wrote:
> > > > > Hi,
> > > > > 
> > > > > Since the 6.1.0 upgrade, NVMM doesn't work anymore (tested on two
> > > > > NetBSD/amd64 9.2 systems):
> > > > > 
> > > > > % qemu-system-x86_64 -accel nvmm ...
> > > > > qemu-system-x86_64: -accel nvmm: invalid accelerator nvmm
> > > > > 
> > > > > What's going on?
> > > > 
> > > > The NVMM support that was upstreamed to QEMU only supports
> > > > NetBSD CURRENT and the package keeps getting updated with no
> > > > testing on NetBSD 9. I can have a look...
> > > 
> > > Well, I believe most NetBSD users use some kind of stable version
> > > instead of -current so it would be nice if pkgsrc packages
> > > would target preferably the last stable NetBSD version.
> > 
> > Yea, I agree.
> > 
> > I committed a fix.
> 
> Works great, thanks a lot!

I noticed your issue with networking reported here:

 https://gitlab.com/qemu-project/qemu/-/issues/605

and followed up with a proposed patch (also below)

 https://gitlab.freedesktop.org/slirp/libslirp/-/issues/52

The patch should be applied in ${WRKSRC} before building.
I have only tested a little, but the immediate crash seems
to be resolved/worked around with this change.

-- 
Kind regards,

Yorick Hardy


$NetBSD$

Use the exact length for the sockaddr structure. Needed on NetBSD.

--- slirp/src/tcp_subr.c.orig	2021-08-24 17:36:28.000000000 +0000
+++ slirp/src/tcp_subr.c
@@ -473,7 +473,11 @@ void tcp_connect(struct socket *inso)
 
     DEBUG_CALL("tcp_connect");
     DEBUG_ARG("inso = %p", inso);
-    ret = getnameinfo((const struct sockaddr *) &inso->lhost.ss, sizeof(inso->lhost.ss), addrstr, sizeof(addrstr), portstr, sizeof(portstr), NI_NUMERICHOST|NI_NUMERICSERV);
+    if (inso->lhost.ss.ss_family == AF_INET)
+        addrlen = sizeof(struct sockaddr_in);
+    if (inso->lhost.ss.ss_family == AF_INET6)
+        addrlen = sizeof(struct sockaddr_in6);
+    ret = getnameinfo((const struct sockaddr *) &inso->lhost.ss, addrlen, addrstr, sizeof(addrstr), portstr, sizeof(portstr), NI_NUMERICHOST|NI_NUMERICSERV);
     g_assert(ret == 0);
     DEBUG_ARG("ip = [%s]:%s", addrstr, portstr);
     DEBUG_ARG("so_state = 0x%x", inso->so_state);


Home | Main Index | Thread Index | Old Index