diff mbox

[PULL,0/9] qemu-ga patch queue for 2.6

Message ID 20160225212725.29588.10089@loki (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Roth Feb. 25, 2016, 9:27 p.m. UTC
Quoting Peter Maydell (2016-02-25 12:18:17)
> On 25 February 2016 at 17:11, Michael Roth <mdroth@linux.vnet.ibm.com> wrote:
> > The following changes since commit 774ae4254d3910f1c94ad6ed44d14cbea0e6a2f2:
> >
> >   Merge remote-tracking branch 'remotes/bkoppelmann/tags/pull-tricore-20160225' into staging (2016-02-25 12:57:22 +0000)
> >
> > are available in the git repository at:
> >
> >
> >   git://github.com/mdroth/qemu.git tags/qga-pull-2016-02-25-tag
> >
> > for you to fetch changes up to e55eb806dbb97f53794b0c2f86983d34f6696845:
> >
> >   qga: fix w32 breakage due to missing osdep.h includes (2016-02-25 10:54:32 -0600)
> >
> > ----------------------------------------------------------------
> > qemu-ga patch queue for 2.6
> >
> > * fix w32 build breakage when VSS enabled
> > * fix up wchar handling in guest-set-user-password
> > * fix re-install handling for w32 MSI installer
> > * add w32 support for guest-get-vcpus
> > * add support for enums in guest-file-seek SEEK params
> >   instead of relying on platform-specific integer values
> 
> This doesn't seem to build on w32 (the old mingw compiler). It works
> with the newer w64-mingw32 compiler so I guess this is just a
> "disable stuff we can't support with the old headers" thing.
> 
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c: In
> function ‘qmp_guest_get_vcpus’:
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c:1226:
> error: ‘PSYSTEM_LOGICAL_PROCESSOR_INFORMATION’ undeclared (first use
> in this function)
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c:1226:
> error: (Each undeclared identifier is reported only once
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c:1226:
> error: for each function it appears in.)
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c:1226:
> error: expected ‘;’ before ‘pslpi’
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c:1232:
> error: ‘ptr’ undeclared (first use in this function)
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c:1232:
> error: ‘pslpi’ undeclared (first use in this function)
> cc1: warnings being treated as errors
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c:1238:
> warning: implicit declaration of function
> ‘GetLogicalProcessorInformation’
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c:1238:
> warning: nested extern declaration of ‘GetLogicalProcessorInformation’
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c:1240:
> error: ‘SYSTEM_LOGICAL_PROCESSOR_INFORMATION’ undeclared (first use in
> this function)
> /home/petmay01/linaro/qemu-for-merges/qga/commands-win32.c:1253:
> error: ‘RelationProcessorCore’ undeclared (first use in this function)
> make: *** [qga/commands-win32.o] Error 1
> make: *** Waiting for unfinished jobs....
> make: Leaving directory `/home/petmay01/linaro/qemu-for-merges/build/w32'
> 
> I'm open to the idea of dropping old-mingw from the build rotation
> if it looks like it really is just totally hopeless, since I have
> a newer setup for it now.

I wouldn't want to speak for dropping old mingw checks in general (cc'ing
Stefan), but for qemu-ga I think it makes sense. VSS/fsfreeze also
relies on mingw-w64 so it's really the only build system I use for
testing functionality.

If we do want to keep supporting the old mingw in general,
--disable-guest-agent should do the trick, but a probe is probably
best to simply not enable qemu-ga automatically in such cases...

According to:

https://sourceforge.net/p/mingw-w64/wiki2/Answer%20Check%20For%20Mingw-w64/

The below patch should handle this automatically. Should I send a v2
with it included, or would a follow-up be preferable?

Author: Michael Roth <mdroth@linux.vnet.ibm.com>
Date:   Thu Feb 25 15:11:04 2016 -0600

    configure: add mingw-w64 probe and make it a prereq for qga
    
    qemu-ga relies on a number of features now (VSS/fsfreeze,
    drive info, online/offline processor info) that are only
    implemented in the mingw-w64 alternative to mingw, and that
    featureset is expected to increase. Since a number of these
    features are fairly standard functionality expected of the
    guest agent, go ahead and make mingw-w64 a hard dependency.
    
    On MinGW builds, if qemu-ga isn't explicitly enabled, it will
    now just silently not build. Otherwise it will complain as needed.
    
    Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>



> 
> thanks > -- PMM
>

Comments

Stefan Weil Feb. 26, 2016, 5:44 a.m. UTC | #1
Am 25.02.2016 um 22:27 schrieb Michael Roth:
> Quoting Peter Maydell (2016-02-25 12:18:17)
[...]
>> I'm open to the idea of dropping old-mingw from the build rotation
>> if it looks like it really is just totally hopeless, since I have
>> a newer setup for it now.
> 
> I wouldn't want to speak for dropping old mingw checks in general (cc'ing
> Stefan), but for qemu-ga I think it makes sense. VSS/fsfreeze also
> relies on mingw-w64 so it's really the only build system I use for
> testing functionality.

I cannot remember the last time when I used MinGW and don't think
that it would produce a working program (wasn't there missing support
for thread local storage?). Current Linux distributions include
support for mingw-w64 cross compilations, but not for MinGW.
And finally MinGW only supports 32 bit Windows which looses
importance nowadays.

Therefore dropping MinGW support and only supporting mingw-w64 would
be fine for me.

Regards,
Stefan
Peter Maydell Feb. 26, 2016, 11:39 a.m. UTC | #2
On 26 February 2016 at 05:44, Stefan Weil <sw@weilnetz.de> wrote:
> Am 25.02.2016 um 22:27 schrieb Michael Roth:
>> Quoting Peter Maydell (2016-02-25 12:18:17)
> [...]
>>> I'm open to the idea of dropping old-mingw from the build rotation
>>> if it looks like it really is just totally hopeless, since I have
>>> a newer setup for it now.
>>
>> I wouldn't want to speak for dropping old mingw checks in general (cc'ing
>> Stefan), but for qemu-ga I think it makes sense. VSS/fsfreeze also
>> relies on mingw-w64 so it's really the only build system I use for
>> testing functionality.
>
> I cannot remember the last time when I used MinGW and don't think
> that it would produce a working program (wasn't there missing support
> for thread local storage?). Current Linux distributions include
> support for mingw-w64 cross compilations, but not for MinGW.
> And finally MinGW only supports 32 bit Windows which looses
> importance nowadays.
>
> Therefore dropping MinGW support and only supporting mingw-w64 would
> be fine for me.

OK, I have dropped my ancient mingw w32 setup from the compile
testing list, so this pull req is ok to apply as-is.

(This will also mean we no longer get annoying "failed to build"
issues for other gcc-4.2-isms like duplicate typedefs, missing
U or ULL suffixes, etc. Which is good I guess :-))

thanks
-- PMM
Peter Maydell Feb. 26, 2016, 11:40 a.m. UTC | #3
On 26 February 2016 at 11:39, Peter Maydell <peter.maydell@linaro.org> wrote:
> OK, I have dropped my ancient mingw w32 setup from the compile
> testing list, so this pull req is ok to apply as-is.

...and I have done so, which I meant to say.

thanks
-- PMM
diff mbox

Patch

diff --git a/configure b/configure
index 0c0472a..f4f1dc1 100755
--- a/configure
+++ b/configure
@@ -238,6 +238,7 @@  strip_opt="yes"
 tcg_interpreter="no"
 bigendian="no"
 mingw32="no"
+mingw_w64="no"
 gcov="no"
 gcov_tool="gcov"
 EXESUF=""
@@ -712,6 +713,18 @@  if test "$mingw32" = "yes" ; then
   local_statedir=
   confsuffix=""
   libs_qga="-lws2_32 -lwinmm -lpowrprof -liphlpapi -lnetapi32 $libs_qga"
+  cat > $TMPC << EOF
+#include <_mingw.h>
+#if !defined(__MINGW64_VERSION_MAJOR)
+#error
+#endif
+int main(void) { return 0; }
+EOF
+  # not to be confused with a check for 64-bit, this is testing specifically
+  # for mingw-w64 compiler, which has a larger featureset than standard mingw
+  if compile_prog "" "" ; then
+    mingw_w64=yes
+  fi
 fi
 
 werror=""
@@ -4529,12 +4542,17 @@  fi
 # Probe for guest agent support/options
 
 if [ "$guest_agent" != "no" ]; then
-  if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then
+  if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw_w64" = "yes" ] ; then
       tools="qemu-ga $tools"
       guest_agent=yes
   elif [ "$guest_agent" != yes ]; then
       guest_agent=no
   else
+      # if theydoing a mingw check passed but not mingw_w64, inform them of what's missing to avoid
+      # confusion about actual dependencies
+      if [ "$mingw32" = "yes" ]; then
+          error_exit "Guest agent requires mingw-w64 (32 or 64-bit) for win32 builds, but only mingw detected."
+      fi
       error_exit "Guest agent is not supported on this platform"
   fi
 fi