mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 15:48:20 +00:00
qapi: Fix string input visitor regression for empty lists
Visiting a list when input is the empty string should result in an empty list, not an error. Noticed when commit3d089ce
belatedly added tests, but simply accepted as weird then. It's actually a regression: broken in commit74f24cb
, v2.7.0. Fix it, and throw in another test case for empty string. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490026424-11330-2-git-send-email-armbru@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
@ -54,6 +54,10 @@ static int parse_str(StringInputVisitor *siv, const char *name, Error **errp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!*str) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
do {
|
||||
errno = 0;
|
||||
start = strtoll(str, &endptr, 0);
|
||||
|
Reference in New Issue
Block a user