mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
util: virqemu: introduce virQEMUBuildBufferEscape
This will eventually replace virQEMUBuildBufferEscapeComma, however it's not possible right now. Some parts of the code that uses the old function needs to be refactored. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
726403461b
commit
22b02f4492
@ -2298,6 +2298,7 @@ virProcessWait;
|
|||||||
|
|
||||||
|
|
||||||
# util/virqemu.h
|
# util/virqemu.h
|
||||||
|
virQEMUBuildBufferEscape;
|
||||||
virQEMUBuildBufferEscapeComma;
|
virQEMUBuildBufferEscapeComma;
|
||||||
virQEMUBuildCommandLineJSON;
|
virQEMUBuildCommandLineJSON;
|
||||||
virQEMUBuildCommandLineJSONArrayBitmap;
|
virQEMUBuildCommandLineJSONArrayBitmap;
|
||||||
|
@ -299,6 +299,23 @@ virQEMUBuildBufferEscapeComma(virBufferPtr buf, const char *str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* virQEMUBuildBufferEscape:
|
||||||
|
* @buf: buffer to append the escaped string
|
||||||
|
* @str: the string to escape
|
||||||
|
*
|
||||||
|
* Some characters passed as values on the QEMU command line must be escaped.
|
||||||
|
*
|
||||||
|
* - ',' must by escaped by ','
|
||||||
|
* - '=' must by escaped by '\'
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
virQEMUBuildBufferEscape(virBufferPtr buf, const char *str)
|
||||||
|
{
|
||||||
|
virBufferEscapeN(buf, "%s", str, ',', ",", '\\', "=", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virQEMUBuildLuksOpts:
|
* virQEMUBuildLuksOpts:
|
||||||
* @buf: buffer to build the string into
|
* @buf: buffer to build the string into
|
||||||
|
@ -50,6 +50,7 @@ char *virQEMUBuildObjectCommandlineFromJSON(const char *type,
|
|||||||
char *virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr src);
|
char *virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr src);
|
||||||
|
|
||||||
void virQEMUBuildBufferEscapeComma(virBufferPtr buf, const char *str);
|
void virQEMUBuildBufferEscapeComma(virBufferPtr buf, const char *str);
|
||||||
|
void virQEMUBuildBufferEscape(virBufferPtr buf, const char *str);
|
||||||
void virQEMUBuildLuksOpts(virBufferPtr buf,
|
void virQEMUBuildLuksOpts(virBufferPtr buf,
|
||||||
virStorageEncryptionInfoDefPtr enc,
|
virStorageEncryptionInfoDefPtr enc,
|
||||||
const char *alias)
|
const char *alias)
|
||||||
|
Loading…
Reference in New Issue
Block a user