[libvirt] [PATCH v2] qemu: Fix a regression of attaching device

Eric Blake eblake at redhat.com
Fri Jul 15 15:13:57 UTC 2011


On 07/15/2011 09:16 AM, Osier Yang wrote:
> The regression is introduced by Commit da1eba6b, the new
> codes with this commit doesn't reset "ret" to "-1" when
> it fails on parsing the device XML (live device attachment)
> 
> This patch changes the codes to reset the "ret" and "-1",
> and also changes the codes so that it don't modify "ret"
> for condition checking.
> 
> How to reproduce:
> 
> <disk type='oops' device='disk'>
>   <driver name='qemu' type='raw'/>
>   <source file='/var/lib/libvirt/images/test.img'/>
>   <target dev='vda' bus='virtio'/>
> </disk>
> 
> Device attached successfully
> ---
>  src/qemu/qemu_driver.c |   23 +++++++++++++++++------
>  1 files changed, 17 insertions(+), 6 deletions(-)

ACK.  The commit message is better this time, and the flow of logic,
although requiring more lines, is easier to understand.

>          /*
>           * update domain status forcibly because the domain status may be
>           * changed even if we attach the device failed. For example, a

While you're touching this area of code,

s/even if we attach the device failed/even we failed to attach the device/


>           * For example, a new controller may be created.

Also, delete the redundant "For example, a".

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110715/ddd34921/attachment-0001.sig>


More information about the libvir-list mailing list