[libvirt] [libvirt-glib] [PATCH v2 1/4] GVirDomainSnapshot: Add _get_is_current

Add a way to determine if the given GVirDomainSnapshot is the current snapshot of its GVirDomain. --- libvirt-gobject/libvirt-gobject-domain-snapshot.c | 33 +++++++++++++++++++++++ libvirt-gobject/libvirt-gobject-domain-snapshot.h | 4 +++ libvirt-gobject/libvirt-gobject.sym | 1 + 3 files changed, 38 insertions(+) diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.c b/libvirt-gobject/libvirt-gobject-domain-snapshot.c index 7bb89f1..c53e877 100644 --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.c +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.c @@ -235,3 +235,36 @@ gboolean gvir_domain_snapshot_delete (GVirDomainSnapshot *snapshot, } return TRUE; } + + +/** + * gvir_domain_snapshot_get_is_current: + * @snapshot: The domain snapshot + * @flags: Currently unused, pass 0 + * @is_current: (out): %TRUE if the given snapshot is the current snapshot + * of its domain, %FALSE otherwise. + * @error: (allow-none): Place-holder for error or %NULL + * + * Returns: %TRUE on success, %FALSE otherwise. + */ +gboolean gvir_domain_snapshot_get_is_current(GVirDomainSnapshot *snapshot, + guint flags, + gboolean *is_current, + GError **error) { + gint status; + + g_return_val_if_fail(GVIR_IS_DOMAIN_SNAPSHOT(snapshot), FALSE); + g_return_val_if_fail(error == NULL || *error == NULL, FALSE); + + status = virDomainSnapshotIsCurrent(snapshot->priv->handle, flags); + if (status == -1) { + gvir_set_error(error, GVIR_DOMAIN_SNAPSHOT_ERROR, 0, + "Could not determine if `%s' is the current snapshot", + gvir_domain_snapshot_get_name(snapshot)); + return FALSE; + } + + *is_current = status; + + return TRUE; +} diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.h b/libvirt-gobject/libvirt-gobject-domain-snapshot.h index b3ebe7f..0a0bb96 100644 --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.h +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.h @@ -85,6 +85,10 @@ gboolean gvir_domain_snapshot_delete (GVirDomainSnapshot *snapshot, guint flags, GError **error); +gboolean gvir_domain_snapshot_get_is_current(GVirDomainSnapshot *snapshot, + guint flags, + gboolean *is_current, + GError **error); G_END_DECLS #endif /* __LIBVIRT_GOBJECT_DOMAIN_SNAPSHOT_H__ */ diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym index b0c55b5..c740f88 100644 --- a/libvirt-gobject/libvirt-gobject.sym +++ b/libvirt-gobject/libvirt-gobject.sym @@ -242,6 +242,7 @@ LIBVIRT_GOBJECT_0.1.9 { gvir_domain_get_snapshots; gvir_domain_snapshot_delete; gvir_domain_snapshot_delete_flags_get_type; + gvir_domain_snapshot_get_is_current; gvir_domain_snapshot_list_flags_get_type; gvir_storage_pool_state_get_type; gvir_storage_vol_resize_flags_get_type; -- 2.0.4

