backport from upstream: https://git.qemu.org/?p=qemu.git;a=commit;h=e04c13cdcf5befd9d08df38d4d34494a802cdf63 Signed-off-by: Zeyu Jin <jinzeyu@huawei.com>