[Pkg-libvirt-commits] [SCM] Libvirt Debian packaging branch, experimental, updated. debian/0.9.2-6-9-g65871eb

Guido Günther agx at sigxcpu.org
Mon Jul 11 07:24:52 UTC 2011


The following commit has been merged in the experimental branch:
commit 65871ebeda11e4f1c9295a152bd5803836cf77e2
Author: Guido Günther <agx at sigxcpu.org>
Date:   Sun Jul 10 18:28:51 2011 +0200

    Adjust nc autodetect patch to new socket code

diff --git a/debian/patches/Autodetect-if-the-remote-nc-command-supports-the-q-o.patch b/debian/patches/Autodetect-if-the-remote-nc-command-supports-the-q-o.patch
index 5434da0..2920322 100644
--- a/debian/patches/Autodetect-if-the-remote-nc-command-supports-the-q-o.patch
+++ b/debian/patches/Autodetect-if-the-remote-nc-command-supports-the-q-o.patch
@@ -1,5 +1,5 @@
 From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx at sigxcpu.org>
-Date: Wed, 6 Oct 2010 18:12:46 +0200
+Date: Fri, 8 Jul 2011 21:07:29 +0200
 Subject: Autodetect if the remote nc command supports the -q option
 
 Author: Marc Deslauriers <marc.deslauriers at ubuntu.com>
@@ -12,53 +12,45 @@ Ubuntu-Bug: https://bugs.launchpad.net/ubuntu/+source/virt-manager/+bug/605172
 Bug: https://bugzilla.redhat.com/show_bug.cgi?id=562176
 Bug: https://bugzilla.redhat.com/show_bug.cgi?id=614420
 ---
- src/remote/remote_driver.c |   34 +++++++++++++++++++++++++++++-----
- 1 files changed, 29 insertions(+), 5 deletions(-)
+ src/rpc/virnetsocket.c |   27 ++++++++++++++++++++++++---
+ 1 files changed, 24 insertions(+), 3 deletions(-)
 
-diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
-index 8335a1a..3058381 100644
---- a/src/remote/remote_driver.c
-+++ b/src/remote/remote_driver.c
-@@ -774,12 +774,36 @@ doRemoteOpen (virConnectPtr conn,
-             virCommandAddArgList(cmd, "-T", "-o", "BatchMode=yes", "-e",
-                                  "none", NULL);
-         }
--        virCommandAddArgList(cmd, priv->hostname, netcat ? netcat : "nc",
--                             "-U", (sockname ? sockname :
--                                    (flags & VIR_CONNECT_RO
--                                     ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
--                                     : LIBVIRTD_PRIV_UNIX_SOCKET)), NULL);
- 
-+        virCommandAddArgList(cmd, priv->hostname, "sh -c", NULL);
-+        /*
-+         * This ugly thing is a shell script to detect availability of
-+         * the -q option for 'nc': debian and suse based distros need this
-+         * flag to ensure the remote nc will exit on EOF, so it will go away
-+         * when we close the VNC tunnel. If it doesn't go away, subsequent
-+         * VNC connection attempts will hang.
-+         *
-+         * Fedora's 'nc' doesn't have this option, and apparently defaults
-+         * to the desired behavior.
-+         */
-+        virCommandAddArgFormat(cmd, "'%s -q 2>&1 | grep -q \"requires an argument\";"
-+                               "if [ $? -eq 0 ] ; then"
-+                               "   CMD=\"%s -q 0 -U %s\";"
-+                               "else"
-+                               "   CMD=\"%s -U %s\";"
-+                               "fi;"
-+                               "eval \"$CMD\";'",
-+                               netcat ? netcat : "nc",
-+                               netcat ? netcat : "nc",
-+                               sockname ? sockname :
-+                                (flags & VIR_CONNECT_RO
-+                                 ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
-+                                 : LIBVIRTD_PRIV_UNIX_SOCKET),
-+                               netcat ? netcat : "nc",
-+                               sockname ? sockname :
-+                                (flags & VIR_CONNECT_RO
-+                                 ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
-+                                 : LIBVIRTD_PRIV_UNIX_SOCKET));
-         priv->is_secure = 1;
-     }
+diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
+index 4b0c2ee..391b08a 100644
+--- a/src/rpc/virnetsocket.c
++++ b/src/rpc/virnetsocket.c
+@@ -596,9 +596,30 @@ int virNetSocketNewConnectSSH(const char *nodename,
+     if (noTTY)
+         virCommandAddArgList(cmd, "-T", "-o", "BatchMode=yes",
+                              "-e", "none", NULL);
+-    virCommandAddArgList(cmd, nodename,
+-                         netcat ? netcat : "nc",
+-                         "-U", path, NULL);
++
++    virCommandAddArgList(cmd, nodename, "sh -c", NULL);
++    /*
++     * This ugly thing is a shell script to detect availability of
++     * the -q option for 'nc': debian and suse based distros need this
++     * flag to ensure the remote nc will exit on EOF, so it will go away
++     * when we close the VNC tunnel. If it doesn't go away, subsequent
++     * VNC connection attempts will hang.
++     *
++     * Fedora's 'nc' doesn't have this option, and apparently defaults
++     * to the desired behavior.
++     */
++    virCommandAddArgFormat(cmd, "'%s -q 2>&1 | grep -q \"requires an argument\";"
++                           "if [ $? -eq 0 ] ; then"
++                           "   CMD=\"%s -q 0 -U %s\";"
++                           "else"
++                           "   CMD=\"%s -U %s\";"
++                           "fi;"
++                           "eval \"$CMD\";'",
++                           netcat ? netcat : "nc",
++                           netcat ? netcat : "nc",
++                           path,
++                           netcat ? netcat : "nc",
++                           path);
  
+     return virNetSocketNewConnectCommand(cmd, retsock);
+ }
 -- 
diff --git a/debian/patches/series b/debian/patches/series
index e009409..ac5d75b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,9 +2,9 @@ remove-RHism.diff.patch
 qemu-disable-network.diff.patch
 allow-libvirt-group-to-access-the-socket.patch
 fix-Debian-specific-path-to-hvm-loader.patch
-Autodetect-if-the-remote-nc-command-supports-the-q-o.patch
 patch-qemuMonitorTextGetMigrationStatus-to-intercept.patch
 Debianize-libvirt-guests.patch
 virsh-Initialize-library-before-calling-virResetLast.patch
 Disable-daemon-start-test.patch
 Disable-gnulib-s-test-nonplocking-pipe.sh.patch
+Autodetect-if-the-remote-nc-command-supports-the-q-o.patch

-- 
Libvirt Debian packaging



More information about the Pkg-libvirt-commits mailing list