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

[Xen-changelog] [xen staging] libxl: choose an appropriate default for passthrough...



commit fa3a19188c3a0ef540e8ca40484aed4f609810c9
Author:     Paul Durrant <paul.durrant@xxxxxxxxxx>
AuthorDate: Tue Oct 1 15:57:14 2019 +0100
Commit:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CommitDate: Wed Oct 2 16:55:24 2019 +0100

    libxl: choose an appropriate default for passthrough...
    
    ...if there is no IOMMU or it is globally disabled.
    
    Without this patch, the following assertion may be hit:
    
    xl: libxl_create.c:589: libxl__domain_make: Assertion `info->passthrough != 
LIBXL_PASSTHROUGH_UNKNOWN' failed.
    
    This is because libxl__domain_create_info_setdefault() currently only sets
    an appropriate value for 'passthrough' in the case that 'cap_hvm_directio'
    is true, which is not the case unless an IOMMU is present and enabled in
    the system. This is normally masked by xl choosing a default value, but
    that will not happen if xl is not used (e.g. when using libvirt) or when
    a stub domain is being created.
    
    Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_create.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 5f2972bc03..62e13f3e7c 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -68,7 +68,11 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc,
         c_info->passthrough = ((c_info->type == LIBXL_DOMAIN_TYPE_PV) ||
                                !info.cap_iommu_hap_pt_share) ?
             LIBXL_PASSTHROUGH_SYNC_PT : LIBXL_PASSTHROUGH_SHARE_PT;
-    }
+    } else if (!info.cap_hvm_directio)
+        c_info->passthrough = LIBXL_PASSTHROUGH_DISABLED;
+
+    /* An explicit setting should now have been chosen */
+    assert(c_info->passthrough != LIBXL_PASSTHROUGH_UNKNOWN);
 
     return 0;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.