[libvirt] [dbus PATCH] util: Introduce virtDBusUtil(En|De)codeStr helpers
Katerina Koukiou
kkoukiou at redhat.com
Tue Jun 12 08:12:38 UTC 2018
On Mon, Jun 11, 2018 at 04:21:47PM +0200, Pavel Hrdina wrote:
> D-Bus object path element can contain only [a-zA-Z0-9_] characters so
> we need to encode existing unique IDs. In case of UUID it's simple, we
> just change '-' into '_' but in case of storage volumes we need to use
> 'key' which is arbitrary string.
>
> This helpers encode the string using this algorithm:
>
> [a-zA-Z0-9] > [a-zA-Z0-9]
> anything else > _XX where XX is hex representation
>
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
> .gitignore | 4 ++-
> src/util.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++
> src/util.h | 6 +++++
> tests/Makefile.am | 20 +++++++++++++++
> tests/test_util.c | 47 ++++++++++++++++++++++++++++++++++
> 5 files changed, 140 insertions(+), 1 deletion(-)
> create mode 100644 tests/test_util.c
Reviewed-by: Katerina Koukiou <kkoukiou at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180612/8b1b43ec/attachment-0001.sig>
More information about the libvir-list
mailing list