From 247813acd1ee0411848b7a22bd07c8ea45f59478 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Thu, 13 Jan 2022 19:54:34 +0100
Subject: [PATCH] libxl: assume LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Introduced in 4.3.0 by xen commit:

  commit ef496b81f0336f09968a318e7f81151dd4f5a0cc
    libxl: postpone backend name resolution

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/libxl/libxl_conf.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 5d87b999f2..f062f8e958 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1191,16 +1191,8 @@ libxlMakeDisk(virDomainDiskDef *l_disk, libxl_device_disk *x_disk)
         return -1;
     }
 
-    if (l_disk->domain_name) {
-#ifdef LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
+    if (l_disk->domain_name)
         x_disk->backend_domname = g_strdup(l_disk->domain_name);
-#else
-        virReportError(VIR_ERR_XML_DETAIL, "%s",
-                _("this version of libxenlight does not "
-                  "support backend domain name"));
-        return -1;
-#endif
-    }
 
     return 0;
 }
@@ -1408,16 +1400,8 @@ libxlMakeNic(virDomainDef *def,
             goto cleanup;
     }
 
-    if (l_nic->domain_name) {
-#ifdef LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
+    if (l_nic->domain_name)
         x_nic->backend_domname = g_strdup(l_nic->domain_name);
-#else
-        virReportError(VIR_ERR_XML_DETAIL, "%s",
-                _("this version of libxenlight does not "
-                  "support backend domain name"));
-        goto cleanup;
-#endif
-    }
 
     /*
      * Set bandwidth.