On Fri, Sep 13, 2019 at 04:50:41PM +0400, marcandre.lur...@redhat.com wrote:
From: Marc-André Lureau <marcandre.lur...@redhat.com>

vhost-user-gpu helper takes --render-node option to specify on which
GPU should the renderning be done.

Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com>
---
docs/formatdomain.html.in                 |  6 ++++++
docs/schemas/domaincommon.rng             |  5 +++++
src/conf/domain_conf.c                    | 17 ++++++++++++++++-
src/conf/domain_conf.h                    |  1 +
tests/qemuxml2argvdata/virtio-options.xml |  2 +-
5 files changed, 29 insertions(+), 2 deletions(-)

@@ -15378,6 +15387,8 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node)
        def->accel2d = val;
    }

+    VIR_STEAL_PTR(def->rendernode, rendernode);

virFileSanitizePath should be called on user-provided paths

+
 cleanup:
    return def;
}
@@ -26535,6 +26546,10 @@ virDomainVideoAccelDefFormat(virBufferPtr buf,
        virBufferAsprintf(buf, " accel2d='%s'",
                          virTristateBoolTypeToString(def->accel2d));
    }
+    if (def->rendernode) {
+        virBufferAsprintf(buf, " rendernode='%s'",
+                          def->rendernode);
+    }

And user-provided string should be escaped for XML by
virBufferEscapeString (which is a no-op if the argument is NULL, so you
can drop the if as well)

    virBufferAddLit(buf, "/>\n");
}


Reviewed-by: Ján Tomko <jto...@redhat.com>

Jano

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to