]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
libxl: advertise the support for VIR_TYPED_PARAM_STRING
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 28 Jun 2013 05:22:34 +0000 (07:22 +0200)
committerDario Faggioli <dario.faggioli@citrix.com>
Thu, 4 Jul 2013 23:20:38 +0000 (01:20 +0200)
domainGetNumaParameters has a string typed parameter, hence it
is necessary for the libxl driver to support this.

This change implements the connectSupportsFeature hook for the
libxl driver, advertising that VIR_DRV_FEATURE_TYPED_PARAM_STRING
is supported.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Cc: Eric Blake <eblake@redhat.com>
---
Changes from v1:
 * commit message improved, as requested during review;
 * added VIR_TYPED_PARAM_STRING_OKAY handling code in
   libxlDomainGetSchedulerParametersFlags();

src/libxl/libxl_driver.c

index 1bae3d65a3fd4f2148c105567b7b04092a165c45..7555bc680e2b83b175675ef460fc8b6d3bcf2f99 100644 (file)
@@ -4364,7 +4364,10 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom,
     libxl_scheduler sched_id;
     int ret = -1;
 
-    virCheckFlags(0, -1);
+    virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1);
+
+    /* We don't return strings, and thus trivially support this flag.  */
+    flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
 
     libxlDriverLock(driver);
     vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
@@ -4665,6 +4668,20 @@ libxlConnectListAllDomains(virConnectPtr conn,
     return ret;
 }
 
+/* Which features are supported by this driver? */
+static int
+libxlConnectSupportsFeature(virConnectPtr conn, int feature)
+{
+    if (virConnectSupportsFeatureEnsureACL(conn) < 0)
+        return -1;
+
+    switch (feature) {
+    case VIR_DRV_FEATURE_TYPED_PARAM_STRING:
+        return 1;
+    default:
+        return 0;
+    }
+}
 
 
 static virDriver libxlDriver = {
@@ -4745,6 +4762,7 @@ static virDriver libxlDriver = {
     .connectDomainEventRegisterAny = libxlConnectDomainEventRegisterAny, /* 0.9.0 */
     .connectDomainEventDeregisterAny = libxlConnectDomainEventDeregisterAny, /* 0.9.0 */
     .connectIsAlive = libxlConnectIsAlive, /* 0.9.8 */
+    .connectSupportsFeature = libxlConnectSupportsFeature, /* 1.1.1 */
 };
 
 static virStateDriver libxlStateDriver = {