* [Qemu-devel] [PATCH] qga: fix w32 breakage due to missing osdep.h includes
@ 2016-02-25 1:01 Michael Roth
2016-02-25 1:13 ` Eric Blake
2016-02-25 17:02 ` Michael Roth
0 siblings, 2 replies; 3+ messages in thread
From: Michael Roth @ 2016-02-25 1:01 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Michael Roth
requester.h relied on qemu/compiler.h definitions to
handle GCC_FMT_ATTR() stub, but this include was removed as part
of scripted clean-ups via 30456d5:
all: Clean up includes
under the assumption that all C files would have included it via
qemu/osdep.h at that point. requester.cpp was likely missed
due to C++ files requiring manual/special handling as well as
VSS build options needing to be enabled to trigger build failures.
Fix this by including qemu/osdep.h. That in turn pulls in a
macro from qapi/error.h that conflicts with a struct field name
in requester.h, so fix that as well by renaming the field.
While we're at it, fix up provider.cpp/install.cpp to include
osdep.h as well.
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
qga/vss-win32.c | 2 +-
qga/vss-win32/install.cpp | 3 +--
qga/vss-win32/provider.cpp | 2 +-
qga/vss-win32/requester.cpp | 8 ++++----
qga/vss-win32/requester.h | 2 +-
5 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/qga/vss-win32.c b/qga/vss-win32.c
index 5182e3b..9a0e463 100644
--- a/qga/vss-win32.c
+++ b/qga/vss-win32.c
@@ -150,7 +150,7 @@ void qga_vss_fsfreeze(int *nr_volume, Error **errp, bool freeze)
const char *func_name = freeze ? "requester_freeze" : "requester_thaw";
QGAVSSRequesterFunc func;
ErrorSet errset = {
- .error_setg_win32 = error_setg_win32_internal,
+ .error_setg_win32_wrapper = error_setg_win32_internal,
.errp = errp,
};
diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index b0e4426..cd9cdb4 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -10,8 +10,7 @@
* See the COPYING file in the top-level directory.
*/
-#include <stdio.h>
-#include <string.h>
+#include "qemu/osdep.h"
#include "vss-common.h"
#include "inc/win2003/vscoordint.h"
diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp
index d5129f8..d977393 100644
--- a/qga/vss-win32/provider.cpp
+++ b/qga/vss-win32/provider.cpp
@@ -10,7 +10,7 @@
* See the COPYING file in the top-level directory.
*/
-#include <stdio.h>
+#include "qemu/osdep.h"
#include "vss-common.h"
#include "inc/win2003/vscoordint.h"
#include "inc/win2003/vsprov.h"
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index 9b3e310..b57d517 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -10,7 +10,7 @@
* See the COPYING file in the top-level directory.
*/
-#include <stdio.h>
+#include "qemu/osdep.h"
#include "vss-common.h"
#include "requester.h"
#include "assert.h"
@@ -23,9 +23,9 @@
/* Call QueryStatus every 10 ms while waiting for frozen event */
#define VSS_TIMEOUT_EVENT_MSEC 10
-#define err_set(e, err, fmt, ...) \
- ((e)->error_setg_win32((e)->errp, __FILE__, __LINE__, __func__, \
- err, fmt, ## __VA_ARGS__))
+#define err_set(e, err, fmt, ...) \
+ ((e)->error_setg_win32_wrapper((e)->errp, __FILE__, __LINE__, __func__, \
+ err, fmt, ## __VA_ARGS__))
/* Bad idea, works only when (e)->errp != NULL: */
#define err_is_set(e) ((e)->errp && *(e)->errp)
/* To lift this restriction, error_propagate(), like we do in QEMU code */
diff --git a/qga/vss-win32/requester.h b/qga/vss-win32/requester.h
index ad2bf3d..2a39d73 100644
--- a/qga/vss-win32/requester.h
+++ b/qga/vss-win32/requester.h
@@ -27,7 +27,7 @@ typedef void (*ErrorSetFunc)(struct Error **errp,
int win32_err, const char *fmt, ...)
GCC_FMT_ATTR(6, 7);
typedef struct ErrorSet {
- ErrorSetFunc error_setg_win32;
+ ErrorSetFunc error_setg_win32_wrapper;
struct Error **errp; /* restriction: must not be null */
} ErrorSet;
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] qga: fix w32 breakage due to missing osdep.h includes
2016-02-25 1:01 [Qemu-devel] [PATCH] qga: fix w32 breakage due to missing osdep.h includes Michael Roth
@ 2016-02-25 1:13 ` Eric Blake
2016-02-25 17:02 ` Michael Roth
1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2016-02-25 1:13 UTC (permalink / raw)
To: Michael Roth, qemu-devel; +Cc: Peter Maydell
[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]
On 02/24/2016 06:01 PM, Michael Roth wrote:
> requester.h relied on qemu/compiler.h definitions to
> handle GCC_FMT_ATTR() stub, but this include was removed as part
> of scripted clean-ups via 30456d5:
>
> all: Clean up includes
>
> under the assumption that all C files would have included it via
> qemu/osdep.h at that point. requester.cpp was likely missed
> due to C++ files requiring manual/special handling as well as
> VSS build options needing to be enabled to trigger build failures.
>
> Fix this by including qemu/osdep.h. That in turn pulls in a
> macro from qapi/error.h that conflicts with a struct field name
> in requester.h, so fix that as well by renaming the field.
>
> While we're at it, fix up provider.cpp/install.cpp to include
> osdep.h as well.
>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> ---
Reviewed-by: Eric Blake <eblake@redhat.com>
(but I'm not set up to provide Tested-by on this one)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] qga: fix w32 breakage due to missing osdep.h includes
2016-02-25 1:01 [Qemu-devel] [PATCH] qga: fix w32 breakage due to missing osdep.h includes Michael Roth
2016-02-25 1:13 ` Eric Blake
@ 2016-02-25 17:02 ` Michael Roth
1 sibling, 0 replies; 3+ messages in thread
From: Michael Roth @ 2016-02-25 17:02 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell
Quoting Michael Roth (2016-02-24 19:01:09)
> requester.h relied on qemu/compiler.h definitions to
> handle GCC_FMT_ATTR() stub, but this include was removed as part
> of scripted clean-ups via 30456d5:
>
> all: Clean up includes
>
> under the assumption that all C files would have included it via
> qemu/osdep.h at that point. requester.cpp was likely missed
> due to C++ files requiring manual/special handling as well as
> VSS build options needing to be enabled to trigger build failures.
>
> Fix this by including qemu/osdep.h. That in turn pulls in a
> macro from qapi/error.h that conflicts with a struct field name
> in requester.h, so fix that as well by renaming the field.
>
> While we're at it, fix up provider.cpp/install.cpp to include
> osdep.h as well.
>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Thanks, applied to qga tree:
https://github.com/mdroth/qemu/commits/qga
> ---
> qga/vss-win32.c | 2 +-
> qga/vss-win32/install.cpp | 3 +--
> qga/vss-win32/provider.cpp | 2 +-
> qga/vss-win32/requester.cpp | 8 ++++----
> qga/vss-win32/requester.h | 2 +-
> 5 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/qga/vss-win32.c b/qga/vss-win32.c
> index 5182e3b..9a0e463 100644
> --- a/qga/vss-win32.c
> +++ b/qga/vss-win32.c
> @@ -150,7 +150,7 @@ void qga_vss_fsfreeze(int *nr_volume, Error **errp, bool freeze)
> const char *func_name = freeze ? "requester_freeze" : "requester_thaw";
> QGAVSSRequesterFunc func;
> ErrorSet errset = {
> - .error_setg_win32 = error_setg_win32_internal,
> + .error_setg_win32_wrapper = error_setg_win32_internal,
> .errp = errp,
> };
>
> diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
> index b0e4426..cd9cdb4 100644
> --- a/qga/vss-win32/install.cpp
> +++ b/qga/vss-win32/install.cpp
> @@ -10,8 +10,7 @@
> * See the COPYING file in the top-level directory.
> */
>
> -#include <stdio.h>
> -#include <string.h>
> +#include "qemu/osdep.h"
>
> #include "vss-common.h"
> #include "inc/win2003/vscoordint.h"
> diff --git a/qga/vss-win32/provider.cpp b/qga/vss-win32/provider.cpp
> index d5129f8..d977393 100644
> --- a/qga/vss-win32/provider.cpp
> +++ b/qga/vss-win32/provider.cpp
> @@ -10,7 +10,7 @@
> * See the COPYING file in the top-level directory.
> */
>
> -#include <stdio.h>
> +#include "qemu/osdep.h"
> #include "vss-common.h"
> #include "inc/win2003/vscoordint.h"
> #include "inc/win2003/vsprov.h"
> diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
> index 9b3e310..b57d517 100644
> --- a/qga/vss-win32/requester.cpp
> +++ b/qga/vss-win32/requester.cpp
> @@ -10,7 +10,7 @@
> * See the COPYING file in the top-level directory.
> */
>
> -#include <stdio.h>
> +#include "qemu/osdep.h"
> #include "vss-common.h"
> #include "requester.h"
> #include "assert.h"
> @@ -23,9 +23,9 @@
> /* Call QueryStatus every 10 ms while waiting for frozen event */
> #define VSS_TIMEOUT_EVENT_MSEC 10
>
> -#define err_set(e, err, fmt, ...) \
> - ((e)->error_setg_win32((e)->errp, __FILE__, __LINE__, __func__, \
> - err, fmt, ## __VA_ARGS__))
> +#define err_set(e, err, fmt, ...) \
> + ((e)->error_setg_win32_wrapper((e)->errp, __FILE__, __LINE__, __func__, \
> + err, fmt, ## __VA_ARGS__))
> /* Bad idea, works only when (e)->errp != NULL: */
> #define err_is_set(e) ((e)->errp && *(e)->errp)
> /* To lift this restriction, error_propagate(), like we do in QEMU code */
> diff --git a/qga/vss-win32/requester.h b/qga/vss-win32/requester.h
> index ad2bf3d..2a39d73 100644
> --- a/qga/vss-win32/requester.h
> +++ b/qga/vss-win32/requester.h
> @@ -27,7 +27,7 @@ typedef void (*ErrorSetFunc)(struct Error **errp,
> int win32_err, const char *fmt, ...)
> GCC_FMT_ATTR(6, 7);
> typedef struct ErrorSet {
> - ErrorSetFunc error_setg_win32;
> + ErrorSetFunc error_setg_win32_wrapper;
> struct Error **errp; /* restriction: must not be null */
> } ErrorSet;
>
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-25 17:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-25 1:01 [Qemu-devel] [PATCH] qga: fix w32 breakage due to missing osdep.h includes Michael Roth
2016-02-25 1:13 ` Eric Blake
2016-02-25 17:02 ` Michael Roth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).