[PATCH 1/2] Xen: Remove unneeded LIBXL_HAVE_* ifdefs

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

 



Now that the minimum supported Xen version has bumped to 4.9, all
uses of LIBXL_HAVE_* that are included in Xen 4.9 can be removed
from the libxl driver.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 src/libxl/libxl_capabilities.c | 14 ++---------
 src/libxl/libxl_capabilities.h |  2 --
 src/libxl/libxl_conf.c         | 45 ----------------------------------
 src/libxl/libxl_domain.c       | 20 +--------------
 src/libxl/libxl_driver.c       | 29 +---------------------
 src/libxl/xen_xl.c             | 24 ++----------------
 tests/domaincapsmock.c         | 11 ---------
 tests/libxlxml2domconfigtest.c |  6 -----
 tests/xlconfigtest.c           | 12 ---------
 9 files changed, 6 insertions(+), 157 deletions(-)

diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c
index 7385ad0d38..b4bd1d7e62 100644
--- a/src/libxl/libxl_capabilities.c
+++ b/src/libxl/libxl_capabilities.c
@@ -646,15 +646,6 @@ libxlMakeDomainDeviceVideoCaps(virDomainCapsDeviceVideo *dev)
     return 0;
 }
 
-bool libxlCapsHasPVUSB(void)
-{
-#ifdef LIBXL_HAVE_PVUSB
-    return true;
-#else
-    return false;
-#endif
-}
-
 static int
 libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdev *dev)
 {
@@ -678,9 +669,8 @@ libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdev *dev)
     VIR_DOMAIN_CAPS_ENUM_SET(dev->subsysType,
                              VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI);
 
-    if (libxlCapsHasPVUSB())
-        VIR_DOMAIN_CAPS_ENUM_SET(dev->subsysType,
-                                 VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB);
+    VIR_DOMAIN_CAPS_ENUM_SET(dev->subsysType,
+                             VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB);
 
     /* No virDomainHostdevCapsType for libxl */
     virDomainCapsEnumClear(&dev->capsType);
diff --git a/src/libxl/libxl_capabilities.h b/src/libxl/libxl_capabilities.h
index 4e0b55e321..fd2b72620b 100644
--- a/src/libxl/libxl_capabilities.h
+++ b/src/libxl/libxl_capabilities.h
@@ -39,8 +39,6 @@
  * by libvirt for Xen, and cannot be used for a persistent network name.  */
 #define LIBXL_GENERATED_PREFIX_XEN "vif"
 
-bool libxlCapsHasPVUSB(void) G_GNUC_NO_INLINE;
-
 virCaps *
 libxlMakeCapabilities(libxl_ctx *ctx);
 
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index aef93fae53..56cb9abd5d 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -619,11 +619,9 @@ libxlMakeDomBuildInfo(virDomainDef *def,
         }
         b_info->u.hvm.boot = g_strdup(bootorder);
 
-#ifdef LIBXL_HAVE_BUILDINFO_KERNEL
         b_info->cmdline = g_strdup(def->os.cmdline);
         b_info->kernel = g_strdup(def->os.kernel);
         b_info->ramdisk = g_strdup(def->os.initrd);
-#endif
 
         /*
          * Currently libxl only allows specifying the type of BIOS.
@@ -677,7 +675,6 @@ libxlMakeDomBuildInfo(virDomainDef *def,
                     0)
                     return -1;
             } else {
-#ifdef LIBXL_HAVE_BUILDINFO_SERIAL_LIST
                 b_info->u.hvm.serial_list = *g_new0(libxl_string_list, def->nserials + 1);
                 for (i = 0; i < def->nserials; i++) {
                     if (libxlMakeChrdevStr(def->serials[i],
@@ -688,12 +685,6 @@ libxlMakeDomBuildInfo(virDomainDef *def,
                     }
                 }
                 b_info->u.hvm.serial_list[i] = NULL;
-#else
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                               "%s",
-                               _("Only one serial device is supported by libxl"));
-                return -1;
-#endif
             }
         }
 
@@ -714,22 +705,8 @@ libxlMakeDomBuildInfo(virDomainDef *def,
             if (def->inputs[i]->bus != VIR_DOMAIN_INPUT_BUS_USB)
                 continue;
 
-#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
             VIR_EXPAND_N(b_info->u.hvm.usbdevice_list, nusbdevice, 1);
-#else
-            nusbdevice++;
-            if (nusbdevice > 1) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                        _("libxenlight supports only one input device"));
-                return -1;
-            }
-#endif
-
-#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
             usbdevice = &b_info->u.hvm.usbdevice_list[nusbdevice - 1];
-#else
-            usbdevice = &b_info->u.hvm.usbdevice;
-#endif
             switch (def->inputs[i]->type) {
                 case VIR_DOMAIN_INPUT_TYPE_MOUSE:
                     VIR_FREE(*usbdevice);
@@ -746,11 +723,9 @@ libxlMakeDomBuildInfo(virDomainDef *def,
             }
         }
 
-#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
         /* NULL-terminate usbdevice_list */
         if (nusbdevice > 0)
             VIR_EXPAND_N(b_info->u.hvm.usbdevice_list, nusbdevice, 1);
