[PATCH v1 09/12] libxl: add API wrapper for libxl_set_vcpuonline

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

 



Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_set_vcpuonline, which got a new parameter
"ao_how" in Xen 4.12. libvirt does not use this parameter.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
---
 src/libxl/libxl_api.h    | 14 ++++++++++++++
 src/libxl/libxl_driver.c |  4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h
index 1c13781ae6..415e2cb32c 100644
--- a/src/libxl/libxl_api.h
+++ b/src/libxl/libxl_api.h
@@ -157,3 +157,17 @@ Libxl_Get_Free_Memory(libxl_ctx *ctx, uint64_t *memkb)
 
     return ret;
 }
+
+static inline int
+Libxl_Set_Vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap)
+{
+    int ret;
+
+#if LIBXL_API_VERSION < 0x041300
+    ret = libxl_set_vcpuonline(ctx, domid, cpumap);
+#else
+    ret = libxl_set_vcpuonline(ctx, domid, cpumap, NULL);
+#endif
+
+    return ret;
+}
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 2823cdb9d8..1d37ae6c89 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -2331,7 +2331,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         break;
 
     case VIR_DOMAIN_VCPU_LIVE:
-        if (libxl_set_vcpuonline(cfg->ctx, vm->def->id, &map) != 0) {
+        if (Libxl_Set_Vcpuonline(cfg->ctx, vm->def->id, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to set vcpus for domain '%d'"
                              " with libxenlight"), vm->def->id);
@@ -2342,7 +2342,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
         break;
 
     case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
-        if (libxl_set_vcpuonline(cfg->ctx, vm->def->id, &map) != 0) {
+        if (Libxl_Set_Vcpuonline(cfg->ctx, vm->def->id, &map) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to set vcpus for domain '%d'"
                              " with libxenlight"), vm->def->id);




[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