Skip to contentSkip to conversation

qemu-ga patch queue for 2.7

GIT PULL Applied Michael Roth 2 participants 5 messages Jul 25, 2016 – Jul 26, 2016

lore
Share & tools
lore
#0 lore raw

The following changes since commit 2d2e632ad00d11867c6c5625605b1fbc022dd62f:

Update version for v2.7.0-rc0 release (2016-07-22 15:32:42 +0100)

are available in the git repository at:

git://github.com/mdroth/qemu.git tags/qga-pull-2016-07-25-tag

for you to fetch changes up to 690604f696db6b3da35988e29da3f8d7966e12bc:

configure: mark qemu-ga VSS includes as system headers (2016-07-25 13:23:18 -0500)

----------------------------------------------------------------
qemu-ga patch queue for 2.7

* fix w32 build failures due to -Werror when building with VSS/fsfreeze enabled
* fix leaking for qemu-ga config files in make check

----------------------------------------------------------------
Marc-André Lureau (2):
build-sys: link tests/data
tests: use static qga config file

Michael Roth (1):
configure: mark qemu-ga VSS includes as system headers

 configure                  | 11 ++++++++---
 tests/data/test-qga-config |  8 ++++++++
 tests/test-qga.c           | 27 ++++-----------------------
 3 files changed, 20 insertions(+), 26 deletions(-)
 create mode 100644 tests/data/test-qga-config
#1 lore raw

[Qemu-devel] [PULL for-2.7 1/3] build-sys: link tests/data

From: Marc-André Lureau <[email protected]>

Link a common tests data directory to the build directory.

---
 configure | 5 +++++
 1 file changed, 5 insertions(+)
configure +5 -0
index 6ffa4a8..61279b0 100755
@@ -5995,6 +5995,11 @@ for rom in seabios vgabios ; do
     echo "LD=$ld" >> $config_mak
 done
 
+# set up tests data directory
+if [ ! -e tests/data ]; then
+    symlink "$source_path/tests/data" tests/data
+fi
+
 # set up qemu-iotests in this build directory
 iotests_common_env="tests/qemu-iotests/common.env"
 iotests_check="tests/qemu-iotests/check"
Signature · 1 line
1.9.1
#2 lore raw

[Qemu-devel] [PULL for-2.7 3/3] configure: mark qemu-ga VSS includes as system headers

In reply to Michael Roth

As of e4650c81, we do w32 builds with -Werror enabled. Unfortunately for cases where we enable VSS support in qemu-ga, we still have warnings generated by VSS includes that ship as part of the Microsoft VSS SDK.

We can selectively address a number of these warnings using

#pragma GCC diagnostic ignored ...

but at least one of these:

warning: ‘typedef’ was ignored in this declaration

resulting from declarations of the form:

typedef struct Blah { ... };

does not provide a specific command-line/pragma option to disable warnings of the sort.

To allow VSS builds to succeed, the next-best option is disabling these warnings on a per-file basis. pragmas like #pragma GCC system_header can be used to declare subsequent includes/declarations as being exempt from normal warnings, but this must be done within a header file.

Since we don't control the VSS SDK, we'd need to rely on a intermediate header include to accomplish this, and
since different objects in the VSS link target rely on different headers from the VSS SDK, this would become somewhat of a rat's nest (though not totally unmanageable).

The next step up in granularity is just marking the entire VSS SDK include path as system headers via -isystem. This is a bit more heavy-handed, but since this SDK hasn't changed since 2005, there's likely little to be gained from selectively disabling warnings anyway, so we implement that approach here.

This fixes the -Werror failures in both the configure test and the qga build due to shared reliance on $vss_win32_include. For the same reason, this also enforces a new dependency on -isystem support in the C/C++ compiler when building QGA with VSS enabled.

---
 configure | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
configure +3 -3
index 61279b0..879324b 100755
@@ -4051,13 +4051,13 @@ fi
 
 if test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$vss_win32_sdk" != "no" ; then
   case "$vss_win32_sdk" in
-    "")   vss_win32_include="-I$source_path" ;;
+    "")   vss_win32_include="-isystem $source_path" ;;
     *\ *) # The SDK is installed in "Program Files" by default, but we cannot
           # handle path with spaces. So we symlink the headers into ".sdk/vss".
-          vss_win32_include="-I$source_path/.sdk/vss"
+          vss_win32_include="-isystem $source_path/.sdk/vss"
 	  symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc"
 	  ;;
