We backport some bug fixing patches form qemu-stable-4.1.1 branch of upstream. Signed-off-by: Ying Fang <fangying1@huawei.com>