[Libvir] [PATCH] Check the version of Xen in xenDaemonAttachDevice()

Daniel Veillard veillard at redhat.com
Thu Aug 16 13:27:04 UTC 2007


On Thu, Aug 16, 2007 at 05:41:47PM +0900, Masayuki Sunou wrote:
> Hi
> 
> When virsh attach-disk/attach-interface is executed in < Xen 3.0.4,
> the OS type of domain is NULL in xenDaemonAttachDevice().
> As a result, the command becomes segmentation fault.
> 
> This patch fixes it by checking the version of Xen in xenDaemonAttachDevice().
> 
> Signed-off-by: Masayuki Sunou <fj1826dm at aa.jp.fujitsu.com>
[...]
>  
> +    if (domain->id < 0 && priv->xendConfigVersion < 3)
> +        return(-1);
> +
>      str = virDomainGetOSType(domain);
>      if (strcmp(str, "linux"))
>          hvm = 1;

  I do not understand the patch. Why is that dependant on domain->id < 0 ?
Can you explain the logic there ?

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list