2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2024-11-21 17:11:45 +00:00
xcat-dep/libvirt/libvirt-socat.patch
jbjohnso 1aa800cfa6 -Update patch for 0.6.5
-Fix spec for 0.6.5
2009-07-08 18:55:52 +00:00

35 lines
1.6 KiB
Diff

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