[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [BUG] qemu-xen-traditional can not open multi level incremental image


  • To: "xen-devel@xxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxx>
  • From: 陈耿佳 <chengengjia@xxxxxx>
  • Date: Mon, 21 Apr 2014 07:25:57 +0000
  • Accept-language: zh-CN, en-US
  • Delivery-date: Mon, 21 Apr 2014 11:10:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac9dMLJa8/Fg1RhnSrK9AR+JU4uDBA==
  • Thread-topic: [BUG] qemu-xen-traditional can not open multi level incremental image

Hi,  I find a bug of the latest qemu-xen-traditional whose git path is git://xenbits.xen.org/qemu-xen-unstable.git

The bug will cause “boot from disk failed : not a bootable disk” error when you create a hvm guest os from a multi-level image whose format is not raw

 

Following is the details:

 

Code : xen-4.2.3/tools/qemu-xen-traditional 

Real git url : git://xenbits.xen.org/qemu-xen-unstable.git

file: block.c

function: bdrv_open2

line number: 455

 

l  bug details:

 

block.c:455:  ret = bdrv_open2(bs->backing_hd, backing_filename, open_flags, &bdrv_raw);

 

when we use multi level incremental image as boot image for guest os , such as :  xl create test.hvm.conf , the config file is as follow:

 

kernel = “/usr/lib/xen/boot/hvmloader”

builder=”hvm”

disk=[‘format=qcow2,vdev=hda,access=rw,target=/yourpath/test.level2.qcow2’]

device_model=”/usr/lib64/xen/bin/qemu-dm”

…….

 

And test.level2.qcow2 is a level2 qcow2 image, it can be created by :

 

qemu-img  ?f  qcow2  ?b  base.img test.level2.qcow2  10G

 

with the old code, xl create will post an error like : “boot from disk failed : not a bootable disk” in hvmloader-rombios , that is beausese the daemon qemu-dm

which builds from qemu-xen-traditional cannot process multi-level incremental image ,the function bdrv_open2 takes &bdrv_raw as the default driver, and this

driver can not process image whose format is not raw

 

l  Bug fix:

 

I fix this bug by simply makes the forth arg of bdrv_open2  to be NULL, so it will calls bdrv_find_format latter and find its right format

 

ret = bdrv_open2(bs->backing_hd, backing_filename, open_flags, NULL);

 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.