提交 35e15478 编写于 作者: M Mao Zhongyi 提交者: Cole Robinson

qemu/qemu_migration_params: use virStringParseYesNo helper

A function virStringParseYesNo was added to convert
string 'yes' to true and 'no' to false, so use this
helper to replace 'STREQ(.*, \"yes\")' and
'STREQ(.*, \"no\")' as it allows us to drop several
repetitive if-then-else string->bool conversion blocks.
Reviewed-by: NCole Robinson <crobinso@redhat.com>
Signed-off-by: NMao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: NZhang Shengju <zhangshengju@cmss.chinamobile.com>
上级 5da6615b
......@@ -1319,12 +1319,7 @@ qemuMigrationParamsParse(xmlXPathContextPtr ctxt,
break;
case QEMU_MIGRATION_PARAM_TYPE_BOOL:
if (STREQ(value, "yes"))
pv->value.b = true;
else if (STREQ(value, "no"))
pv->value.b = false;
else
rc = -1;
rc = virStringParseYesNo(value, &pv->value.b);
break;
case QEMU_MIGRATION_PARAM_TYPE_STRING:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册