virBitmapParse: Fix behavior in case of error and fix up callers

Re-arrange the code so that the returned bitmap is always initialized to
NULL even on early failures and return an error message as some callers
are already expecting it. Fix up the rest not to shadow the error.
This commit is contained in:
Peter Krempa committed 2013-08-22 11:38:36 +02:00
1 parent a0b6a36f94
commit 106a2ddaa7
8 files changed
+14 -27

No files matched your search

+1 -1
View File
@@ -42,7 +42,7 @@ sed "s/vcpu placement='static'>/vcpu cpuset='aaa'>/" xml > xml-invalid || fail=1
$abs_top_builddir/tools/virsh --connect test:///default define xml-invalid > out 2>&1 && fail=1
cat <<\EOF > exp || fail=1
error: Failed to define domain from xml-invalid
error: XML error: topology cpuset syntax error
error: invalid argument: Failed to parse bitmap 'aaa'
EOF
compare exp out || fail=1