diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 00a61be232..7edeca8a61 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1439,11 +1439,13 @@ path to the file holding the disk. If the disk type is "block", then the dev attribute specifies the path to the host device to serve as - the disk. With both "file" and "block", one or more optional + the disk. With "file", "block", and "volume", one or more optional sub-elements seclabel, described below (and since 0.9.9), can be used to override the domain security labeling policy for just - that source file. If the disk type is "dir", then the + that source file. (NB, for "volume" type disk, seclabel + is only valid when the specified storage volume is of 'file' or + 'block' type). If the disk type is "dir", then the dir attribute specifies the fully-qualified path to the directory to use as the disk. If the disk type is "network", then the protocol attribute specifies diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 39376f90df..32abd4f90f 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1123,6 +1123,9 @@ + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2d95200924..79e3b2ef64 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13020,16 +13020,24 @@ virDomainDiskSourceDefFormat(virBufferPtr buf, } break; case VIR_DOMAIN_DISK_TYPE_VOLUME: - /* Parsing guarantees the def->srcpool->volume cannot be NULL - * if def->srcpool->pool is not NULL. - */ + virBufferAddLit(buf, " srcpool) - virBufferAsprintf(buf, " srcpool->pool, def->srcpool->volume); if (def->startupPolicy) - virBufferEscapeString(buf, " startupPolicy='%s'/>\n", startupPolicy); - else + virBufferEscapeString(buf, " startupPolicy='%s'", startupPolicy); + + if (def->nseclabels) { + virBufferAddLit(buf, ">\n"); + virBufferAdjustIndent(buf, 8); + for (n = 0; n < def->nseclabels; n++) + virSecurityDeviceLabelDefFormat(buf, def->seclabels[n]); + virBufferAdjustIndent(buf, -8); + virBufferAddLit(buf, " \n"); + } else { virBufferAddLit(buf, "/>\n"); + } break; default: virReportError(VIR_ERR_INTERNAL_ERROR, diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml index a218e78700..acf9753498 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml @@ -15,7 +15,11 @@ /usr/bin/qemu - + + + + +