File 99a42f3c-libxl-sec-model.patch of Package libvirt.11695

commit 99a42f3c0fd77ab9bd596bd107f924a455564dde
Author: Jim Fehlig <jfehlig@suse.com>
Date:   Fri May 15 12:26:30 2015 -0600

    libxl: provide impl for nodeGetSecurityModel
    
    Currently, the libxl driver does not support any security drivers.
    When the qemu driver has no security driver configued,
    nodeGetSecurityModel succeeds but returns an empty virSecurityModel
    object.  Do the same in the libxl driver instead of reporting
    
    this function is not supported by the connection driver:
    virNodeGetSecurityModel

Index: libvirt-1.2.5/src/libxl/libxl_driver.c
===================================================================
--- libvirt-1.2.5.orig/src/libxl/libxl_driver.c
+++ libvirt-1.2.5/src/libxl/libxl_driver.c
@@ -4738,6 +4738,24 @@ libxlDomainMigrateConfirm3Params(virDoma
     return libxlDomainMigrationConfirm(driver, vm, flags, cancelled);
 }
 
+static int libxlNodeGetSecurityModel(virConnectPtr conn,
+                                     virSecurityModelPtr secmodel)
+{
+    memset(secmodel, 0, sizeof(*secmodel));
+
+    if (virNodeGetSecurityModelEnsureACL(conn) < 0)
+        return -1;
+
+    /*
+     * Currently the libxl driver does not support security model.
+     * Similar to the qemu driver, treat this as success and simply
+     * return no data in secmodel.  Avoids spamming the libvirt log
+     * with "this function is not supported by the connection driver:
+     * virNodeGetSecurityModel"
+     */
+    return 0;
+}
+
 
 static virDriver libxlDriver = {
     .no = VIR_DRV_LIBXL,
@@ -4833,6 +4851,7 @@ static virDriver libxlDriver = {
     .domainMigratePerform3Params = libxlDomainMigratePerform3Params, /* 1.2.3 */
     .domainMigrateFinish3Params = libxlDomainMigrateFinish3Params, /* 1.2.3 */
     .domainMigrateConfirm3Params = libxlDomainMigrateConfirm3Params, /* 1.2.3 */
+    .nodeGetSecurityModel = libxlNodeGetSecurityModel, /* 1.2.16 */
 };
 
 static virStateDriver libxlStateDriver = {
@@ -4843,7 +4862,6 @@ static virStateDriver libxlStateDriver =
     .stateReload = libxlStateReload,
 };
 
-
 int
 libxlRegister(void)
 {