diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 9173d9f1d6..0f5d833521 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2474,7 +2474,7 @@ paravirtualized driver is specified via the ``disk`` element. - + @@ -3085,6 +3085,8 @@ paravirtualized driver is specified via the ``disk`` element. (QEMU 2.1)` - The optional ``queues`` attribute specifies the number of virt queues for virtio-blk. ( :since:`Since 3.9.0` ) + - The optional ``queue_size`` attribute specifies the size of each virt + queue for virtio-blk. ( :since:`Since 7.8.0` ) - For virtio disks, `Virtio-specific options <#elementsVirtio>`__ can also be set. ( :since:`Since 3.5.0` ) - The optional ``metadata_cache`` subelement controls aspects related to the diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 11fa24f398..fdc04f90aa 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2363,6 +2363,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 47127683d4..62b9720d0a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8931,6 +8931,9 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def, if (virXMLPropUInt(cur, "queues", 10, VIR_XML_PROP_NONE, &def->queues) < 0) return -1; + if (virXMLPropUInt(cur, "queue_size", 10, VIR_XML_PROP_NONE, &def->queue_size) < 0) + return -1; + return 0; } @@ -20774,6 +20777,13 @@ virDomainDiskDefCheckABIStability(virDomainDiskDef *src, return false; } + if (src->queue_size != dst->queue_size) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target disk queue size %u does not match source %u"), + dst->queues, src->queues); + return false; + } + if (!virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio)) return false; @@ -23424,6 +23434,9 @@ virDomainDiskDefFormatDriver(virBuffer *buf, if (disk->queues) virBufferAsprintf(&attrBuf, " queues='%u'", disk->queues); + if (disk->queue_size) + virBufferAsprintf(&attrBuf, " queue_size='%u'", disk->queue_size); + virDomainVirtioOptionsFormat(&attrBuf, disk->virtio); if (disk->src->metadataCacheMaxSize > 0) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c7e6df7981..688a842660 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -584,6 +584,7 @@ struct _virDomainDiskDef { virDomainDiskDetectZeroes detect_zeroes; char *domain_name; /* backend domain name */ unsigned int queues; + unsigned int queue_size; virDomainDiskModel model; virDomainVirtioOptions *virtio;