[Spice-devel] VM pools and libgovirt

Christophe Fergeau cfergeau at redhat.com
Tue Dec 3 02:12:16 PST 2013


Hey Iordan,

On Tue, Dec 03, 2013 at 03:07:09AM -0500, i iordanov wrote:
> My pleasure! Attached find the patch, generated the way you wanted.

Thanks for the patch, a few quick initial comments:
- formatting of the commit log was off, see (for example)
  https://wiki.openstack.org/wiki/GitCommitMessages#Summary_of_GIT_commit_message_structure
  for the recommended format of git commit logs (helps when using 'git shortlog' for example)
  This document as a whole is an interesting read imo ;)
- I'd use ovirt_vmpool_allocate_vm (rather than _allocatevm)
- imo the ovirt_invoke_action stuff should be moved to a generic place
  before this patch, but I can look into that
- there were a few minor white space issues (see patch below)
- you need to export the new public functions in govirt/govirt.sym (see
  patch below)

Christophe

git a/govirt/govirt.sym b/govirt/govirt.sym
index bc53901..bb7be79 100644
--- a/govirt/govirt.sym
+++ b/govirt/govirt.sym
@@ -87,5 +87,12 @@ GOVIRT_0.2.1 {
         ovirt_vm_get_cdroms;
 } GOVIRT_0.2.0;

+GOVIRT_0.3.1 {
+        ovirt_api_get_vmpools;
+
+        ovirt_vmpool_get_type;
+        ovirt_vmpool_new;
+        ovirt_vmpool_allocatevm;
+} GOVIRT_0.2.1;

 # .... define new API here using predicted next version number ....
diff --git a/govirt/ovirt-vmpool-xml.c b/govirt/ovirt-vmpool-xml.c
index ad17b8d..bb359bc 100644
--- a/govirt/ovirt-vmpool-xml.c
+++ b/govirt/ovirt-vmpool-xml.c
@@ -34,7 +34,7 @@ static gboolean vmpool_set_size_from_xml(OvirtVmPool
*vmpool, RestXmlNode *node)
     RestXmlNode *size_node;
     size_node = rest_xml_node_find(node, "size");
     if (size_node != NULL) {
-       gint size;
+        gint size;
         g_return_val_if_fail(size_node->content != NULL, FALSE);
         size = (gint)ovirt_utils_guint64_from_string(size_node->content);
         g_object_set(G_OBJECT(vmpool), "size", size, NULL);
diff --git a/govirt/ovirt-vmpool.c b/govirt/ovirt-vmpool.c
index 93180a8..b39d34e 100644
--- a/govirt/ovirt-vmpool.c
+++ b/govirt/ovirt-vmpool.c
@@ -38,9 +38,9 @@ static gboolean parse_action_response(RestProxyCall
*call, OvirtVmPool *vmpool,
         (G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_VMPOOL,
OvirtVmPoolPrivate))

 struct _OvirtVmPoolPrivate {
-       gint prestarted_vms;
-       gint max_user_vms;
-       gint size;
+        gint prestarted_vms;
+        gint max_user_vms;
+        gint size;
 };

 G_DEFINE_TYPE(OvirtVmPool, ovirt_vmpool, OVIRT_TYPE_RESOURCE);
@@ -75,7 +75,7 @@ static void ovirt_vmpool_get_property(GObject *object,
         g_value_set_int(value, vmpool->priv->prestarted_vms);
         break;
     case PROP_MAX_USER_VMS:
-       g_value_set_int(value, vmpool->priv->max_user_vms);
+        g_value_set_int(value, vmpool->priv->max_user_vms);
         break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
[
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20131203/8df3e95b/attachment.pgp>


More information about the Spice-devel mailing list