[libvirt] [PATCH] qemu: command: align disk serial check to schema

Nikolay Shirokovskiy posted 1 patch 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1490614827-101972-1-git-send-email-nshirokovskiy@virtuozzo.com
There is a newer version of this series
src/qemu/qemu_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] qemu: command: align disk serial check to schema
Posted by Nikolay Shirokovskiy 7 years ago
Disk serial schema has extra '.+' allowed characters in comparison
with check in code. Looks like there is no reason for that as qemu
allows any character AFAIK for serial. This discrepancy is originated
in 85d15b51 where ability to add serial was added.
---
 src/qemu/qemu_command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c76f923..c5369b0 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -432,7 +432,7 @@ qemuBuildIoEventFdStr(virBufferPtr buf,
 }
 
 #define QEMU_SERIAL_PARAM_ACCEPTED_CHARS \
-  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_ "
+  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_ .+"
 
 static int
 qemuSafeSerialParamValue(const char *value)
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: command: align disk serial check to schema
Posted by Martin Kletzander 7 years ago
On Mon, Mar 27, 2017 at 02:40:27PM +0300, Nikolay Shirokovskiy wrote:
>Disk serial schema has extra '.+' allowed characters in comparison
>with check in code. Looks like there is no reason for that as qemu
>allows any character AFAIK for serial. This discrepancy is originated
>in 85d15b51 where ability to add serial was added.
>---
> src/qemu/qemu_command.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>index c76f923..c5369b0 100644
>--- a/src/qemu/qemu_command.c
>+++ b/src/qemu/qemu_command.c
>@@ -432,7 +432,7 @@ qemuBuildIoEventFdStr(virBufferPtr buf,
> }
>
> #define QEMU_SERIAL_PARAM_ACCEPTED_CHARS \
>-  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_ "
>+  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_ .+"
>

Thanks for noticing this.  However, could you also add (or adjust any
existing) tests for this?  Thanks.

> static int
> qemuSafeSerialParamValue(const char *value)
>--
>1.8.3.1
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list