Add a way to revert a domain to one of its snapshots. --- libvirt-gobject/libvirt-gobject-domain-snapshot.c | 33 +++++++++++++++++++++++ libvirt-gobject/libvirt-gobject-domain-snapshot.h | 17 ++++++++++++ libvirt-gobject/libvirt-gobject.sym | 2 ++ 3 files changed, 52 insertions(+) diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.c b/libvirt-gobject/libvirt-gobject-domain-snapshot.c index c53e877..dca1086 100644 --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.c +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.c @@ -268,3 +268,36 @@ gboolean gvir_domain_snapshot_get_is_current(GVirDomainSnapshot *snapshot, return TRUE; } + + + +/** + * gvir_domain_snapshot_revert_to: + * @snapshot: The domain snapshot + * @flags: Bitwise OR of GVirDomainSnapshotRevertFlags + * @error: (allow-none): Place-holder for error or %NULL + * + * Returns: %TRUE if the snapshot's domain has successfully been + * reverted to the given snapshot, %FALSE otherwise, in which case + * @error will be set. + */ +gboolean gvir_domain_snapshot_revert_to(GVirDomainSnapshot *snapshot, + guint flags, + GError **error) { + int status; + + g_return_val_if_fail(GVIR_IS_DOMAIN_SNAPSHOT(snapshot), FALSE); + g_return_val_if_fail((error == NULL) || (*error == NULL), FALSE); + + + status = virDomainRevertToSnapshot(snapshot->priv->handle, + flags); + if (status != 0) { + gvir_set_error(error, GVIR_DOMAIN_SNAPSHOT_ERROR, + 0, "Failed to revert to snapshot `%s'", + gvir_domain_snapshot_get_name(snapshot)); + return FALSE; + } + + return TRUE; +} diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.h b/libvirt-gobject/libvirt-gobject-domain-snapshot.h index 0a0bb96..7abe8ca 100644 --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.h +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.h @@ -71,6 +71,19 @@ typedef enum { } GVirDomainSnapshotDeleteFlags; +/** + * GVirDomainSnapshotRevertFlags: + * @GVIR_DOMAIN_SNAPSHOT_REVERT_RUNNING: Run after revert + * @GVIR_DOMAIN_SNAPSHOT_REVERT_PAUSED: Pause after revert + * @GVIR_DOMAIN_SNAPSHOT_REVERT_FORCE: Allow risky reverts + */ +typedef enum { + GVIR_DOMAIN_SNAPSHOT_REVERT_RUNNING = 1, + GVIR_DOMAIN_SNAPSHOT_REVERT_PAUSED = 2, + GVIR_DOMAIN_SNAPSHOT_REVERT_FORCE = 4 +} GVirDomainSnapshotRevertFlags; + + GType gvir_domain_snapshot_get_type(void); GType gvir_domain_snapshot_handle_get_type(void); @@ -89,6 +102,10 @@ gboolean gvir_domain_snapshot_get_is_current(GVirDomainSnapshot *snapshot, guint flags, gboolean *is_current, GError **error); + +gboolean gvir_domain_snapshot_revert_to(GVirDomainSnapshot *snapshot, + guint flags, + GError **error); G_END_DECLS #endif /* __LIBVIRT_GOBJECT_DOMAIN_SNAPSHOT_H__ */ diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym index c740f88..c1c9421 100644 --- a/libvirt-gobject/libvirt-gobject.sym +++ b/libvirt-gobject/libvirt-gobject.sym @@ -244,6 +244,8 @@ LIBVIRT_GOBJECT_0.1.9 { gvir_domain_snapshot_delete_flags_get_type; gvir_domain_snapshot_get_is_current; gvir_domain_snapshot_list_flags_get_type; + gvir_domain_snapshot_revert_flags_get_type; + gvir_domain_snapshot_revert_to; gvir_storage_pool_state_get_type; gvir_storage_vol_resize_flags_get_type; gvir_storage_vol_type_get_type; -- 2.0.4