-    *)    vss_win32_include="-I$vss_win32_sdk"
+    *)    vss_win32_include="-isystem $vss_win32_sdk"
   esac
   cat > $TMPC << EOF
 #define __MIDL_user_allocate_free_DEFINED__
Signature · 1 line
1.9.1
#3 lore raw

[Qemu-devel] [PULL for-2.7 2/3] tests: use static qga config file

In reply to Michael Roth

From: Marc-André Lureau <[email protected]>

Do not create a leaking temporary file, but use a static file instead.

---
 tests/data/test-qga-config |  8 ++++++++
 tests/test-qga.c           | 27 ++++-----------------------
 2 files changed, 12 insertions(+), 23 deletions(-)
 create mode 100644 tests/data/test-qga-config
tests/data/test-qga-config new file +8 -0
new file mode 100644
index 0000000..4bb721a
@@ -0,0 +1,8 @@
+[general]
+daemon=false
+method=virtio-serial
+path=/path/to/org.qemu.guest_agent.0
+pidfile=/var/foo/qemu-ga.pid
+statedir=/var/state
+verbose=true
+blacklist=guest-ping;guest-get-time
tests/test-qga.c +4 -23
index 251b201..dac8fb8 100644
@@ -691,28 +691,11 @@ static void test_qga_blacklist(gconstpointer data)
 static void test_qga_config(gconstpointer data)
 {
     GError *error = NULL;
-    char *cwd, *cmd, *out, *err, *str, **strv, *conf, **argv = NULL;
+    char *cwd, *cmd, *out, *err, *str, **strv, **argv = NULL;
     char *env[2];
-    int status, tmp;
+    int status;
     gsize n;
     GKeyFile *kf;
-    const char *qga_config =
-        "[general]\n"
-        "daemon=false\n"
-        "method=virtio-serial\n"
-        "path=/path/to/org.qemu.guest_agent.0\n"
-        "pidfile=/var/foo/qemu-ga.pid\n"
-        "statedir=/var/state\n"
-        "verbose=true\n"
-        "blacklist=guest-ping;guest-get-time\n";
-
-    tmp = g_file_open_tmp(NULL, &conf, &error);
-    g_assert_no_error(error);
-    g_assert_cmpint(tmp, >=, 0);
-    g_assert_cmpstr(conf, !=, "");
-
-    g_file_set_contents(conf, qga_config, -1, &error);
-    g_assert_no_error(error);
 
     cwd = g_get_current_dir();
     cmd = g_strdup_printf("%s%cqemu-ga -D",
@@ -720,7 +703,8 @@ static void test_qga_config(gconstpointer data)
     g_shell_parse_argv(cmd, NULL, &argv, &error);
     g_assert_no_error(error);
 
-    env[0] = g_strdup_printf("QGA_CONF=%s", conf);
+    env[0] = g_strdup_printf("QGA_CONF=tests%cdata%ctest-qga-config",
+                             G_DIR_SEPARATOR, G_DIR_SEPARATOR);
     env[1] = NULL;
     g_spawn_sync(NULL, argv, env, 0,
                  NULL, NULL, &out, &err, &status, &error);
@@ -775,11 +759,8 @@ static void test_qga_config(gconstpointer data)
 
     g_free(out);
     g_free(err);
-    g_free(conf);
     g_free(env[0]);
     g_key_file_free(kf);
-
-    close(tmp);
 }
 
 static void test_qga_fsfreeze_status(gconstpointer fix)
Signature · 1 line
1.9.1
#4 lore raw
In reply to Michael Roth
Quoted 10 lines · Michael Roth

The following changes since commit 2d2e632ad00d11867c6c5625605b1fbc022dd62f:

Update version for v2.7.0-rc0 release (2016-07-22 15:32:42 +0100)

are available in the git repository at:

git://github.com/mdroth/qemu.git tags/qga-pull-2016-07-25-tag

for you to fetch changes up to 690604f696db6b3da35988e29da3f8d7966e12bc:

Quoted 8 lines

configure: mark qemu-ga VSS includes as system headers (2016-07-25 13:23:18 -0500)

----------------------------------------------------------------
qemu-ga patch queue for 2.7

* fix w32 build failures due to -Werror when building with VSS/fsfreeze enabled
* fix leaking for qemu-ga config files in make check

Applied, thanks.

-- PMM