File a05e2570-libxl-virDomainGetMaxVcpus.patch of Package libvirt.6159

commit a05e2570c9d76b0d1286f0c51d86dc0c2a38337d
Author: Jim Fehlig <jfehlig@suse.com>
Date:   Fri Jan 6 12:19:31 2017 -0700

    libxl: implement virDomainGetMaxVcpus
    
    The libxl driver already supports getting maximum vcpu count via
    libxlDomainGetVcpusFlags, allowing to trivially implement
    virDomainGetMaxVcpus.

Index: libvirt-2.0.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-2.0.0.orig/src/libxl/libxl_driver.c
+++ libvirt-2.0.0/src/libxl/libxl_driver.c
@@ -2276,6 +2276,13 @@ libxlDomainGetVcpusFlags(virDomainPtr do
 }
 
 static int
+libxlDomainGetMaxVcpus(virDomainPtr dom)
+{
+    return libxlDomainGetVcpusFlags(dom, (VIR_DOMAIN_AFFECT_LIVE |
+                                          VIR_DOMAIN_VCPU_MAXIMUM));
+}
+
+static int
 libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu,
                         unsigned char *cpumap, int maplen,
                         unsigned int flags)
@@ -5957,6 +5964,7 @@ static virHypervisorDriver libxlHypervis
     .domainSetVcpus = libxlDomainSetVcpus, /* 0.9.0 */
     .domainSetVcpusFlags = libxlDomainSetVcpusFlags, /* 0.9.0 */
     .domainGetVcpusFlags = libxlDomainGetVcpusFlags, /* 0.9.0 */
+    .domainGetMaxVcpus = libxlDomainGetMaxVcpus, /* 2.0.0 */
     .domainPinVcpu = libxlDomainPinVcpu, /* 0.9.0 */
     .domainPinVcpuFlags = libxlDomainPinVcpuFlags, /* 1.2.1 */
     .domainGetVcpus = libxlDomainGetVcpus, /* 0.9.0 */