Patchwork [1/2] qemu-ga: generate missing stubs for fsfreeze

login
register
mail settings
Submitter Michael Roth
Date April 17, 2012, 5:07 p.m.
Message ID <1334682459-27835-1-git-send-email-mdroth@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/153256/
State New
Headers show

Comments

Michael Roth - April 17, 2012, 5:07 p.m.
When linux-specific commands (including guest-fsfreeze-*) were consolidated
under defined(__linux__), we forgot to account for the case where
defined(__linux__) && !defined(FIFREEZE). As a result stubs are no longer
being generated on linux hosts that don't have FIFREEZE support. Fix
this.

Tested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands-posix.c |   36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)
Luiz Capitulino - April 17, 2012, 5:35 p.m.
On Tue, 17 Apr 2012 12:07:38 -0500
Michael Roth <mdroth@linux.vnet.ibm.com> wrote:

> When linux-specific commands (including guest-fsfreeze-*) were consolidated
> under defined(__linux__), we forgot to account for the case where
> defined(__linux__) && !defined(FIFREEZE). As a result stubs are no longer
> being generated on linux hosts that don't have FIFREEZE support. Fix
> this.
> 
> Tested-by: Andreas Färber <afaerber@suse.de>
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>

Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>

> ---
>  qga/commands-posix.c |   36 ++++++++++++++++++++----------------
>  1 files changed, 20 insertions(+), 16 deletions(-)
> 
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index faf970d..087c3af 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -881,46 +881,50 @@ error:
>  
>  #else /* defined(__linux__) */
>  
> -GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
> +void qmp_guest_suspend_disk(Error **err)
>  {
>      error_set(err, QERR_UNSUPPORTED);
> -
> -    return 0;
>  }
>  
> -int64_t qmp_guest_fsfreeze_freeze(Error **err)
> +void qmp_guest_suspend_ram(Error **err)
>  {
>      error_set(err, QERR_UNSUPPORTED);
> -
> -    return 0;
>  }
>  
> -int64_t qmp_guest_fsfreeze_thaw(Error **err)
> +void qmp_guest_suspend_hybrid(Error **err)
>  {
>      error_set(err, QERR_UNSUPPORTED);
> -
> -    return 0;
>  }
>  
> -void qmp_guest_suspend_disk(Error **err)
> +GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp)
>  {
> -    error_set(err, QERR_UNSUPPORTED);
> +    error_set(errp, QERR_UNSUPPORTED);
> +    return NULL;
>  }
>  
> -void qmp_guest_suspend_ram(Error **err)
> +#endif
> +
> +#if !defined(CONFIG_FSFREEZE)
> +
> +GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
>  {
>      error_set(err, QERR_UNSUPPORTED);
> +
> +    return 0;
>  }
>  
> -void qmp_guest_suspend_hybrid(Error **err)
> +int64_t qmp_guest_fsfreeze_freeze(Error **err)
>  {
>      error_set(err, QERR_UNSUPPORTED);
> +
> +    return 0;
>  }
>  
> -GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp)
> +int64_t qmp_guest_fsfreeze_thaw(Error **err)
>  {
> -    error_set(errp, QERR_UNSUPPORTED);
> -    return NULL;
> +    error_set(err, QERR_UNSUPPORTED);
> +
> +    return 0;
>  }
>  
>  #endif
Michael Roth - April 19, 2012, 3:49 p.m.
On Tue, Apr 17, 2012 at 12:07:38PM -0500, Michael Roth wrote:
> When linux-specific commands (including guest-fsfreeze-*) were consolidated
> under defined(__linux__), we forgot to account for the case where
> defined(__linux__) && !defined(FIFREEZE). As a result stubs are no longer
> being generated on linux hosts that don't have FIFREEZE support. Fix
> this.
> 
> Tested-by: Andreas Färber <afaerber@suse.de>
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>

Hi Stefan,

Please ignore these for trivial, gonna submit a qemu-ga pull for these since
a build fix is involved.

