提交 9961e779 编写于 作者: P Peter Krempa

qemu: domain: Fix logic bug in qemuDomainStorageSourceAccessAllow

In commit 76b9aba2 I tried to refactor qemuDomainStorageSourceAccessAllow
but used wrong operators for adding bitwise flags.

This way the flags would result in 0 if any of them would be applied.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 10e12c40
......@@ -9491,10 +9491,10 @@ qemuDomainStorageSourceAccessAllow(virQEMUDriverPtr driver,
qemuDomainStorageSourceAccessFlags flags = QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_SKIP_REVOKE;
if (readonly)
flags &= QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_READ_ONLY;
flags |= QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_READ_ONLY;
if (!newSource)
flags &= QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_MODIFY_ACCESS;
flags |= QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_MODIFY_ACCESS;
return qemuDomainStorageSourceAccessModify(driver, vm, elem, flags);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册