2009-11-24 22:18:07 +01:00
|
|
|
Index: libvirt-0.7.4/src/remote/remote_driver.c
|
2008-09-01 17:06:07 +02:00
|
|
|
===================================================================
|
2009-11-24 22:18:07 +01:00
|
|
|
--- libvirt-0.7.4.orig/src/remote/remote_driver.c
|
|
|
|
+++ libvirt-0.7.4/src/remote/remote_driver.c
|
|
|
|
@@ -763,12 +763,29 @@ doRemoteOpen (virConnectPtr conn,
|
2008-09-01 17:06:07 +02:00
|
|
|
cmd_argv[j++] = strdup ("none");
|
|
|
|
}
|
|
|
|
cmd_argv[j++] = strdup (priv->hostname);
|
|
|
|
- cmd_argv[j++] = strdup (netcat ? netcat : "nc");
|
|
|
|
- cmd_argv[j++] = strdup ("-U");
|
2009-07-24 01:36:28 +02:00
|
|
|
- cmd_argv[j++] = strdup (sockname ? sockname :
|
|
|
|
- (flags & VIR_CONNECT_RO
|
|
|
|
- ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
|
|
|
|
- : LIBVIRTD_PRIV_UNIX_SOCKET));
|
2008-09-01 17:06:07 +02:00
|
|
|
+ if (netcat) {
|
|
|
|
+ cmd_argv[j++] = strdup (netcat);
|
|
|
|
+ cmd_argv[j++] = strdup ("-U");
|
2009-07-24 01:36:28 +02:00
|
|
|
+ cmd_argv[j++] = strdup (sockname ? sockname :
|
|
|
|
+ (flags & VIR_CONNECT_RO
|
|
|
|
+ ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
|
|
|
|
+ : LIBVIRTD_PRIV_UNIX_SOCKET));
|
2008-09-01 17:06:07 +02:00
|
|
|
+ } else {
|
|
|
|
+ cmd_argv[j++] = strdup ("socat");
|
|
|
|
+ cmd_argv[j++] = strdup ("-");
|
2009-01-29 01:42:42 +01:00
|
|
|
+
|
2009-07-24 01:36:28 +02:00
|
|
|
+ char *socat_addr = NULL;
|
2008-09-01 17:06:07 +02:00
|
|
|
+ if ((asprintf (&socat_addr, "GOPEN:%s",
|
2009-07-24 01:36:28 +02:00
|
|
|
+ sockname ? sockname :
|
|
|
|
+ (flags & VIR_CONNECT_RO
|
|
|
|
+ ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
|
|
|
|
+ : LIBVIRTD_PRIV_UNIX_SOCKET))) < 0) {
|
2008-09-01 17:06:07 +02:00
|
|
|
+ error (conn, VIR_ERR_SYSTEM_ERROR, strerror (ENOMEM));
|
|
|
|
+ goto failed;
|
|
|
|
+ }
|
2009-07-24 01:36:28 +02:00
|
|
|
+ cmd_argv[j++] = strdup (socat_addr);
|
|
|
|
+ VIR_FREE(socat_addr);
|
2008-09-01 17:06:07 +02:00
|
|
|
+ }
|
|
|
|
cmd_argv[j++] = 0;
|
|
|
|
assert (j == nr_args);
|
2008-10-08 18:23:52 +02:00
|
|
|
for (j = 0; j < (nr_args-1); j++)
|