From e017f95c7d833c0e9a463a1613d01fe93020606b Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Tue, 23 Jun 2020 13:29:56 -0500 Subject: [PATCH 5/6] qemu: format 'ramfb' attribute for mediated devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's possible to use ramfb as the boot display of an assigned vgpu device. This was introduced in 4b95738c, but unfortunately the attribute was not formatted into the xml output for such a device. This patch fixes that oversight and adds a xml2xml test to verify proper behavior. https://bugzilla.redhat.com/show_bug.cgi?id=1847791 cherry pick from: c5815b31976f3982d18c7f6c1367ab6e403eb7eb Signed-off-by: Jonathon Jongsma Reviewed-by: Daniel Henrique Barboza Signed-off-by: Ján Tomko Reviewed-by: Ján Tomko --- src/conf/domain_conf.c | 3 ++ .../hostdev-mdev-display-ramfb.x86_64-latest.xml | 44 ++++++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 3 files changed, 48 insertions(+) create mode 100644 tests/qemuxml2xmloutdata/hostdev-mdev-display-ramfb.x86_64-latest.xml diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 37c785a..93e78a0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27849,6 +27849,9 @@ virDomainHostdevDefFormat(virBufferPtr buf, if (mdevsrc->display != VIR_TRISTATE_SWITCH_ABSENT) virBufferAsprintf(buf, " display='%s'", virTristateSwitchTypeToString(mdevsrc->display)); + if (mdevsrc->ramfb != VIR_TRISTATE_SWITCH_ABSENT) + virBufferAsprintf(buf, " ramfb='%s'", + virTristateSwitchTypeToString(mdevsrc->ramfb)); } } diff --git a/tests/qemuxml2xmloutdata/hostdev-mdev-display-ramfb.x86_64-latest.xml b/tests/qemuxml2xmloutdata/hostdev-mdev-display-ramfb.x86_64-latest.xml new file mode 100644 index 0000000..c134400 --- /dev/null +++ b/tests/qemuxml2xmloutdata/hostdev-mdev-display-ramfb.x86_64-latest.xml @@ -0,0 +1,44 @@ + + QEMUGuest2 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + +
+ + + +
+ + + + + + +