Re: [PATCH v4 04/20] domain: add rendernode attribute on <accel>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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.lureau@xxxxxxxxxx>
---
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 <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: PGP signature

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux