ia64/xen-unstable

changeset 17783:bbb4bb69efb2

Fix blkif.py for virsh start

I defined a cdrom to a guest domain as follows.

",hdc:cdrom,r"

When the guest domain was created by using xm create command, uname
of the cdrom was ''. Then creating the guest domain succeeded.

[2008-06-03 15:23:41 xend.XendDomainInfo 25956] DEBUG
(XendDomainInfo:200)
XendDomainInfo.create(['vm', ['name', 'rhel5.2ga_hvm_lvol1'],
<<snip>>
['device', ['vbd', ['uname', ''], ['dev', 'hdc:cdrom'], ['mode',
'r']]],
<<snip>>

But, when the guest domain was created by using virsh start command,
uname of the cdrom was None. Then creating the guest domain failed.

[2008-06-03 15:22:10 xend.XendDomainInfo 25559] DEBUG
(XendDomainInfo:200)
XendDomainInfo.create(['vm', ['name', 'rhel5.2ga_hvm_lvol1'],
<<snip>>
['device', ['vbd', ['dev', 'hdc:cdrom'], ['mode', 'r']]],
<<snip>>

This patch fixes to be able to create guest domains by both xm create
command and virsh start command.

FYI:
"if uname is None:" --> "if uname == '':" --> "if not uname:"
till CS#17625 current by this patch

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 05 10:30:29 2008 +0100 (2008-06-05)
parents 5603534c62f9
children b346fb1b8223
files tools/python/xen/xend/server/blkif.py
line diff
     1.1 --- a/tools/python/xen/xend/server/blkif.py	Tue Jun 03 09:41:19 2008 +0100
     1.2 +++ b/tools/python/xen/xend/server/blkif.py	Thu Jun 05 10:30:29 2008 +0100
     1.3 @@ -47,7 +47,7 @@ class BlkifController(DevController):
     1.4          except ValueError:
     1.5              dev_type = "disk"
     1.6  
     1.7 -        if uname == '':
     1.8 +        if not uname:
     1.9              if dev_type == 'cdrom':
    1.10                  (typ, params) = ("", "")
    1.11              else: