<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 11/02/2011 02:57 PM, Guido Günther wrote:
    <blockquote cite="mid:20111102185713.GA2936@bogon.sigxcpu.org"
      type="cite">
      <pre wrap="">On Mon, Oct 31, 2011 at 05:51:55PM +0800, Daniel Veillard wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">  We are now entering the freeze for libvirt-0.9.7 .
We may make an exception for patch set which got a few round of reviews
though, like Stefan's ones (v4 IIRC), and anything which we know may
need fixing in the API before the release.

I have made a release candidate 1 tarball (and associated rpms) at
   <a class="moz-txt-link-freetext" href="ftp://libvirt.org/libvirt/libvirt-0.9.7-rc1.tar.gz">ftp://libvirt.org/libvirt/libvirt-0.9.7-rc1.tar.gz</a>

I think I will make an rc2 on Wed or Thu and then try to
make the release around Friday of the end of the week if things
looks good.

  Please give it a try !
</pre>
      </blockquote>
      <pre wrap="">Built fine on most Debian architectures:

        <a class="moz-txt-link-freetext" href="https://buildd.debian.org/status/package.php?p=libvirt&suite=experimental">https://buildd.debian.org/status/package.php?p=libvirt&suite=experimental</a>

The built failure on amd64 is due to virnetsockettest failing with:

 5) Socket UNIX Accept... libvir: RPC error : Path /build/buildd-libvirt_0.9.7~rc1-1-amd64-EGXZTE/libvirt-0.9.7~rc1/debian/build/tests/virnetsockettest-test.sock too long for unix socket: Cannot allocate memory

since the socket path doesn't fit in UNIX_PATH_MAX. Since exceeding the
path shouldn't't be fatal I'm using the attached patch.
Cheers,
 -- Guido
</pre>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
--
libvir-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/libvir-list">https://www.redhat.com/mailman/listinfo/libvir-list</a><blockquote type="cite">From: =?UTF-8?q?Guido=20G=C3=BCnther?= <a class="moz-txt-link-rfc2396E" href="mailto:agx@sigxcpu.org"><agx@sigxcpu.org></a>
Date: Wed, 2 Nov 2011 19:02:42 +0100
Subject: Skip socket test if we exceed UNIX_PATH_MAX.

As seen on the amd64 buildd with:

 5) Socket UNIX Accept... libvir: RPC error : Path /build/buildd-libvirt_0.9.7~rc1-1-amd64-EGXZTE/libvirt-0.9.7~rc1/debian/build/tests/virnetsockettest-test.sock too long for unix socket: Cannot allocate memory
---
 tests/virnetsockettest.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 1b88605..d7c0c4f 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -205,11 +205,13 @@ static int testSocketUNIXAccept(const void *data ATTRIBUTE_UNUSED)
     if (progname[0] == '/') {
         if (virAsprintf(&path, "%s-test.sock", progname) < 0) {
             virReportOOMError();
+            ret = EXIT_AM_SKIP;
             goto cleanup;
         }
     } else {
         if (virAsprintf(&path, "%s/%s-test.sock", abs_builddir, progname) < 0) {
             virReportOOMError();
+            ret = EXIT_AM_SKIP;
             goto cleanup;
         }
     }
@@ -254,11 +256,13 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED)
     if (progname[0] == '/') {
         if (virAsprintf(&path, "%s-test.sock", progname) < 0) {
             virReportOOMError();
+            ret = EXIT_AM_SKIP;
             goto cleanup;
         }
     } else {
         if (virAsprintf(&path, "%s/%s-test.sock", abs_builddir, progname) < 0) {
             virReportOOMError();
+            ret = EXIT_AM_SKIP;
             goto cleanup;
         }
     }
