diff mbox

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

Message ID 1334851513-11988-2-git-send-email-mdroth@linux.vnet.ibm.com
State New
Headers show

Commit Message

Michael Roth April 19, 2012, 4:05 p.m. UTC
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>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qga/commands-posix.c |   36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)

Comments

Richard Henderson April 19, 2012, 4:56 p.m. UTC | #1
On 04/19/2012 11:05 AM, 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>
> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> ---
>  qga/commands-posix.c |   36 ++++++++++++++++++++----------------
>  1 files changed, 20 insertions(+), 16 deletions(-)

I know it moves more code around, but I think un-nesting CONFIG_FSFREEZE
from within __linux__ is more logically correct.


r~
Michael Roth April 19, 2012, 5:16 p.m. UTC | #2
On Thu, Apr 19, 2012 at 11:56:28AM -0500, Richard Henderson wrote:
> On 04/19/2012 11:05 AM, 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>
> > Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
> > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> > ---
> >  qga/commands-posix.c |   36 ++++++++++++++++++++----------------
> >  1 files changed, 20 insertions(+), 16 deletions(-)
> 
> I know it moves more code around, but I think un-nesting CONFIG_FSFREEZE
> from within __linux__ is more logically correct.

Agreed, Luiz and I talked about doing this in a seperate patch. The main
ugliness is just that CONFIG_FSFREEZE is basically (__linux__ &&
FIFREEZE), so if we nest it as FIFREEZE instead of both it makes sense.
Then we generate stubs on (!__linux__ || !FIFREEZE).

But in the meantime we should apply the current patch since it's been
thoroughly tested/reviewed at this point and fixes the build issue.

> 
> 
> r~
>
diff mbox

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