[libgovirt] Implement OvirtCdrom::to_xml()
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgovirt] Implement OvirtCdrom::to_xml()
- Date: Tue, 8 Oct 2013 17:05:21 +0000 (UTC)
commit 39652be33770151306ad0159f7d57c2528f71988
Author: Christophe Fergeau <cfergeau redhat com>
Date: Thu Aug 29 20:54:53 2013 +0200
Implement OvirtCdrom::to_xml()
govirt/ovirt-cdrom.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/govirt/ovirt-cdrom.c b/govirt/ovirt-cdrom.c
index de71477..3239966 100644
--- a/govirt/ovirt-cdrom.c
+++ b/govirt/ovirt-cdrom.c
@@ -134,6 +134,19 @@ static gboolean ovirt_cdrom_init_from_xml(OvirtResource *resource,
}
+static char *ovirt_cdrom_to_xml(OvirtResource *resource)
+{
+ OvirtCdrom *cdrom;
+
+ g_return_val_if_fail(OVIRT_IS_CDROM(resource), NULL);
+ cdrom = OVIRT_CDROM(resource);
+ g_return_val_if_fail(cdrom->priv->file != NULL, NULL);
+
+ return g_strdup_printf("<cdrom>\n\t<file id=\"%s\"/>\n</cdrom>",
+ cdrom->priv->file);
+}
+
+
static void ovirt_cdrom_class_init(OvirtCdromClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
@@ -143,6 +156,7 @@ static void ovirt_cdrom_class_init(OvirtCdromClass *klass)
g_type_class_add_private(klass, sizeof(OvirtCdromPrivate));
resource_class->init_from_xml = ovirt_cdrom_init_from_xml;
+ resource_class->to_xml = ovirt_cdrom_to_xml;
object_class->finalize = ovirt_cdrom_finalize;
object_class->get_property = ovirt_cdrom_get_property;
object_class->set_property = ovirt_cdrom_set_property;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]