mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00: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
|
||||
virQEMUBuildBufferEscape;
|
||||
virQEMUBuildBufferEscapeComma;
|
||||
virQEMUBuildCommandLineJSON;
|
||||
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:
|
||||
* @buf: buffer to build the string into
|
||||
|
@ -50,6 +50,7 @@ char *virQEMUBuildObjectCommandlineFromJSON(const char *type,
|
||||
char *virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr src);
|
||||
|
||||
void virQEMUBuildBufferEscapeComma(virBufferPtr buf, const char *str);
|
||||
void virQEMUBuildBufferEscape(virBufferPtr buf, const char *str);
|
||||
void virQEMUBuildLuksOpts(virBufferPtr buf,
|
||||
virStorageEncryptionInfoDefPtr enc,
|
||||
const char *alias)
|
||||
|
Loading…
Reference in New Issue
Block a user