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

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

 



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@xxxxxxxxxxxxxxxxx>

Thanks,
Masayuki Sunou.

----------------------------------------------------------------------
Index: src/xend_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xend_internal.c,v
retrieving revision 1.132
diff -u -p -r1.132 xend_internal.c
--- src/xend_internal.c	9 Aug 2007 20:19:12 -0000	1.132
+++ src/xend_internal.c	16 Aug 2007 07:38:42 -0000
@@ -3091,6 +3091,9 @@ xenDaemonAttachDevice(virDomainPtr domai
 
     priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
 
+    if (domain->id < 0 && priv->xendConfigVersion < 3)
+        return(-1);
+
     str = virDomainGetOSType(domain);
     if (strcmp(str, "linux"))
         hvm = 1;
----------------------------------------------------------------------

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]