2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2024-11-27 03:39:11 +00:00
xcat-dep/libvirt/libvirt-socat.patch

35 lines
1.6 KiB
Diff
Raw Normal View History

diff -urN libvirt-0.6.5/src/remote_internal.c libvirt-0.6.5-socat/src/remote_internal.c
--- libvirt-0.6.5/src/remote_internal.c 2009-07-01 04:22:39.000000000 -0400
+++ libvirt-0.6.5-socat/src/remote_internal.c 2009-07-08 14:48:23.000000000 -0400
@@ -721,12 +721,26 @@
cmd_argv[j++] = strdup ("none");
}
cmd_argv[j++] = strdup (priv->hostname);
- cmd_argv[j++] = strdup (netcat ? netcat : "nc");
- cmd_argv[j++] = strdup ("-U");
- cmd_argv[j++] = strdup (sockname ? sockname :
+ if (netcat) {
+ cmd_argv[j++] = strdup (netcat);
+ cmd_argv[j++] = strdup ("-U");
+ cmd_argv[j++] = strdup (sockname ? sockname :
(flags & VIR_CONNECT_RO
? LIBVIRTD_PRIV_UNIX_SOCKET_RO
: LIBVIRTD_PRIV_UNIX_SOCKET));
+ } else { //Use socat, since some distros hate nc
+ char *socat_addr = 0;
+ cmd_argv[j++] = strdup ("socat");
+ cmd_argv[j++] = strdup ("-");
+ if ((asprintf (&socat_addr, "GOPEN:%s",sockname ? sockname :
+ (flags & VIR_CONNECT_RO
+ ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
+ : LIBVIRTD_PRIV_UNIX_SOCKET))) < 0) {
+ error (conn, VIR_ERR_SYSTEM_ERROR, strerror (ENOMEM));
+ goto failed;
+ }
+ cmd_argv[j++] = socat_addr;
+ }
cmd_argv[j++] = 0;
assert (j == nr_args);
for (j = 0; j < (nr_args-1); j++)
Binary files libvirt-0.6.5/src/.remote_internal.c.swp and libvirt-0.6.5-socat/src/.remote_internal.c.swp differ