... which is basically analogous to gvir_domain_set_config --- libvirt-gobject/libvirt-gobject-domain-snapshot.c | 68 +++++++++++++++++++++++ libvirt-gobject/libvirt-gobject-domain-snapshot.h | 5 ++ libvirt-gobject/libvirt-gobject.sym | 1 + 3 files changed, 74 insertions(+) diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.c b/libvirt-gobject/libvirt-gobject-domain-snapshot.c index dca1086..62efce0 100644 --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.c +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.c @@ -301,3 +301,71 @@ gboolean gvir_domain_snapshot_revert_to(GVirDomainSnapshot *snapshot, return TRUE; } + + + +/** + * gvir_domain_snapshot_set_config: + * @snapshot: The domain snapshot + * @conf: The new config object + * @error: (allow-none): Place-holder for error or %NULL + * + * Updates the given snapshot's configuration according to the + * given GVirConfigDomainSnapshot. + * + * Returns: %TRUE if no error was reported, %FALSE otherwise. + */ +gboolean gvir_domain_snapshot_set_config(GVirDomainSnapshot *snapshot, + GVirConfigDomainSnapshot *conf, + GError **error) +{ + gchar *xml; + virConnectPtr conn; + virDomainSnapshotPtr handle; + virDomainPtr domain; + GVirDomainSnapshotPrivate *priv; + + g_return_val_if_fail(GVIR_IS_DOMAIN_SNAPSHOT(snapshot), FALSE); + g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_SNAPSHOT(conf), FALSE); + g_return_val_if_fail(error == NULL || *error == NULL, FALSE); + + priv = snapshot->priv; + handle = priv->handle; + domain = virDomainSnapshotGetDomain(handle); + + + if ((conn = virDomainSnapshotGetConnect(priv->handle)) == NULL) { + gvir_set_error_literal(error, GVIR_DOMAIN_SNAPSHOT_ERROR, + 0, + "Failed to get domain connection"); + return FALSE; + } + + + /* XXX Changing the name will create a new snapshot */ + if (g_strcmp0 (gvir_domain_snapshot_get_name(snapshot), + gvir_config_domain_snapshot_get_name(conf)) != 0) { + gvir_set_error_literal(error, GVIR_DOMAIN_SNAPSHOT_ERROR, + 0, + "Cannot set config: snapshot names don't match"); + return FALSE; + } + + + xml = gvir_config_object_to_xml(GVIR_CONFIG_OBJECT(conf)); + + handle = virDomainSnapshotCreateXML(domain, + xml, + VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE); + g_free(xml); + + if (handle == NULL) { + gvir_set_error(error, GVIR_DOMAIN_SNAPSHOT_ERROR, + 0, + "Failed to create snapshot `%s' from XML definition", + gvir_domain_snapshot_get_name(snapshot)); + return FALSE; + } + virDomainSnapshotFree(handle); + return TRUE; +} diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.h b/libvirt-gobject/libvirt-gobject-domain-snapshot.h index 7abe8ca..5ab3025 100644 --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.h +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.h @@ -106,6 +106,11 @@ gboolean gvir_domain_snapshot_get_is_current(GVirDomainSnapshot *snapshot, gboolean gvir_domain_snapshot_revert_to(GVirDomainSnapshot *snapshot, guint flags, GError **error); + +gboolean gvir_domain_snapshot_set_config(GVirDomainSnapshot *snapshot, + GVirConfigDomainSnapshot *conf, + GError **error); + G_END_DECLS #endif /* __LIBVIRT_GOBJECT_DOMAIN_SNAPSHOT_H__ */ diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym index c1c9421..bd12239 100644 --- a/libvirt-gobject/libvirt-gobject.sym +++ b/libvirt-gobject/libvirt-gobject.sym @@ -246,6 +246,7 @@ LIBVIRT_GOBJECT_0.1.9 { gvir_domain_snapshot_list_flags_get_type; gvir_domain_snapshot_revert_flags_get_type; gvir_domain_snapshot_revert_to; + gvir_domain_snapshot_set_config; gvir_storage_pool_state_get_type; gvir_storage_vol_resize_flags_get_type; gvir_storage_vol_type_get_type; -- 2.0.4

... which uses virDomainHasCurrentSnapshot to determine if the given domain has a current snapshot or not. --- libvirt-gobject/libvirt-gobject-domain.c | 34 ++++++++++++++++++++++++++++++++ libvirt-gobject/libvirt-gobject-domain.h | 4 ++++ libvirt-gobject/libvirt-gobject.sym | 1 + 3 files changed, 39 insertions(+) diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c index 5399892..f3794cc 100644 --- a/libvirt-gobject/libvirt-gobject-domain.c +++ b/libvirt-gobject/libvirt-gobject-domain.c @@ -1686,3 +1686,37 @@ gboolean gvir_domain_fetch_snapshots_finish(GVirDomain *dom, return g_task_propagate_boolean(G_TASK(res), error); } + + +/** + * gvir_domain_has_current_snapshot: + * @dom: a #GVirDomain + * @flags: Unused, pass 0 + * @has_current_snapshot: (out): Will be set to %TRUE if the given domain + * has a current snapshot and to %FALSE otherwise. + * @error: (allow-none): Place-holder for error or %NULL + * + * Returns: %TRUE on success, %FALSE otherwise. + */ +gboolean gvir_domain_has_current_snapshot(GVirDomain *dom, + guint flags, + gboolean *has_current_snapshot, + GError **error) { + int status; + g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE); + g_return_val_if_fail(error == NULL || *error == NULL, FALSE); + + status = virDomainHasCurrentSnapshot(dom->priv->handle, + flags); + + if (status == -1) { + gvir_set_error(error, GVIR_DOMAIN_ERROR, 0, + "Unable to check if domain `%s' has a current snapshot", + gvir_domain_get_name(dom)); + return FALSE; + } + + *has_current_snapshot = status; + + return TRUE; +} diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h index 9846375..52b805f 100644 --- a/libvirt-gobject/libvirt-gobject-domain.h +++ b/libvirt-gobject/libvirt-gobject-domain.h @@ -380,6 +380,10 @@ gboolean gvir_domain_fetch_snapshots_finish(GVirDomain *dom, GAsyncResult *res, GError **error); +gboolean gvir_domain_has_current_snapshot(GVirDomain *dom, + guint flags, + gboolean *has_current_snapshot, + GError **error); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym index bd12239..c34bf02 100644 --- a/libvirt-gobject/libvirt-gobject.sym +++ b/libvirt-gobject/libvirt-gobject.sym @@ -240,6 +240,7 @@ LIBVIRT_GOBJECT_0.1.9 { gvir_domain_fetch_snapshots_async; gvir_domain_fetch_snapshots_finish; gvir_domain_get_snapshots; + gvir_domain_has_current_snapshot; gvir_domain_snapshot_delete; gvir_domain_snapshot_delete_flags_get_type; gvir_domain_snapshot_get_is_current; -- 2.0.4

On Thu, Aug 07, 2014 at 12:20:16PM +0200, Timm Bäder wrote:
... which uses virDomainHasCurrentSnapshot to determine if the given domain has a current snapshot or not. --- libvirt-gobject/libvirt-gobject-domain.c | 34 ++++++++++++++++++++++++++++++++ libvirt-gobject/libvirt-gobject-domain.h | 4 ++++ libvirt-gobject/libvirt-gobject.sym | 1 + 3 files changed, 39 insertions(+)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c index 5399892..f3794cc 100644 --- a/libvirt-gobject/libvirt-gobject-domain.c +++ b/libvirt-gobject/libvirt-gobject-domain.c @@ -1686,3 +1686,37 @@ gboolean gvir_domain_fetch_snapshots_finish(GVirDomain *dom,
return g_task_propagate_boolean(G_TASK(res), error); } + + +/** + * gvir_domain_has_current_snapshot: + * @dom: a #GVirDomain + * @flags: Unused, pass 0 + * @has_current_snapshot: (out): Will be set to %TRUE if the given domain + * has a current snapshot and to %FALSE otherwise. + * @error: (allow-none): Place-holder for error or %NULL + * + * Returns: %TRUE on success, %FALSE otherwise. + */ +gboolean gvir_domain_has_current_snapshot(GVirDomain *dom, + guint flags, + gboolean *has_current_snapshot, + GError **error) {
I think this one needs to be gvir_domain_get_has_current_snapshot as well :( Christophe

... which uses virDomainHasCurrentSnapshot to determine if the given domain has a current snapshot or not. --- libvirt-gobject/libvirt-gobject-domain.c | 34 ++++++++++++++++++++++++++++++++ libvirt-gobject/libvirt-gobject-domain.h | 4 ++++ libvirt-gobject/libvirt-gobject.sym | 1 + 3 files changed, 39 insertions(+) diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c index 5399892..feac6f0 100644 --- a/libvirt-gobject/libvirt-gobject-domain.c +++ b/libvirt-gobject/libvirt-gobject-domain.c @@ -1686,3 +1686,37 @@ gboolean gvir_domain_fetch_snapshots_finish(GVirDomain *dom, return g_task_propagate_boolean(G_TASK(res), error); } + + +/** + * gvir_domain_get_has_current_snapshot: + * @dom: a #GVirDomain + * @flags: Unused, pass 0 + * @has_current_snapshot: (out): Will be set to %TRUE if the given domain + * has a current snapshot and to %FALSE otherwise. + * @error: (allow-none): Place-holder for error or %NULL + * + * Returns: %TRUE on success, %FALSE otherwise. + */ +gboolean gvir_domain_get_has_current_snapshot(GVirDomain *dom, + guint flags, + gboolean *has_current_snapshot, + GError **error) { + int status; + g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE); + g_return_val_if_fail(error == NULL || *error == NULL, FALSE); + + status = virDomainHasCurrentSnapshot(dom->priv->handle, + flags); + + if (status == -1) { + gvir_set_error(error, GVIR_DOMAIN_ERROR, 0, + "Unable to check if domain `%s' has a current snapshot", + gvir_domain_get_name(dom)); + return FALSE; + } + + *has_current_snapshot = status; + + return TRUE; +} diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h index 9846375..56c80b8 100644 --- a/libvirt-gobject/libvirt-gobject-domain.h +++ b/libvirt-gobject/libvirt-gobject-domain.h @@ -380,6 +380,10 @@ gboolean gvir_domain_fetch_snapshots_finish(GVirDomain *dom, GAsyncResult *res, GError **error); +gboolean gvir_domain_get_has_current_snapshot(GVirDomain *dom, + guint flags, + gboolean *has_current_snapshot, + GError **error); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym index bd12239..68e9b58 100644 --- a/libvirt-gobject/libvirt-gobject.sym +++ b/libvirt-gobject/libvirt-gobject.sym @@ -240,6 +240,7 @@ LIBVIRT_GOBJECT_0.1.9 { gvir_domain_fetch_snapshots_async; gvir_domain_fetch_snapshots_finish; gvir_domain_get_snapshots; + gvir_domain_get_has_current_snapshot; gvir_domain_snapshot_delete; gvir_domain_snapshot_delete_flags_get_type; gvir_domain_snapshot_get_is_current; -- 2.0.4

On Fri, Aug 08, 2014 at 05:07:32PM +0200, Timm Bäder wrote:
... which uses virDomainHasCurrentSnapshot to determine if the given domain has a current snapshot or not. --- libvirt-gobject/libvirt-gobject-domain.c | 34 ++++++++++++++++++++++++++++++++ libvirt-gobject/libvirt-gobject-domain.h | 4 ++++ libvirt-gobject/libvirt-gobject.sym | 1 + 3 files changed, 39 insertions(+)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c index 5399892..feac6f0 100644 --- a/libvirt-gobject/libvirt-gobject-domain.c +++ b/libvirt-gobject/libvirt-gobject-domain.c @@ -1686,3 +1686,37 @@ gboolean gvir_domain_fetch_snapshots_finish(GVirDomain *dom,
return g_task_propagate_boolean(G_TASK(res), error); } + + +/** + * gvir_domain_get_has_current_snapshot: + * @dom: a #GVirDomain + * @flags: Unused, pass 0 + * @has_current_snapshot: (out): Will be set to %TRUE if the given domain + * has a current snapshot and to %FALSE otherwise. + * @error: (allow-none): Place-holder for error or %NULL + * + * Returns: %TRUE on success, %FALSE otherwise. + */ +gboolean gvir_domain_get_has_current_snapshot(GVirDomain *dom, + guint flags, + gboolean *has_current_snapshot, + GError **error) { + int status; + g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE); + g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
We could also have a g_return_if_fail(has_current_snapshot != NULL); ACK! Christophe

Series looks good to me apart from that naming comment in 4/4. If someone does not like the use of gboolean *is_current as a return value in gboolean gvir_domain_snapshot_get_is_current(GVirDomainSnapshot *snapshot, guint flags, gboolean *is_current, GError **error) { now would be a good time to complain ;) Christophe On Thu, Aug 07, 2014 at 12:20:13PM +0200, Timm Bäder wrote:
Add a way to determine if the given GVirDomainSnapshot is the current snapshot of its GVirDomain. --- libvirt-gobject/libvirt-gobject-domain-snapshot.c | 33 +++++++++++++++++++++++ libvirt-gobject/libvirt-gobject-domain-snapshot.h | 4 +++ libvirt-gobject/libvirt-gobject.sym | 1 + 3 files changed, 38 insertions(+)
diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.c b/libvirt-gobject/libvirt-gobject-domain-snapshot.c index 7bb89f1..c53e877 100644 --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.c +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.c @@ -235,3 +235,36 @@ gboolean gvir_domain_snapshot_delete (GVirDomainSnapshot *snapshot, } return TRUE; } + + +/** + * gvir_domain_snapshot_get_is_current: + * @snapshot: The domain snapshot + * @flags: Currently unused, pass 0 + * @is_current: (out): %TRUE if the given snapshot is the current snapshot + * of its domain, %FALSE otherwise. + * @error: (allow-none): Place-holder for error or %NULL + * + * Returns: %TRUE on success, %FALSE otherwise. + */ +gboolean gvir_domain_snapshot_get_is_current(GVirDomainSnapshot *snapshot, + guint flags, + gboolean *is_current, + GError **error) { + gint status; + + g_return_val_if_fail(GVIR_IS_DOMAIN_SNAPSHOT(snapshot), FALSE); + g_return_val_if_fail(error == NULL || *error == NULL, FALSE); + + status = virDomainSnapshotIsCurrent(snapshot->priv->handle, flags); + if (status == -1) { + gvir_set_error(error, GVIR_DOMAIN_SNAPSHOT_ERROR, 0, + "Could not determine if `%s' is the current snapshot", + gvir_domain_snapshot_get_name(snapshot)); + return FALSE; + } + + *is_current = status; + + return TRUE; +} diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.h b/libvirt-gobject/libvirt-gobject-domain-snapshot.h index b3ebe7f..0a0bb96 100644 --- a/libvirt-gobject/libvirt-gobject-domain-snapshot.h +++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.h @@ -85,6 +85,10 @@ gboolean gvir_domain_snapshot_delete (GVirDomainSnapshot *snapshot, guint flags, GError **error);
+gboolean gvir_domain_snapshot_get_is_current(GVirDomainSnapshot *snapshot, + guint flags, + gboolean *is_current, + GError **error); G_END_DECLS
#endif /* __LIBVIRT_GOBJECT_DOMAIN_SNAPSHOT_H__ */ diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym index b0c55b5..c740f88 100644 --- a/libvirt-gobject/libvirt-gobject.sym +++ b/libvirt-gobject/libvirt-gobject.sym @@ -242,6 +242,7 @@ LIBVIRT_GOBJECT_0.1.9 { gvir_domain_get_snapshots; gvir_domain_snapshot_delete; gvir_domain_snapshot_delete_flags_get_type; + gvir_domain_snapshot_get_is_current; gvir_domain_snapshot_list_flags_get_type; gvir_storage_pool_state_get_type; gvir_storage_vol_resize_flags_get_type; -- 2.0.4
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Thu, Aug 7, 2014 at 12:05 PM, Christophe Fergeau <cfergeau@redhat.com> wrote:
Series looks good to me apart from that naming comment in 4/4. If someone does not like the use of gboolean *is_current as a return value in gboolean gvir_domain_snapshot_get_is_current(GVirDomainSnapshot *snapshot, guint flags, gboolean *is_current, GError **error) {
now would be a good time to complain ;)
None from me at least but I only just realized now that its not really a simple getter (with out param and error) so I take back my suggestion to have "_get_" in the name. I don't mind it being there though so I'll let Christophe decide. :) -- Regards, Zeeshan Ali (Khattak) ________________________________________ Befriend GNOME: http://www.gnome.org/friends/
participants (3)
-
Christophe Fergeau
-
Timm Bäder
-
Zeeshan Ali (Khattak)