From: Chris Lalancette Date: Mon, 17 Aug 2009 12:24:27 +0000 (+0200) Subject: OpenVZ: accept NULL as type for GetMaxVCPUs. X-Git-Tag: v0.7.1~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dac1b37269332353ab44e5ced0b0bd29e0913d1;p=thirdparty%2Flibvirt.git OpenVZ: accept NULL as type for GetMaxVCPUs. All of the other drivers that support the getMaxVcpus callback also accept a NULL value for type. Make openvz also accept a NULL value. Signed-off-by: Chris Lalancette --- diff --git a/src/openvz_driver.c b/src/openvz_driver.c index 6b7c49df4c..43d54f9d8d 100644 --- a/src/openvz_driver.c +++ b/src/openvz_driver.c @@ -1000,9 +1000,10 @@ cleanup: return ret; } -static int openvzGetMaxVCPUs(virConnectPtr conn, const char *type) { - if (STRCASEEQ(type, "openvz")) - return 1028; //OpenVZ has no limitation +static int openvzGetMaxVCPUs(virConnectPtr conn, const char *type) +{ + if (type == NULL || STRCASEEQ(type, "openvz")) + return 1028; /* OpenVZ has no limitation */ openvzError(conn, VIR_ERR_INVALID_ARG, _("unknown type '%s'"), type);