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

[libvirt] [libvirt-gconfig PATCHv2 05/14] Implement gvir_config_domain_controller_usb_set_master



---
 .../libvirt-gconfig-domain-controller-usb.c        |   21 ++++++++++++++++++++
 .../libvirt-gconfig-domain-controller-usb.h        |    3 +++
 libvirt-gconfig/libvirt-gconfig.sym                |    1 +
 3 files changed, 25 insertions(+)

diff --git a/libvirt-gconfig/libvirt-gconfig-domain-controller-usb.c b/libvirt-gconfig/libvirt-gconfig-domain-controller-usb.c
index 5da1cbd..8ab3e25 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-controller-usb.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-controller-usb.c
@@ -83,3 +83,24 @@ void gvir_config_domain_controller_usb_set_model(GVirConfigDomainControllerUsb *
                                                NULL);
 
 }
+
+void gvir_config_domain_controller_usb_set_master(GVirConfigDomainControllerUsb *controller,
+                                                  GVirConfigDomainControllerUsb *master,
+                                                  guint startport)
+{
+    guint index;
+    char *startport_str;
+
+
+    g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_CONTROLLER_USB(controller));
+    g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_CONTROLLER_USB(master));
+
+    index = gvir_config_domain_controller_get_index(GVIR_CONFIG_DOMAIN_CONTROLLER(master));
+    gvir_config_domain_controller_set_index(GVIR_CONFIG_DOMAIN_CONTROLLER(controller), index);
+    startport_str = g_strdup_printf("%d", startport);
+    gvir_config_object_replace_child_with_attribute(GVIR_CONFIG_OBJECT(controller),
+                                                    "master",
+                                                    "startport",
+                                                    startport_str);
+    g_free(startport_str);
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-controller-usb.h b/libvirt-gconfig/libvirt-gconfig-domain-controller-usb.h
index f8cc4bf..b87921c 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-controller-usb.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-controller-usb.h
@@ -75,6 +75,9 @@ GVirConfigDomainControllerUsb *gvir_config_domain_controller_usb_new_from_xml(co
                                                                               GError **error);
 void gvir_config_domain_controller_usb_set_model(GVirConfigDomainControllerUsb *controller,
                                                  GVirConfigDomainControllerUsbModel model);
+void gvir_config_domain_controller_usb_set_master(GVirConfigDomainControllerUsb *controller,
+                                                  GVirConfigDomainControllerUsb *master,
+                                                  guint startport);
 
 G_END_DECLS
 
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index a0dca07..06d7b32 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -77,6 +77,7 @@ LIBVIRT_GCONFIG_0.0.4 {
 	gvir_config_domain_controller_usb_model_get_type;
 	gvir_config_domain_controller_usb_new;
 	gvir_config_domain_controller_usb_new_from_xml;
+	gvir_config_domain_controller_usb_set_master;
 	gvir_config_domain_controller_usb_set_model;
 
 	gvir_config_domain_device_get_type;
-- 
1.7.10


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