[Libvir] [PATCH] Fix failure of HVM domain definition on Xen 3.0.3 or earlier(BZ328841)

Masayuki Sunou fj1826dm at aa.jp.fujitsu.com
Thu Nov 1 08:37:00 UTC 2007


In message <20071031134628.GG8217 at redhat.com>
   "Re: [Libvir] [PATCH] Fix failure of HVM domain definition on Xen 3.0.3 or earlier(BZ328841)"
   "Daniel Veillard <veillard at redhat.com>" wrote:

Hi

> > 
> > VirDomainDefineXML() fails, when HVM domain using CD-ROM is created
> > on Xen 3.0.3 or earlier.
> >  -->BZ328841(https://bugzilla.redhat.com/show_bug.cgi?id=328841)
> > 
> > One of attached patches (define.patch) fixes it.
> 
>   Could you please explain the patch, it changes the XML parsing and
> seems to change the S-Expr generation. How ? Providing examples or 
> explanations of how the patch works will help.
> 
This patch converts XML without the source element
which virt-install makes as follows.

<disk type='file' device='cdrom'>    convert
  <target dev='hdc'/>              ----------->  disk = [ ",hdc:cdrom,r" ]
  <readonly/>
</disk>

[Detail]
1. This does not fail when the source element doesn't exist
   and device is CD-ROM.
2. This adjusts the size of source to 0 in calculating buflen
   when the source element doesn't exist.
3. This outputs source to the configuration file as before
   when the source element exists.
   And this doesn't output source to the configuration file
   when the source element doesn't exist.
4. This does not free source in cleanup when the source
   element doesn't exist.


> > But, when domain is started by virsh start using the configuration
> > file created by fixing this,
> > the problem that the CD-ROM device is missed occurs.
> > 
> > So, another patch (start.patch) fixes this problem.
> > 
> > Signed-off-by: Masayuki Sunou <fj1826dm at aa.jp.fujitsu.com>
> 
>   Again this seems to change parsing of S-Expr input to accept
> an empty value. Could you explain what this patch does, i.e. 
> what kind of input is being targetted and what is changed by
> the patch.
> 
This patch fixes to accept the following forms as mentioned above. 

  disk = [ ",hdc:cdrom,r" ]

I think that libvirt should analyze this form, because it exists
also in the sample of Xen. (/etc/xen/xmexample.hvm)




More information about the libvir-list mailing list