Learn to set the accel3d attribute on video model. Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxx> --- examples/config-demo.py | 1 + libvirt-gconfig/libvirt-gconfig-domain-video.c | 18 ++++++++++++++++++ libvirt-gconfig/libvirt-gconfig-domain-video.h | 2 ++ libvirt-gconfig/libvirt-gconfig.sym | 1 + 4 files changed, 22 insertions(+) diff --git a/examples/config-demo.py b/examples/config-demo.py index 3fdc367..e92aa43 100644 --- a/examples/config-demo.py +++ b/examples/config-demo.py @@ -63,6 +63,7 @@ domain.add_device(graphics) video = LibvirtGConfig.DomainVideo.new() video.set_model(LibvirtGConfig.DomainVideoModel.VIRTIO) +video.set_accel3d(True) domain.add_device(video) console = LibvirtGConfig.DomainConsole.new() diff --git a/libvirt-gconfig/libvirt-gconfig-domain-video.c b/libvirt-gconfig/libvirt-gconfig-domain-video.c index ba03c5a..64353bd 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain-video.c +++ b/libvirt-gconfig/libvirt-gconfig-domain-video.c @@ -136,3 +136,21 @@ void gvir_config_domain_video_set_heads(GVirConfigDomainVideo *video, NULL); g_object_unref(G_OBJECT(node)); } + +void gvir_config_domain_video_set_accel3d(GVirConfigDomainVideo *video, + gboolean accel3d) +{ + GVirConfigObject *model, *accel; + + g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_VIDEO(video)); + model = gvir_config_object_add_child(GVIR_CONFIG_OBJECT(video), "model"); + g_return_if_fail(GVIR_CONFIG_IS_OBJECT(model)); + accel = gvir_config_object_add_child(GVIR_CONFIG_OBJECT(model), "acceleration"); + g_return_if_fail(GVIR_CONFIG_IS_OBJECT(accel)); + + gvir_config_object_set_attribute_with_type(accel, "accel3d", + G_TYPE_BOOLEAN, accel3d, + NULL); + g_object_unref(G_OBJECT(model)); + g_object_unref(G_OBJECT(accel)); +} diff --git a/libvirt-gconfig/libvirt-gconfig-domain-video.h b/libvirt-gconfig/libvirt-gconfig-domain-video.h index d162b8f..9fb8e4d 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain-video.h +++ b/libvirt-gconfig/libvirt-gconfig-domain-video.h @@ -82,6 +82,8 @@ void gvir_config_domain_video_set_vgamem(GVirConfigDomainVideo *video, guint kbytes); void gvir_config_domain_video_set_heads(GVirConfigDomainVideo *video, guint head_count); +void gvir_config_domain_video_set_accel3d(GVirConfigDomainVideo *video, + gboolean accel3d); G_END_DECLS diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym index b8c600e..f11f97a 100644 --- a/libvirt-gconfig/libvirt-gconfig.sym +++ b/libvirt-gconfig/libvirt-gconfig.sym @@ -735,6 +735,7 @@ global: LIBVIRT_GCONFIG_0.2.4 { gvir_config_domain_graphics_spice_set_gl; + gvir_config_domain_video_set_accel3d; } LIBVIRT_GCONFIG_0.2.2; # .... define new API here using predicted next version number .... -- 2.5.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list