-#endif
     } else if (pvh) {
         b_info->cmdline = g_strdup(def->os.cmdline);
         b_info->kernel = g_strdup(def->os.kernel);
@@ -840,7 +815,6 @@ libxlMakeDomBuildInfo(virDomainDef *def,
     return 0;
 }
 
-#ifdef LIBXL_HAVE_VNUMA
 static int
 libxlMakeVnumaList(virDomainDef *def,
                    libxl_ctx *ctx,
@@ -948,7 +922,6 @@ libxlMakeVnumaList(virDomainDef *def,
 
     return ret;
 }
-#endif
 
 static int
 libxlDiskSetDiscard(libxl_device_disk *x_disk, int discard)
@@ -1136,12 +1109,10 @@ libxlMakeDisk(virDomainDiskDef *l_disk, libxl_device_disk *x_disk)
                 x_disk->format = LIBXL_DISK_FORMAT_RAW;
                 x_disk->backend = LIBXL_DISK_BACKEND_TAP;
                 break;
-#ifdef LIBXL_HAVE_QED
             case VIR_STORAGE_FILE_QED:
                 x_disk->format = LIBXL_DISK_FORMAT_QED;
                 x_disk->backend = LIBXL_DISK_BACKEND_QDISK;
                 break;
-#endif
             default:
                 virReportError(VIR_ERR_INTERNAL_ERROR,
                                _("libxenlight does not support disk format %s "
@@ -1159,11 +1130,9 @@ libxlMakeDisk(virDomainDiskDef *l_disk, libxl_device_disk *x_disk)
             case VIR_STORAGE_FILE_QCOW2:
                 x_disk->format = LIBXL_DISK_FORMAT_QCOW2;
                 break;
-#ifdef LIBXL_HAVE_QED
             case VIR_STORAGE_FILE_QED:
                 x_disk->format = LIBXL_DISK_FORMAT_QED;
                 break;
-#endif
             case VIR_STORAGE_FILE_VHD:
                 x_disk->format = LIBXL_DISK_FORMAT_VHD;
                 break;
@@ -1712,7 +1681,6 @@ libxlMakeBuildInfoVfb(virPortAllocatorRange *graphicsports,
             break;
         }
 
-#ifdef LIBXL_HAVE_SPICE_VDAGENT
         if (l_vfb->data.spice.copypaste == VIR_TRISTATE_BOOL_YES) {
             libxl_defbool_set(&b_info->u.hvm.spice.vdagent, true);
             libxl_defbool_set(&b_info->u.hvm.spice.clipboard_sharing, true);
@@ -1720,7 +1688,6 @@ libxlMakeBuildInfoVfb(virPortAllocatorRange *graphicsports,
             libxl_defbool_set(&b_info->u.hvm.spice.vdagent, false);
             libxl_defbool_set(&b_info->u.hvm.spice.clipboard_sharing, false);
         }
-#endif
 
         return 0;
     }
@@ -2000,7 +1967,6 @@ libxlDriverGetDom0MaxmemConf(libxlDriverConfig *cfg,
 }
 
 
-#ifdef LIBXL_HAVE_DEVICE_CHANNEL
 static int
 libxlPrepareChannel(virDomainChrDef *channel,
                     const char *channelDir,
@@ -2096,9 +2062,7 @@ libxlMakeChannelList(const char *channelDir,
     VIR_FREE(x_channels);
     return -1;
 }
-#endif
 
-#ifdef LIBXL_HAVE_PVUSB
 int
 libxlMakeUSBController(virDomainControllerDef *controller,
                        libxl_device_usbctrl *usbctrl)
@@ -2315,7 +2279,6 @@ libxlMakeUSBList(virDomainDef *def, libxl_domain_config *d_config)
     VIR_FREE(x_usbdevs);
     return -1;
 }
-#endif
 
 int
 libxlMakePCI(virDomainHostdevDef *hostdev, libxl_device_pci *pcidev)
@@ -2429,7 +2392,6 @@ libxlMakeVideo(virDomainDef *def, libxl_domain_config *d_config)
             }
             break;
 
-#ifdef LIBXL_HAVE_QXL
         case VIR_DOMAIN_VIDEO_TYPE_QXL:
             b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_QXL;
             if (def->videos[0]->vram < 128 * 1024) {
@@ -2438,7 +2400,6 @@ libxlMakeVideo(virDomainDef *def, libxl_domain_config *d_config)
                 return -1;
             }
             break;
-#endif
 
         default:
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -2509,10 +2470,8 @@ libxlBuildDomainConfig(virPortAllocatorRange *graphicsports,
     if (libxlMakeDomBuildInfo(def, cfg, caps, d_config) < 0)
         return -1;
 
-#ifdef LIBXL_HAVE_VNUMA
     if (libxlMakeVnumaList(def, ctx, d_config) < 0)
         return -1;
-#endif
 
     if (libxlMakeDiskList(def, d_config) < 0)
         return -1;
@@ -2529,18 +2488,14 @@ libxlBuildDomainConfig(virPortAllocatorRange *graphicsports,
     if (libxlMakePCIList(def, d_config) < 0)
         return -1;
 
-#ifdef LIBXL_HAVE_PVUSB
     if (libxlMakeUSBControllerList(def, d_config) < 0)
         return -1;
 
     if (libxlMakeUSBList(def, d_config) < 0)
         return -1;
-#endif
 
-#ifdef LIBXL_HAVE_DEVICE_CHANNEL
     if (libxlMakeChannelList(cfg->channelDir, def, d_config) < 0)
         return -1;
-#endif
 
     /*
      * Now that any potential VFBs are defined, update the build info with
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 59d26d5e2b..af20434843 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -597,7 +597,6 @@ libxlDomainShutdownThread(void *opaque)
         case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
             goto endjob;
         }
-#ifdef LIBXL_HAVE_SOFT_RESET
     } else if (xl_reason == LIBXL_SHUTDOWN_REASON_SOFT_RESET) {
         libxlDomainObjPrivate *priv = vm->privateData;
 
@@ -624,7 +623,6 @@ libxlDomainShutdownThread(void *opaque)
         }
         libxl_evenable_domain_death(cfg->ctx, vm->def->id, 0, &priv->deathW);
         libxlDomainUnpauseWrapper(cfg->ctx, vm->def->id);
-#endif
     } else {
         VIR_INFO("Unhandled shutdown_reason %d", xl_reason);
     }
@@ -878,9 +876,7 @@ libxlDomainCleanup(libxlDriverPrivate *driver,
     VIR_DEBUG("Cleaning up domain with id '%d' and name '%s'",
               vm->def->id, vm->def->name);
 
-#ifdef LIBXL_HAVE_PVUSB
     hostdev_flags |= VIR_HOSTDEV_SP_USB;
-#endif
 
     /* now that we know it's stopped call the hook if present */
     if (virHookPresent(VIR_HOOK_DRIVER_LIBXL)) {
@@ -1188,7 +1184,6 @@ libxlDomainUpdateDiskParams(virDomainDef *def, libxl_ctx *ctx)
     VIR_FREE(disks);
 }
 
-#ifdef LIBXL_HAVE_DEVICE_CHANNEL
 static void
 libxlDomainCreateChannelPTY(virDomainDef *def, libxl_ctx *ctx)
 {
@@ -1222,13 +1217,6 @@ libxlDomainCreateChannelPTY(virDomainDef *def, libxl_ctx *ctx)
     for (i = 0; i < nchannels; i++)
         libxl_device_channel_dispose(&x_channels[i]);
 }
-#endif
-
-#ifdef LIBXL_HAVE_SRM_V2
-# define LIBXL_DOMSTART_RESTORE_VER_ATTR /* empty */
-#else
-# define LIBXL_DOMSTART_RESTORE_VER_ATTR G_GNUC_UNUSED
-#endif
 
 /*
  * Start a domain through libxenlight.
@@ -1240,7 +1228,7 @@ libxlDomainStart(libxlDriverPrivate *driver,
                  virDomainObj *vm,
                  bool start_paused,
                  int restore_fd,
-                 uint32_t restore_ver LIBXL_DOMSTART_RESTORE_VER_ATTR)
+                 uint32_t restore_ver)
 {
     libxl_domain_config d_config;
     virDomainDef *def = NULL;
@@ -1259,9 +1247,7 @@ libxlDomainStart(libxlDriverPrivate *driver,
     unsigned int hostdev_flags = VIR_HOSTDEV_SP_PCI;
     g_autofree char *config_json = NULL;
 
-#ifdef LIBXL_HAVE_PVUSB
     hostdev_flags |= VIR_HOSTDEV_SP_USB;
-#endif
 
     libxl_domain_config_init(&d_config);
 
@@ -1385,9 +1371,7 @@ libxlDomainStart(libxlDriverPrivate *driver,
                                       &domid, NULL, &aop_console_how);
     } else {
         libxl_domain_restore_params_init(&params);
-#ifdef LIBXL_HAVE_SRM_V2
         params.stream_version = restore_ver;
-#endif
         ret = libxlDomainCreateRestoreWrapper(cfg->ctx, &d_config, &domid,
                                               restore_fd, &params,
                                           &aop_console_how);
@@ -1431,10 +1415,8 @@ libxlDomainStart(libxlDriverPrivate *driver,
     libxlDomainCreateIfaceNames(vm->def, &d_config);
     libxlDomainUpdateDiskParams(vm->def, cfg->ctx);
 
-#ifdef LIBXL_HAVE_DEVICE_CHANNEL
     if (vm->def->nchannels > 0)
         libxlDomainCreateChannelPTY(vm->def, cfg->ctx);
-#endif
 
     if ((dom_xml = virDomainDefFormat(vm->def, driver->xmlopt, 0)) == NULL)
         goto destroy_dom;
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 6a4378b2f2..c97b2fb485 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -394,9 +394,7 @@ libxlReconnectDomain(virDomainObj *vm,
     unsigned int hostdev_flags = VIR_HOSTDEV_SP_PCI;
     int ret = -1;
 
-#ifdef LIBXL_HAVE_PVUSB
     hostdev_flags |= VIR_HOSTDEV_SP_USB;
-#endif
 
     virObjectRef(vm);
     virObjectLock(vm);
@@ -567,11 +565,7 @@ static const libxl_osevent_hooks libxl_osevent_callbacks = {
 };
 
 static const libxl_childproc_hooks libxl_child_hooks = {
-#ifdef LIBXL_HAVE_SIGCHLD_OWNER_SELECTIVE_REAP
     .chldowner = libxl_sigchld_owner_libxl_always_selective_reap,
-#else
-    .chldowner = libxl_sigchld_owner_libxl,
-#endif
 };
 
 const struct libxl_event_hooks ev_hooks = {
@@ -3144,7 +3138,6 @@ libxlDomainAttachHostPCIDevice(libxlDriverPrivate *driver,
     return ret;
 }
 
-#ifdef LIBXL_HAVE_PVUSB
 static int
 libxlDomainAttachControllerDevice(libxlDriverPrivate *driver,
                                   virDomainObj *vm,
@@ -3276,7 +3269,6 @@ libxlDomainAttachHostUSBDevice(libxlDriverPrivate *driver,
     libxl_device_usbdev_dispose(&usbdev);
     return ret;
 }
-#endif
 
 static int
 libxlDomainAttachHostDevice(libxlDriverPrivate *driver,
@@ -3296,12 +3288,10 @@ libxlDomainAttachHostDevice(libxlDriverPrivate *driver,
             return -1;
         break;
 
-#ifdef LIBXL_HAVE_PVUSB
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
         if (libxlDomainAttachHostUSBDevice(driver, vm, hostdev) < 0)
             return -1;
         break;
-#endif
 
     default:
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -3482,13 +3472,11 @@ libxlDomainAttachDeviceLive(libxlDriverPrivate *driver,
                 dev->data.disk = NULL;
             break;
 
-#ifdef LIBXL_HAVE_PVUSB
         case VIR_DOMAIN_DEVICE_CONTROLLER:
             ret = libxlDomainAttachControllerDevice(driver, vm, dev->data.controller);
             if (!ret)
                 dev->data.controller = NULL;
             break;
-#endif
 
         case VIR_DOMAIN_DEVICE_NET:
             ret = libxlDomainAttachNetDevice(driver, vm,
@@ -3569,9 +3557,7 @@ libxlDomainAttachDeviceConfig(virDomainDef *vmdef, virDomainDeviceDef *dev)
 
             switch (hostdev->source.subsys.type) {
             case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
-#ifndef LIBXL_HAVE_PVUSB
             case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
-#endif
             case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
                 return -1;
             }
@@ -3689,7 +3675,6 @@ libxlDomainDetachHostPCIDevice(libxlDriverPrivate *driver,
     return ret;
 }
 
-#ifdef LIBXL_HAVE_PVUSB
 static int
 libxlDomainDetachControllerDevice(libxlDriverPrivate *driver,
                                   virDomainObj *vm,
@@ -3808,7 +3793,6 @@ libxlDomainDetachHostUSBDevice(libxlDriverPrivate *driver,
     libxl_device_usbdev_dispose(&usbdev);
     return ret;
 }
-#endif
 
 static int
 libxlDomainDetachHostDevice(libxlDriverPrivate *driver,
@@ -3828,10 +3812,8 @@ libxlDomainDetachHostDevice(libxlDriverPrivate *driver,
         case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
             return libxlDomainDetachHostPCIDevice(driver, vm, hostdev);
 
-#ifdef LIBXL_HAVE_PVUSB
         case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
             return libxlDomainDetachHostUSBDevice(driver, vm, hostdev);
-#endif
 
         default:
             virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -3914,11 +3896,9 @@ libxlDomainDetachDeviceLive(libxlDriverPrivate *driver,
             ret = libxlDomainDetachDeviceDiskLive(vm, dev);
             break;
 
-#ifdef LIBXL_HAVE_PVUSB
         case VIR_DOMAIN_DEVICE_CONTROLLER:
             ret = libxlDomainDetachControllerDevice(driver, vm, dev);
             break;
-#endif
 
         case VIR_DOMAIN_DEVICE_NET:
             ret = libxlDomainDetachNetDevice(driver, vm,
@@ -4856,12 +4836,8 @@ libxlDomainSetSchedulerParameters(virDomainPtr dom, virTypedParameterPtr params,
     return libxlDomainSetSchedulerParametersFlags(dom, params, nparams, 0);
 }
 
-/* NUMA node affinity information is available through libxl
- * starting from Xen 4.3. */
-#ifdef LIBXL_HAVE_DOMAIN_NODEAFFINITY
-
 /* Number of Xen NUMA parameters */
-# define LIBXL_NUMA_NPARAM 2
+#define LIBXL_NUMA_NPARAM 2
 
 static int
 libxlDomainGetNumaParameters(virDomainPtr dom,
@@ -4978,7 +4954,6 @@ libxlDomainGetNumaParameters(virDomainPtr dom,
     virObjectUnref(cfg);
     return ret;
 }
-#endif
 
 static int
 libxlDomainIsActive(virDomainPtr dom)
@@ -6535,9 +6510,7 @@ static virHypervisorDriver libxlHypervisorDriver = {
     .domainGetSchedulerParametersFlags = libxlDomainGetSchedulerParametersFlags, /* 0.9.2 */
     .domainSetSchedulerParameters = libxlDomainSetSchedulerParameters, /* 0.9.0 */
     .domainSetSchedulerParametersFlags = libxlDomainSetSchedulerParametersFlags, /* 0.9.2 */
-#ifdef LIBXL_HAVE_DOMAIN_NODEAFFINITY
     .domainGetNumaParameters = libxlDomainGetNumaParameters, /* 1.1.1 */
-#endif
     .nodeGetFreeMemory = libxlNodeGetFreeMemory, /* 0.9.0 */
     .nodeGetCellsFreeMemory = libxlNodeGetCellsFreeMemory, /* 1.1.1 */
     .domainGetJobInfo = libxlDomainGetJobInfo, /* 1.3.1 */
diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c
index 8fa91ce66a..c0905b08d8 100644
--- a/src/libxl/xen_xl.c
+++ b/src/libxl/xen_xl.c
@@ -128,7 +128,6 @@ xenParseXLOS(virConf *conf, virDomainDef *def, virCaps *caps)
         if (xenConfigCopyStringOpt(conf, "acpi_firmware", &def->os.slic_table) < 0)
             return -1;
 
-#ifdef LIBXL_HAVE_BUILDINFO_KERNEL
         if (xenConfigCopyStringOpt(conf, "kernel", &def->os.kernel) < 0)
             return -1;
 
@@ -137,7 +136,6 @@ xenParseXLOS(virConf *conf, virDomainDef *def, virCaps *caps)
 
         if (xenParseCmdline(conf, &def->os.cmdline) < 0)
             return -1;
-#endif
 
         if (xenConfigGetString(conf, "boot", &boot, "c") < 0)
             return -1;
@@ -402,7 +400,6 @@ xenParseXLSpice(virConf *conf, virDomainDef *def)
     return -1;
 }
 
-#ifdef LIBXL_HAVE_VNUMA
 static int
 xenParseXLVnuma(virConf *conf,
                 virDomainDef *def)
@@ -591,7 +588,6 @@ xenParseXLVnuma(virConf *conf,
 
     return ret;
 }
-#endif
 
 static int
 xenParseXLXenbusLimits(virConf *conf, virDomainDef *def)
@@ -756,11 +752,9 @@ xenParseXLDisk(virConf *conf, virDomainDef *def)
                 case LIBXL_DISK_FORMAT_EMPTY:
                     break;
 
-#ifdef LIBXL_HAVE_QED
                 case LIBXL_DISK_FORMAT_QED:
                     disk->src->format = VIR_STORAGE_FILE_QED;
                     break;
-#endif
 
                 default:
                     virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -833,15 +827,9 @@ xenParseXLInputDevs(virConf *conf, virDomainDef *def)
     if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
         val = virConfGetValue(conf, "usbdevice");
         /* usbdevice can be defined as either a single string or a list */
-        if (val && val->type == VIR_CONF_LIST) {
-#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+        if (val && val->type == VIR_CONF_LIST)
             val = val->list;
-#else
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("multiple USB devices not supported"));
-            return -1;
-#endif
-        }
+
         /* otherwise val->next is NULL, so can be handled by the same code */
         while (val) {
             if (val->type != VIR_CONF_STRING) {
@@ -1162,10 +1150,8 @@ xenParseXL(virConf *conf,
     if (xenParseXLOS(conf, def, caps) < 0)
         goto cleanup;
 
-#ifdef LIBXL_HAVE_VNUMA
     if (xenParseXLVnuma(conf, def) < 0)
         goto cleanup;
-#endif
 
     if (xenParseXLXenbusLimits(conf, def) < 0)
         goto cleanup;
@@ -1224,7 +1210,6 @@ xenFormatXLOS(virConf *conf, virDomainDef *def)
             xenConfigSetString(conf, "acpi_firmware", def->os.slic_table) < 0)
             return -1;
 
-#ifdef LIBXL_HAVE_BUILDINFO_KERNEL
         if (def->os.kernel &&
             xenConfigSetString(conf, "kernel", def->os.kernel) < 0)
             return -1;
@@ -1236,7 +1221,6 @@ xenFormatXLOS(virConf *conf, virDomainDef *def)
         if (def->os.cmdline &&
             xenConfigSetString(conf, "cmdline", def->os.cmdline) < 0)
             return -1;
-#endif
 
         for (i = 0; i < def->os.nBootDevs; i++) {
             switch (def->os.bootDevs[i]) {
@@ -1390,7 +1374,6 @@ xenFormatXLCPUID(virConf *conf, virDomainDef *def)
     return ret;
 }
 
-#ifdef LIBXL_HAVE_VNUMA
 static int
 xenFormatXLVnode(virConfValue *list,
                  virBuffer *buf)
@@ -1511,7 +1494,6 @@ xenFormatXLDomainVnuma(virConf *conf,
     virConfFreeValue(vnumaVal);
     return -1;
 }
-#endif
 
 static int
 xenFormatXLXenbusLimits(virConf *conf, virDomainDef *def)
@@ -2196,10 +2178,8 @@ xenFormatXL(virDomainDef *def, virConnectPtr conn)
     if (xenFormatXLCPUID(conf, def) < 0)
         return NULL;
 
-#ifdef LIBXL_HAVE_VNUMA
     if (xenFormatXLDomainVnuma(conf, def) < 0)
         return NULL;
-#endif
 
     if (xenFormatXLXenbusLimits(conf, def) < 0)
         return NULL;
diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c
index d81a898dc0..b03f75199b 100644
--- a/tests/domaincapsmock.c
+++ b/tests/domaincapsmock.c
@@ -17,17 +17,6 @@
 #include <config.h>
 
 #include "virhostcpu.h"
-#ifdef WITH_LIBXL
-# include "libxl/libxl_capabilities.h"
-#endif
-
-#ifdef WITH_LIBXL
-bool
-libxlCapsHasPVUSB(void)
-{
-    return true;
-}
-#endif
 
 int
 virHostCPUGetKVMMaxVCPUs(void)
diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c
index 484c2121cb..19385c6fb5 100644
--- a/tests/libxlxml2domconfigtest.c
+++ b/tests/libxlxml2domconfigtest.c
@@ -105,13 +105,7 @@ testCompareXMLToDomConfig(const char *xmlfile,
      */
 # ifndef LIBXL_HAVE_BUILDINFO_APIC
     if (expectconfig.c_info.type == LIBXL_DOMAIN_TYPE_HVM) {
-#  ifdef LIBXL_HAVE_MEMKB_64BITS
-        /*
-         * This part of the libxl API was changed without a guard in Xen 4.8.
-         * Reuse another Xen 4.8 specific conditional.
-         */
         libxl_defbool_unset(&expectconfig.b_info.acpi);
-#  endif
         libxl_defbool_set(&expectconfig.b_info.u.hvm.apic, true);
         libxl_defbool_set(&expectconfig.b_info.u.hvm.acpi, true);
     }
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
index 7c6931000a..e5c4a053bc 100644
--- a/tests/xlconfigtest.c
+++ b/tests/xlconfigtest.c
@@ -244,9 +244,7 @@ mymain(void)
     DO_TEST("new-disk");
     DO_TEST_FORMAT("disk-positional-parms-full", false);
     DO_TEST_FORMAT("disk-positional-parms-partial", false);
-#ifdef LIBXL_HAVE_QED
     DO_TEST_FORMAT("disk-qed", false);
-#endif
     DO_TEST("net-fakemodel");
     DO_TEST("spice");
     DO_TEST("spice-features");
@@ -260,12 +258,10 @@ mymain(void)
     DO_TEST("fullvirt-cpuid");
     DO_TEST("fullvirt-acpi-slic");
     DO_TEST("fullvirt-pci");
-#ifdef LIBXL_HAVE_VNUMA
     DO_TEST("fullvirt-vnuma");
     DO_TEST_PARSE("fullvirt-vnuma-autocomplete", false);
     DO_TEST_PARSE("fullvirt-vnuma-nodistances", false);
     DO_TEST_PARSE("fullvirt-vnuma-partialdist", false);
-#endif
 
     DO_TEST("paravirt-cmdline");
     DO_TEST_FORMAT("paravirt-cmdline-extra-root", false);
@@ -275,21 +271,13 @@ mymain(void)
     DO_TEST_FORMAT("fullvirt-type", false);
     DO_TEST("pvh-type");
 
-#ifdef LIBXL_HAVE_DEVICE_CHANNEL
     DO_TEST("channel-pty");
     DO_TEST("channel-unix");
-#endif
-#ifdef LIBXL_HAVE_BUILDINFO_SERIAL_LIST
     DO_TEST("fullvirt-multiserial");
-#endif
-#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
     DO_TEST("fullvirt-multiusb");
-#endif
-#ifdef LIBXL_HAVE_BUILDINFO_KERNEL
     DO_TEST("fullvirt-direct-kernel-boot");
     DO_TEST_FORMAT("fullvirt-direct-kernel-boot-extra", false);
     DO_TEST_FORMAT("fullvirt-direct-kernel-boot-bogus-extra", false);
-#endif
 #ifdef LIBXL_HAVE_BUILDINFO_GRANT_LIMITS
     DO_TEST("max-gntframes");
 #endif
-- 
2.31.1





[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]

  Powered by Linux