-- </blockquote></pre>
    </blockquote>
    This patch is not correct. The code is failing further below when
    calling virNetSocketNewListenUNIX. I am surprised if this makes it
    work for your test env since it shouldn't run out of memory there.<br>
    The problem is obviously that the path exceeds 108 (UNIX_PATH_MAX)
    characters, the max. for the UnixIO socket path. The solution may
    either be to fall back to a path in /tmp (but why not do this always
    then) or to cut down the progname + abs_builddir pair to a max of
    ~97 chars or to try to build in a shorter path...<br>
    <br>
    Maybe the following one works:<br>
    <br>
    diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c<br>
    index 6320ce0..b5c14a1 100644<br>
    --- a/tests/virnetsockettest.c<br>
    +++ b/tests/virnetsockettest.c<br>
    @@ -25,6 +25,9 @@<br>
     #ifdef HAVE_IFADDRS_H<br>
     # include <ifaddrs.h><br>
     #endif<br>
    +#ifndef WIN32<br>
    +# include <sys/un.h><br>
    +#endif<br>
     <br>
     #include "testutils.h"<br>
     #include "util.h"<br>
    @@ -200,6 +203,8 @@ static int testSocketUNIXAccept(const void *data
    ATTRIBUTE_UNUSED)<br>
         virNetSocketPtr ssock = NULL; /* Server socket */<br>
         virNetSocketPtr csock = NULL; /* Client socket */<br>
         int ret = -1;<br>
    +    int tmpfd = -1;<br>
    +    struct sockaddr_un sun;<br>
     <br>
         char *path;<br>
         if (progname[0] == '/') {<br>
    @@ -214,6 +219,19 @@ static int testSocketUNIXAccept(const void
    *data ATTRIBUTE_UNUSED)<br>
             }<br>
         }<br>
     <br>
    +    if (strlen(path) >= sizeof(sun.sun_path)) {<br>
    +        if (!virStrcpy(path, "/tmp/test.sock.XXXXXX",
    sizeof(sun.sun_path))) {<br>
    +            VIR_DEBUG("Unexpected error using virStrcpyStatic");<br>
    +            goto cleanup;<br>
    +        }<br>
    +        tmpfd = mkostemp(path, 0700);<br>
    +        if (tmpfd < 0) {<br>
    +            virReportSystemError(errno, "%s",<br>
    +                                 _("Failed to create temporary
    file"));<br>
    +            goto cleanup;<br>
    +        }<br>
    +    }<br>
    +<br>
         if (virNetSocketNewListenUNIX(path, 0700, -1, getgid(),
    &lsock) < 0)<br>
             goto cleanup;<br>
     <br>
    @@ -236,6 +254,10 @@ static int testSocketUNIXAccept(const void
    *data ATTRIBUTE_UNUSED)<br>
         ret = 0;<br>
     <br>
     cleanup:<br>
    +    if (tmpfd >= 0) {<br>
    +        unlink(path);<br>
    +        VIR_FORCE_CLOSE(tmpfd);<br>
    +    }<br>
         VIR_FREE(path);<br>
         virNetSocketFree(lsock);<br>
         virNetSocketFree(ssock);<br>
    @@ -249,6 +271,8 @@ static int testSocketUNIXAddrs(const void *data
    ATTRIBUTE_UNUSED)<br>
         virNetSocketPtr ssock = NULL; /* Server socket */<br>
         virNetSocketPtr csock = NULL; /* Client socket */<br>
         int ret = -1;<br>
    +    int tmpfd = -1;<br>
    +    struct sockaddr_un sun;<br>
     <br>
         char *path;<br>
         if (progname[0] == '/') {<br>
    @@ -263,6 +287,19 @@ static int testSocketUNIXAddrs(const void *data
    ATTRIBUTE_UNUSED)<br>
             }<br>
         }<br>
     <br>
    +    if (strlen(path) >= sizeof(sun.sun_path)) {<br>
    +        if (!virStrcpy(path, "/tmp/test.sock.XXXXXX",
    sizeof(sun.sun_path))) {<br>
    +            VIR_DEBUG("Unexpected error using virStrcpyStatic");<br>
    +            goto cleanup;<br>
    +        }<br>
    +        tmpfd = mkostemp(path, 0700);<br>
    +        if (tmpfd < 0) {<br>
    +            virReportSystemError(errno, "%s",<br>
    +                                 _("Failed to create temporary
    file"));<br>
    +            goto cleanup;<br>
    +        }<br>
    +    }<br>
    +<br>
         if (virNetSocketNewListenUNIX(path, 0700, -1, getgid(),
    &lsock) < 0)<br>
             goto cleanup;<br>
     <br>
    @@ -313,6 +350,10 @@ static int testSocketUNIXAddrs(const void *data
    ATTRIBUTE_UNUSED)<br>
         ret = 0;<br>
     <br>
     cleanup:<br>
    +    if (tmpfd >= 0) {<br>
    +        unlink(path);<br>
    +        VIR_FORCE_CLOSE(tmpfd);<br>
    +    }<br>
         VIR_FREE(path);<br>
         virNetSocketFree(lsock);<br>
         virNetSocketFree(ssock);<br>
    <br>
    <br>
         Stefan<br>
    <br>
  </body>
</html>