> ---
>  qga/commands-posix.c |   36 ++++++++++++++++++++----------------
>  1 files changed, 20 insertions(+), 16 deletions(-)
> 
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index faf970d..087c3af 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -881,46 +881,50 @@ error:
>  
>  #else /* defined(__linux__) */
>  
> -GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
> +void qmp_guest_suspend_disk(Error **err)
>  {
>      error_set(err, QERR_UNSUPPORTED);
> -
> -    return 0;
>  }
>  
> -int64_t qmp_guest_fsfreeze_freeze(Error **err)
> +void qmp_guest_suspend_ram(Error **err)
>  {
>      error_set(err, QERR_UNSUPPORTED);
> -
> -    return 0;
>  }
>  
> -int64_t qmp_guest_fsfreeze_thaw(Error **err)
> +void qmp_guest_suspend_hybrid(Error **err)
>  {
>      error_set(err, QERR_UNSUPPORTED);
> -
> -    return 0;
>  }
>  
> -void qmp_guest_suspend_disk(Error **err)
> +GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp)
>  {
> -    error_set(err, QERR_UNSUPPORTED);
> +    error_set(errp, QERR_UNSUPPORTED);
> +    return NULL;
>  }
>  
> -void qmp_guest_suspend_ram(Error **err)
> +#endif
> +
> +#if !defined(CONFIG_FSFREEZE)
> +
> +GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
>  {
>      error_set(err, QERR_UNSUPPORTED);
> +
> +    return 0;
>  }
>  
> -void qmp_guest_suspend_hybrid(Error **err)
> +int64_t qmp_guest_fsfreeze_freeze(Error **err)
>  {
>      error_set(err, QERR_UNSUPPORTED);
> +
> +    return 0;
>  }
>  
> -GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp)
> +int64_t qmp_guest_fsfreeze_thaw(Error **err)
>  {
> -    error_set(errp, QERR_UNSUPPORTED);
> -    return NULL;
> +    error_set(err, QERR_UNSUPPORTED);
> +
> +    return 0;
>  }
>  
>  #endif
> -- 
> 1.7.4.1
>
Stefan Hajnoczi - April 20, 2012, 12:02 p.m.
On Thu, Apr 19, 2012 at 10:49:16AM -0500, Michael Roth wrote:
> On Tue, Apr 17, 2012 at 12:07:38PM -0500, Michael Roth wrote:
> > When linux-specific commands (including guest-fsfreeze-*) were consolidated
> > under defined(__linux__), we forgot to account for the case where
> > defined(__linux__) && !defined(FIFREEZE). As a result stubs are no longer
> > being generated on linux hosts that don't have FIFREEZE support. Fix
> > this.
> > 
> > Tested-by: Andreas Färber <afaerber@suse.de>
> > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> 
> Hi Stefan,
> 
> Please ignore these for trivial, gonna submit a qemu-ga pull for these since
> a build fix is involved.

Sure.

Stefan

Patch

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index faf970d..087c3af 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -881,46 +881,50 @@  error:
 
 #else /* defined(__linux__) */
 
-GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
+void qmp_guest_suspend_disk(Error **err)
 {
     error_set(err, QERR_UNSUPPORTED);
-
-    return 0;
 }
 
-int64_t qmp_guest_fsfreeze_freeze(Error **err)
+void qmp_guest_suspend_ram(Error **err)
 {
     error_set(err, QERR_UNSUPPORTED);
-
-    return 0;
 }
 
-int64_t qmp_guest_fsfreeze_thaw(Error **err)
+void qmp_guest_suspend_hybrid(Error **err)
 {
     error_set(err, QERR_UNSUPPORTED);
-
-    return 0;
 }
 
-void qmp_guest_suspend_disk(Error **err)
+GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp)
 {
-    error_set(err, QERR_UNSUPPORTED);
+    error_set(errp, QERR_UNSUPPORTED);
+    return NULL;
 }
 
-void qmp_guest_suspend_ram(Error **err)
+#endif
+
+#if !defined(CONFIG_FSFREEZE)
+
+GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **err)
 {
     error_set(err, QERR_UNSUPPORTED);
+
+    return 0;
 }
 
-void qmp_guest_suspend_hybrid(Error **err)
+int64_t qmp_guest_fsfreeze_freeze(Error **err)
 {
     error_set(err, QERR_UNSUPPORTED);
+
+    return 0;
 }
 
-GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp)
+int64_t qmp_guest_fsfreeze_thaw(Error **err)
 {
-    error_set(errp, QERR_UNSUPPORTED);
-    return NULL;
+    error_set(err, QERR_UNSUPPORTED);
+
+    return 0;
 }
 
 #endif