[libvirt] [libvirt-glib 1/3] Tell CC to ignore unused macros

From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org> --- m4/virt-compile-warnings.m4 | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 index 6659568..de542cc 100644 --- a/m4/virt-compile-warnings.m4 +++ b/m4/virt-compile-warnings.m4 @@ -39,6 +39,8 @@ AC_DEFUN([LIBVIRT_GLIB_COMPILE_WARNINGS],[ dontwarn="$dontwarn -Wdeclaration-after-statement" # Using long long is fine dontwarn="$dontwarn -Wlong-long" + # Unused macros are ok + dontwarn="$dontwarn -Wunused-macros" # g_clear_object & G_ATOMIC_OP_USE_GCC_BUILTINS causes -- 1.7.7.6

From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org> A saved domain is stopped/shutdown on a successful save operation, not suspended. --- libvirt-gobject/libvirt-gobject-domain.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c index d9e4c00..3eb5942 100644 --- a/libvirt-gobject/libvirt-gobject-domain.c +++ b/libvirt-gobject/libvirt-gobject-domain.c @@ -731,15 +731,15 @@ cleanup: /** * gvir_domain_save: - * @dom: the domain to save and suspend + * @dom: the domain to save * @flags: extra flags, currently unused * @err: Place-holder for possible errors * - * Just like #gvir_domain_suspend but also saves the state of the domain on disk - * and therefore makes it possible to restore the domain to its previous state + * Saves the state of the domain on disk and stops it. Use #gvir_domain_resume + * to restore the saved state of the domain. A saved domain can be restored * even after shutdown/reboot of host machine. * - * Returns: TRUE if domain was saved and suspended successfully, FALSE otherwise. + * Returns: TRUE if domain was saved successfully, FALSE otherwise. */ gboolean gvir_domain_save (GVirDomain *dom, unsigned int flags, @@ -750,7 +750,7 @@ gboolean gvir_domain_save (GVirDomain *dom, if (virDomainManagedSave(dom->priv->handle, flags) < 0) { gvir_set_error_literal(err, GVIR_DOMAIN_ERROR, 0, - "Unable to save and suspend domain"); + "Unable to save domain"); return FALSE; } @@ -783,7 +783,7 @@ gvir_domain_save_helper(GSimpleAsyncResult *res, /** * gir_domain_save_async: - * @dom: the domain to save and suspend + * @dom: the domain to save * @flags: extra flags, currently unused * @cancellable: (allow-none)(transfer none): cancellation object * @callback: (scope async): completion callback @@ -819,13 +819,13 @@ void gvir_domain_save_async (GVirDomain *dom, /** * gir_domain_save_finish: - * @dom: the domain to save and suspend + * @dom: the domain to save * @result: (transfer none): async method result * @err: Place-holder for possible errors * * Finishes the operation started by #gvir_domain_save_async. * - * Returns: TRUE if domain was saved and suspended successfully, FALSE otherwise. + * Returns: TRUE if domain was saved successfully, FALSE otherwise. */ gboolean gvir_domain_save_finish (GVirDomain *dom, GAsyncResult *result, -- 1.7.7.6

On Thu, Feb 16, 2012 at 05:49:47PM +0200, Zeeshan Ali (Khattak) wrote:
From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org>
A saved domain is stopped/shutdown on a successful save operation, not suspended. --- libvirt-gobject/libvirt-gobject-domain.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c index d9e4c00..3eb5942 100644 --- a/libvirt-gobject/libvirt-gobject-domain.c +++ b/libvirt-gobject/libvirt-gobject-domain.c @@ -731,15 +731,15 @@ cleanup:
/** * gvir_domain_save: - * @dom: the domain to save and suspend + * @dom: the domain to save * @flags: extra flags, currently unused * @err: Place-holder for possible errors * - * Just like #gvir_domain_suspend but also saves the state of the domain on disk - * and therefore makes it possible to restore the domain to its previous state + * Saves the state of the domain on disk and stops it. Use #gvir_domain_resume + * to restore the saved state of the domain. A saved domain can be restored * even after shutdown/reboot of host machine. * - * Returns: TRUE if domain was saved and suspended successfully, FALSE otherwise. + * Returns: TRUE if domain was saved successfully, FALSE otherwise. */ gboolean gvir_domain_save (GVirDomain *dom, unsigned int flags, @@ -750,7 +750,7 @@ gboolean gvir_domain_save (GVirDomain *dom, if (virDomainManagedSave(dom->priv->handle, flags) < 0) { gvir_set_error_literal(err, GVIR_DOMAIN_ERROR, 0, - "Unable to save and suspend domain"); + "Unable to save domain"); return FALSE; }
@@ -783,7 +783,7 @@ gvir_domain_save_helper(GSimpleAsyncResult *res,
/** * gir_domain_save_async: - * @dom: the domain to save and suspend + * @dom: the domain to save * @flags: extra flags, currently unused * @cancellable: (allow-none)(transfer none): cancellation object * @callback: (scope async): completion callback @@ -819,13 +819,13 @@ void gvir_domain_save_async (GVirDomain *dom,
/** * gir_domain_save_finish: - * @dom: the domain to save and suspend + * @dom: the domain to save * @result: (transfer none): async method result * @err: Place-holder for possible errors * * Finishes the operation started by #gvir_domain_save_async. * - * Returns: TRUE if domain was saved and suspended successfully, FALSE otherwise. + * Returns: TRUE if domain was saved successfully, FALSE otherwise. */ gboolean gvir_domain_save_finish (GVirDomain *dom, GAsyncResult *result,
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Feb 16, 2012 at 05:49:47PM +0200, Zeeshan Ali (Khattak) wrote:
From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org>
A saved domain is stopped/shutdown on a successful save operation, not suspended.
libvirt documentation for virDomainManagedSave says "suspend", this should be fixed there too.
--- libvirt-gobject/libvirt-gobject-domain.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c index d9e4c00..3eb5942 100644 --- a/libvirt-gobject/libvirt-gobject-domain.c +++ b/libvirt-gobject/libvirt-gobject-domain.c @@ -731,15 +731,15 @@ cleanup:
/** * gvir_domain_save: - * @dom: the domain to save and suspend + * @dom: the domain to save * @flags: extra flags, currently unused * @err: Place-holder for possible errors * - * Just like #gvir_domain_suspend but also saves the state of the domain on disk - * and therefore makes it possible to restore the domain to its previous state + * Saves the state of the domain on disk and stops it. Use #gvir_domain_resume + * to restore the saved state of the domain. A saved domain can be restored * even after shutdown/reboot of host machine. * - * Returns: TRUE if domain was saved and suspended successfully, FALSE otherwise. + * Returns: TRUE if domain was saved successfully, FALSE otherwise. */ gboolean gvir_domain_save (GVirDomain *dom, unsigned int flags, @@ -750,7 +750,7 @@ gboolean gvir_domain_save (GVirDomain *dom, if (virDomainManagedSave(dom->priv->handle, flags) < 0) { gvir_set_error_literal(err, GVIR_DOMAIN_ERROR, 0, - "Unable to save and suspend domain"); + "Unable to save domain"); return FALSE; }
@@ -783,7 +783,7 @@ gvir_domain_save_helper(GSimpleAsyncResult *res,
/** * gir_domain_save_async: - * @dom: the domain to save and suspend + * @dom: the domain to save * @flags: extra flags, currently unused * @cancellable: (allow-none)(transfer none): cancellation object * @callback: (scope async): completion callback @@ -819,13 +819,13 @@ void gvir_domain_save_async (GVirDomain *dom,
/** * gir_domain_save_finish: - * @dom: the domain to save and suspend + * @dom: the domain to save * @result: (transfer none): async method result * @err: Place-holder for possible errors * * Finishes the operation started by #gvir_domain_save_async. * - * Returns: TRUE if domain was saved and suspended successfully, FALSE otherwise. + * Returns: TRUE if domain was saved successfully, FALSE otherwise. */ gboolean gvir_domain_save_finish (GVirDomain *dom, GAsyncResult *result, -- 1.7.7.6
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org> Binding for virDomainHasManagedSaveImage(). --- libvirt-gobject/libvirt-gobject-domain.c | 14 ++++++++++++++ libvirt-gobject/libvirt-gobject-domain.h | 1 + libvirt-gobject/libvirt-gobject.sym | 1 + 3 files changed, 16 insertions(+), 0 deletions(-) diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c index 3eb5942..0cbb0fe 100644 --- a/libvirt-gobject/libvirt-gobject-domain.c +++ b/libvirt-gobject/libvirt-gobject-domain.c @@ -854,3 +854,17 @@ gboolean gvir_domain_get_persistent(GVirDomain *dom) return virDomainIsPersistent(dom->priv->handle) == 1; } + +/** + * gvir_domain_get_saved: + * @dom: the domain + * + * Returns: TRUE if a stopped domain has a saved state to which it can be + * restored to using #gvir_domain_resume, FALSE otherwise. + */ +gboolean gvir_domain_get_saved(GVirDomain *dom) +{ + g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE); + + return virDomainHasManagedSaveImage(dom->priv->handle, 0) == 1; +} diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h index 20388f2..bdff32e 100644 --- a/libvirt-gobject/libvirt-gobject-domain.h +++ b/libvirt-gobject/libvirt-gobject-domain.h @@ -167,6 +167,7 @@ gboolean gvir_domain_save_finish (GVirDomain *dom, GAsyncResult *result, GError **err); gboolean gvir_domain_get_persistent(GVirDomain *dom); +gboolean gvir_domain_get_saved(GVirDomain *dom); G_END_DECLS diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym index 468bf65..7a2f65d 100644 --- a/libvirt-gobject/libvirt-gobject.sym +++ b/libvirt-gobject/libvirt-gobject.sym @@ -64,6 +64,7 @@ LIBVIRT_GOBJECT_0.0.4 { gvir_domain_set_config; gvir_domain_get_info; gvir_domain_get_persistent; + gvir_domain_get_saved; gvir_domain_screenshot; gvir_domain_snapshot_get_type; -- 1.7.7.6

On Thu, Feb 16, 2012 at 05:49:48PM +0200, Zeeshan Ali (Khattak) wrote:
From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org>
Binding for virDomainHasManagedSaveImage(). --- libvirt-gobject/libvirt-gobject-domain.c | 14 ++++++++++++++ libvirt-gobject/libvirt-gobject-domain.h | 1 + libvirt-gobject/libvirt-gobject.sym | 1 + 3 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c index 3eb5942..0cbb0fe 100644 --- a/libvirt-gobject/libvirt-gobject-domain.c +++ b/libvirt-gobject/libvirt-gobject-domain.c @@ -854,3 +854,17 @@ gboolean gvir_domain_get_persistent(GVirDomain *dom)
return virDomainIsPersistent(dom->priv->handle) == 1; } + +/** + * gvir_domain_get_saved: + * @dom: the domain + * + * Returns: TRUE if a stopped domain has a saved state to which it can be + * restored to using #gvir_domain_resume, FALSE otherwise. + */ +gboolean gvir_domain_get_saved(GVirDomain *dom) +{ + g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE); + + return virDomainHasManagedSaveImage(dom->priv->handle, 0) == 1; +} diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h index 20388f2..bdff32e 100644 --- a/libvirt-gobject/libvirt-gobject-domain.h +++ b/libvirt-gobject/libvirt-gobject-domain.h @@ -167,6 +167,7 @@ gboolean gvir_domain_save_finish (GVirDomain *dom, GAsyncResult *result, GError **err); gboolean gvir_domain_get_persistent(GVirDomain *dom); +gboolean gvir_domain_get_saved(GVirDomain *dom);
G_END_DECLS
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym index 468bf65..7a2f65d 100644 --- a/libvirt-gobject/libvirt-gobject.sym +++ b/libvirt-gobject/libvirt-gobject.sym @@ -64,6 +64,7 @@ LIBVIRT_GOBJECT_0.0.4 { gvir_domain_set_config; gvir_domain_get_info; gvir_domain_get_persistent; + gvir_domain_get_saved; gvir_domain_screenshot;
gvir_domain_snapshot_get_type;
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Feb 16, 2012 at 05:49:46PM +0200, Zeeshan Ali (Khattak) wrote:
From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org>
--- m4/virt-compile-warnings.m4 | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 index 6659568..de542cc 100644 --- a/m4/virt-compile-warnings.m4 +++ b/m4/virt-compile-warnings.m4 @@ -39,6 +39,8 @@ AC_DEFUN([LIBVIRT_GLIB_COMPILE_WARNINGS],[ dontwarn="$dontwarn -Wdeclaration-after-statement" # Using long long is fine dontwarn="$dontwarn -Wlong-long" + # Unused macros are ok + dontwarn="$dontwarn -Wunused-macros"
ACK Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (3)
-
Christophe Fergeau
-
Daniel P. Berrange
-
Zeeshan Ali (Khattak)