+Fri Oct 26 21:17:44 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+
+ * src/qemu_driver.c: Refactor shell ecscaping function to reuse
+ for monitor escaping
+
Fri Oct 26 21:14:44 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/qemu_conf.h, src/qemu_conf.c: Refactor device parsing code
}
-static char *qemudEscapeShellArg(const char *in)
+static char *qemudEscape(const char *in, int shell)
{
int len = 0;
int i, j;
len += 2;
break;
case '\'':
- len += 5;
+ if (shell)
+ len += 5;
+ else
+ len += 1;
break;
default:
len += 1;
out[j++] = in[i];
break;
case '\'':
- out[j++] = '\'';
- out[j++] = '\\';
- out[j++] = '\\';
- out[j++] = '\'';
- out[j++] = '\'';
+ if (shell) {
+ out[j++] = '\'';
+ out[j++] = '\\';
+ out[j++] = '\\';
+ out[j++] = '\'';
+ out[j++] = '\'';
+ } else {
+ out[j++] = in[i];
+ }
break;
default:
out[j++] = in[i];
return out;
}
+static char *qemudEscapeShellArg(const char *in)
+{
+ return qemudEscape(in, 1);
+}
#define QEMUD_SAVE_MAGIC "LibvirtQemudSave"
#define QEMUD_SAVE_VERSION 1