提交 1bc2cb3b 编写于 作者: J Ján Tomko
上级 82223f93
......@@ -3011,6 +3011,11 @@
<code>bus</code> and "pci" or "ccw" <code>address</code> types.
<span class='since'>Since 1.2.8 (QEMU 2.1)</span>
</li>
<li>
For virtio disks,
<a href="#elementsVirtio">Virtio-specific options</a> can also be
set. (<span class="since">Since 3.5.0</span>)
</li>
</ul>
</dd>
<dt><code>backenddomain</code></dt>
......
......@@ -1770,6 +1770,7 @@
<optional>
<ref name="detect_zeroes"/>
</optional>
<ref name="virtioOptions"/>
<empty/>
</element>
</define>
......
......@@ -1745,6 +1745,7 @@ virDomainDiskDefFree(virDomainDiskDefPtr def)
VIR_FREE(def->product);
VIR_FREE(def->domain_name);
VIR_FREE(def->blkdeviotune.group_name);
VIR_FREE(def->virtio);
virDomainDeviceInfoClear(&def->info);
virObjectUnref(def->privateData);
......@@ -4467,6 +4468,10 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev,
}
}
if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO &&
virDomainCheckVirtioOptions(disk->virtio) < 0)
return -1;
if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0)
return -1;
......@@ -8447,6 +8452,9 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
}
}
if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0)
goto error;
/* Disk volume types will have authentication information handled in
* virStorageTranslateDiskSourcePool
*/
......@@ -19172,6 +19180,10 @@ virDomainDiskDefCheckABIStability(virDomainDiskDefPtr src,
return false;
}
if (src->virtio && dst->virtio &&
!virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio))
return false;
if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info))
return false;
......@@ -21360,6 +21372,9 @@ virDomainDiskDefFormat(virBufferPtr buf,
virBufferAsprintf(&driverBuf, " iothread='%u'", def->iothread);
if (def->detect_zeroes)
virBufferAsprintf(&driverBuf, " detect_zeroes='%s'", detect_zeroes);
virDomainVirtioOptionsFormat(&driverBuf, def->virtio);
if (virBufferUse(&driverBuf)) {
virBufferAddLit(buf, "<driver");
virBufferAddBuffer(buf, &driverBuf);
......
......@@ -668,6 +668,7 @@ struct _virDomainDiskDef {
unsigned int iothread; /* unused = 0, > 0 specific thread # */
int detect_zeroes; /* enum virDomainDiskDetectZeroes */
char *domain_name; /* backend domain name */
virDomainVirtioOptionsPtr virtio;
};
......
......@@ -15,7 +15,7 @@
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<driver name='qemu' type='raw' iommu='on' ats='on'/>
<source file='/var/lib/libvirt/images/img1'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册