提交 18b42898 编写于 作者: O Osier Yang

Change the tag name "num_queues" into "queues"

Instead of making a choice between the underscore and camelCase, this
simply changes "num_queues" into "queues", which is also consistent
with Michal's multiple queue support for interface.
上级 148edcce
...@@ -2135,7 +2135,7 @@ ...@@ -2135,7 +2135,7 @@
controller. A "scsi" controller has an optional controller. A "scsi" controller has an optional
attribute <code>model</code>, which is one of "auto", "buslogic", attribute <code>model</code>, which is one of "auto", "buslogic",
"ibmvscsi", "lsilogic", "lsisas1068", "lsisas1078", "virtio-scsi" or "ibmvscsi", "lsilogic", "lsisas1068", "lsisas1078", "virtio-scsi" or
"vmpvscsi". The attribute <code>num_queues</code> "vmpvscsi". The attribute <code>queues</code>
(<span class="since">1.0.5 (QEMU and KVM only)</span>) specifies (<span class="since">1.0.5 (QEMU and KVM only)</span>) specifies
the number of queues for the controller. For best performance, it's the number of queues for the controller. For best performance, it's
recommended to specify a value matching the number of vCPUs. A "usb" recommended to specify a value matching the number of vCPUs. A "usb"
......
...@@ -1444,7 +1444,7 @@ ...@@ -1444,7 +1444,7 @@
</attribute> </attribute>
</optional> </optional>
<optional> <optional>
<attribute name="num_queues"> <attribute name="queues">
<ref name="unsignedInt"/> <ref name="unsignedInt"/>
</attribute> </attribute>
</optional> </optional>
......
...@@ -5159,7 +5159,7 @@ virDomainControllerDefParseXML(xmlNodePtr node, ...@@ -5159,7 +5159,7 @@ virDomainControllerDefParseXML(xmlNodePtr node,
char *type = NULL; char *type = NULL;
char *idx = NULL; char *idx = NULL;
char *model = NULL; char *model = NULL;
char *num_queues = NULL; char *queues = NULL;
if (VIR_ALLOC(def) < 0) { if (VIR_ALLOC(def) < 0) {
virReportOOMError(); virReportOOMError();
...@@ -5195,10 +5195,10 @@ virDomainControllerDefParseXML(xmlNodePtr node, ...@@ -5195,10 +5195,10 @@ virDomainControllerDefParseXML(xmlNodePtr node,
def->model = -1; def->model = -1;
} }
if ((num_queues = virXMLPropString(node, "num_queues"))) { if ((queues = virXMLPropString(node, "queues"))) {
if (virStrToLong_ui(num_queues, NULL, 10, &def->num_queues) < 0) { if (virStrToLong_ui(queues, NULL, 10, &def->queues) < 0) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("Malformed 'num_queues' value '%s'"), num_queues); _("Malformed 'queues' value '%s'"), queues);
goto error; goto error;
} }
} }
...@@ -5280,7 +5280,7 @@ cleanup: ...@@ -5280,7 +5280,7 @@ cleanup:
VIR_FREE(type); VIR_FREE(type);
VIR_FREE(idx); VIR_FREE(idx);
VIR_FREE(model); VIR_FREE(model);
VIR_FREE(num_queues); VIR_FREE(queues);
return def; return def;
...@@ -13524,8 +13524,8 @@ virDomainControllerDefFormat(virBufferPtr buf, ...@@ -13524,8 +13524,8 @@ virDomainControllerDefFormat(virBufferPtr buf,
virBufferEscapeString(buf, " model='%s'", model); virBufferEscapeString(buf, " model='%s'", model);
} }
if (def->num_queues) if (def->queues)
virBufferAsprintf(buf, " num_queues='%u'", def->num_queues); virBufferAsprintf(buf, " queues='%u'", def->queues);
switch (def->type) { switch (def->type) {
case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL: case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL:
......
...@@ -742,7 +742,7 @@ struct _virDomainControllerDef { ...@@ -742,7 +742,7 @@ struct _virDomainControllerDef {
int type; int type;
int idx; int idx;
int model; /* -1 == undef */ int model; /* -1 == undef */
unsigned int num_queues; unsigned int queues;
union { union {
virDomainVirtioSerialOpts vioserial; virDomainVirtioSerialOpts vioserial;
} opts; } opts;
......
...@@ -3524,11 +3524,11 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, ...@@ -3524,11 +3524,11 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
int model; int model;
if (def->num_queues && if (def->queues &&
!(def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI && !(def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI &&
def->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)) { def->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("'num_queues' is only supported by virtio-scsi controller")); _("'queues' is only supported by virtio-scsi controller"));
return NULL; return NULL;
} }
...@@ -3615,8 +3615,8 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, ...@@ -3615,8 +3615,8 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
goto error; goto error;
} }
if (def->num_queues) if (def->queues)
virBufferAsprintf(&buf, ",num_queues=%u", def->num_queues); virBufferAsprintf(&buf, ",num_queues=%u", def->queues);
if (qemuBuildDeviceAddressStr(&buf, &def->info, qemuCaps) < 0) if (qemuBuildDeviceAddressStr(&buf, &def->info, qemuCaps) < 0)
goto error; goto error;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<address type='drive' controller='0' bus='0' target='0' unit='0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk> </disk>
<controller type='usb' index='0'/> <controller type='usb' index='0'/>
<controller type='scsi' index='0' model='virtio-scsi' num_queues='8'/> <controller type='scsi' index='0' model='virtio-scsi' queues='8'/>
<memballoon model='virtio'/> <memballoon model='virtio'/>
</devices> </devices>
</domain> </domain>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册