On Wed, Jan 23, 2019 at 04:32:39PM -0500, Cole Robinson wrote:
<disk> devices lack the model= attribute which is used by
most other device types. bus= mostly acts as one, but it
serves other purposes too like determing what target=
prefix to use, and for matching against controller type=
values.
Extending bus= to handle additional virtio transitional
devices will complicate apps lives, and it isn't a clean
mapping anyways. So let's bite the bullet and add a new
<disk model=X/> attribute, and wire up common handling
for virtio and virtio-{non-}transitional
Reviewed-by: Andrea Bolognani <abologna(a)redhat.com>
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
docs/formatdomain.html.in | 10 +++++
docs/schemas/domaincommon.rng | 9 ++++
src/conf/domain_conf.c | 40 ++++++++++++++++++
src/conf/domain_conf.h | 11 +++++
src/libvirt_private.syms | 2 +
.../virtio-non-transitional.x86_64-3.1.0.args | 34 +++++++++++++++
...virtio-non-transitional.x86_64-latest.args | 34 +++++++++++++++
.../virtio-non-transitional.xml | 18 ++++++++
.../virtio-transitional.x86_64-3.1.0.args | 34 +++++++++++++++
.../virtio-transitional.x86_64-latest.args | 34 +++++++++++++++
.../qemuxml2argvdata/virtio-transitional.xml | 18 ++++++++
tests/qemuxml2argvtest.c | 6 +++
.../virtio-non-transitional.xml | 42 +++++++++++++++++++
.../virtio-transitional.xml | 42 +++++++++++++++++++
tests/qemuxml2xmltest.c | 11 +++++
15 files changed, 345 insertions(+)
create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args
create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.xml
create mode 100644 tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args
create mode 100644 tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-transitional.xml
create mode 100644 tests/qemuxml2xmloutdata/virtio-non-transitional.xml
create mode 100644 tests/qemuxml2xmloutdata/virtio-transitional.xml
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 7f07bb7f55..0f66b5a1fc 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2922,6 +2922,16 @@
<span class="since">Since 0.1.4</span>
</p>
</dd>
+ <dt><code>model</code></dt>
+ <dd>
+ Indicates the emulated device model of the disk. Typically
+ this is indicated solely by the <code>bus</code> property but
+ for <code>bus</code> "virtio" the model can be
specified further
+ with "virtio-transitional", "virtio-non-transitional",
or
+ "virtio" which matches the old behavior. These settings are
+ only applicable when using controller bus type "pci".
+ <span class="since">Since 5.1.0</span>
+ </dd>
It would be probably good idea to explain this a little bit more and
possibly add a reference/link to virtio specification.
Pavel