cli: Add --video model.blob=on|off

Libvirt enables blob resources for the virtio video device since 9.2.0.
It accelerates the display path due to less or no copying of pixel data.

E.g.
  virt-install \
  ... \
  --video model.type=virtio,blob=on

It results in the following domain xml:

    <video>
      <model type="virtio" blob="on"/>
    </video>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Lin Ma <lma@suse.de>
This commit is contained in:
Lin Ma 2023-07-11 08:26:51 +08:00 committed by Cole Robinson
parent febddd4b01
commit 6a65def684
4 changed files with 8 additions and 0 deletions

View File

@ -788,6 +788,11 @@
<acceleration accel3d="yes"/>
</model>
</video>
<video>
<model type="virtio" blob="on">
<acceleration accel3d="yes"/>
</model>
</video>
<hostdev mode="subsystem" type="pci" managed="yes">
<source>
<address domain="0" bus="0" slot="25" function="0"/>

View File

@ -752,6 +752,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
--video cirrus
--video model=qxl,vgamem=1,ram=2,vram=3,heads=4,accel3d=yes,vram64=65
--video model=qxl,model.vgamem=1,model.ram=2,model.vram=3,model.heads=4,model.acceleration.accel3d=yes,model.vram64=65
--video model=virtio,model.blob=on
--smartcard passthrough,type=spicevmc

View File

@ -4664,6 +4664,7 @@ class ParserVideo(VirtCLIParser):
cls.add_arg("model.vram", "vram")
cls.add_arg("model.vram64", "vram64")
cls.add_arg("model.vgamem", "vgamem")
cls.add_arg("model.blob", "blob")
###################

View File

@ -18,6 +18,7 @@ class DeviceVideo(Device):
heads = XMLProperty("./model/@heads", is_int=True)
vgamem = XMLProperty("./model/@vgamem", is_int=True)
accel3d = XMLProperty("./model/acceleration/@accel3d", is_yesno=True)
blob = XMLProperty("./model/@blob", is_onoff=True)
def _set_model(self, val):
self._model = val