1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Hi, | 3 | Hi, |
4 | |||
5 | More preliminary cleanups before a series to make qemu-ga a meson subproject(). | ||
6 | |||
7 | v5: | ||
8 | - drop Error argument from qga_open_cloexec() | ||
9 | - add r-b tags | ||
10 | |||
11 | v4: | ||
12 | - remove some unnecessary ERRP_GUARD() | ||
13 | - open-code some g_clear_pointer() | ||
14 | - don't export qemu_open_cloexec, introduce qga_open_cloexec instead | ||
15 | - some formatting improvements | ||
16 | - add new r-b tags | ||
4 | 17 | ||
5 | v3: | 18 | v3: |
6 | - changed error_report_err() back to g_critical() | 19 | - changed error_report_err() back to g_critical() |
7 | - added "qga: make build_fs_mount_list() return a bool" | 20 | - added "qga: make build_fs_mount_list() return a bool" |
8 | - replaced g_clear_pointer() usage by open-coded version | 21 | - replaced g_clear_pointer() usage by open-coded version |
... | ... | ||
21 | Marc-André Lureau (15): | 34 | Marc-André Lureau (15): |
22 | include: move qemu_*_exec_dir() to cutils | 35 | include: move qemu_*_exec_dir() to cutils |
23 | util/win32: simplify qemu_get_local_state_dir() | 36 | util/win32: simplify qemu_get_local_state_dir() |
24 | tests: make libqmp buildable for win32 | 37 | tests: make libqmp buildable for win32 |
25 | qga: flatten safe_open_or_create() | 38 | qga: flatten safe_open_or_create() |
26 | osdep: export qemu_open_cloexec() | 39 | qga: add qga_open_cloexec() helper |
27 | qga: use qemu_open_cloexec() for safe_open_or_create() | 40 | qga: use qga_open_cloexec() for safe_open_or_create() |
28 | qga: throw an Error in ga_channel_open() | 41 | qga: throw an Error in ga_channel_open() |
29 | qga: replace qemu_open_old() with qemu_open_cloexec() | 42 | qga: replace qemu_open_old() with qga_open_cloexec() |
30 | qga: make build_fs_mount_list() return a bool | 43 | qga: make build_fs_mount_list() return a bool |
31 | test/qga: use G_TEST_DIR to locate os-release test file | 44 | test/qga: use G_TEST_DIR to locate os-release test file |
32 | qga/wixl: prefer variables over environment | 45 | qga/wixl: prefer variables over environment |
33 | qga/wixl: require Mingw_bin | 46 | qga/wixl: require Mingw_bin |
34 | qga/wixl: simplify some pre-processing | 47 | qga/wixl: simplify some pre-processing |
35 | qga/wixl: replace QEMU_GA_MSI_MINGW_BIN_PATH with glib bindir | 48 | qga/wixl: replace QEMU_GA_MSI_MINGW_BIN_PATH with glib bindir |
36 | test/qga: use g_auto wherever sensible | 49 | test/qga: use g_auto wherever sensible |
37 | 50 | ||
38 | configure | 9 +- | 51 | configure | 9 +- |
52 | meson.build | 5 +- | ||
39 | include/qemu/cutils.h | 7 ++ | 53 | include/qemu/cutils.h | 7 ++ |
40 | include/qemu/osdep.h | 9 +- | 54 | include/qemu/osdep.h | 8 -- |
41 | meson.build | 5 +- | 55 | qga/cutils.h | 8 ++ |
56 | tests/qtest/libqmp.h | 2 + | ||
42 | qemu-io.c | 1 + | 57 | qemu-io.c | 1 + |
43 | qga/channel-posix.c | 55 +++++---- | 58 | qga/channel-posix.c | 55 +++++----- |
44 | qga/commands-posix.c | 164 +++++++++++++-------------- | 59 | qga/commands-posix.c | 154 +++++++++++++-------------- |
45 | qga/installer/qemu-ga.wxs | 83 +++++--------- | 60 | qga/cutils.c | 33 ++++++ |
46 | qga/meson.build | 11 +- | ||
47 | storage-daemon/qemu-storage-daemon.c | 1 + | 61 | storage-daemon/qemu-storage-daemon.c | 1 + |
48 | tests/qtest/fuzz/fuzz.c | 1 + | 62 | tests/qtest/fuzz/fuzz.c | 1 + |
49 | tests/qtest/libqmp.c | 34 +++++- | 63 | tests/qtest/libqmp.c | 34 +++++- |
50 | tests/qtest/libqmp.h | 2 + | 64 | tests/unit/test-qga.c | 130 ++++++++-------------- |
51 | tests/unit/test-qga.c | 130 ++++++++------------- | 65 | util/cutils.c | 108 +++++++++++++++++++ |
52 | util/cutils.c | 108 ++++++++++++++++++ | 66 | util/oslib-posix.c | 81 -------------- |
53 | util/osdep.c | 10 +- | ||
54 | util/oslib-posix.c | 81 ------------- | ||
55 | util/oslib-win32.c | 53 +-------- | 67 | util/oslib-win32.c | 53 +-------- |
56 | 18 files changed, 358 insertions(+), 406 deletions(-) | 68 | qga/installer/qemu-ga.wxs | 83 +++++---------- |
69 | qga/meson.build | 12 +-- | ||
70 | 19 files changed, 385 insertions(+), 400 deletions(-) | ||
71 | create mode 100644 qga/cutils.h | ||
72 | create mode 100644 qga/cutils.c | ||
57 | 73 | ||
58 | -- | 74 | -- |
59 | 2.36.1 | 75 | 2.36.1 |
60 | 76 | ||
61 | 77 | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | The function is required by get_relocated_path() (already in cutils), | 3 | The function is required by get_relocated_path() (already in cutils), |
4 | and used by qemu-ga and may be generally useful. | 4 | and used by qemu-ga and may be generally useful. |
5 | 5 | ||
6 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 6 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
7 | Reviewed-by: Markus Armbruster <armbru@redhat.com> | ||
7 | --- | 8 | --- |
8 | include/qemu/cutils.h | 7 ++ | 9 | include/qemu/cutils.h | 7 ++ |
9 | include/qemu/osdep.h | 8 -- | 10 | include/qemu/osdep.h | 8 -- |
10 | qemu-io.c | 1 + | 11 | qemu-io.c | 1 + |
11 | storage-daemon/qemu-storage-daemon.c | 1 + | 12 | storage-daemon/qemu-storage-daemon.c | 1 + |
... | ... | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | SHGetFolderPath() is a deprecated API: | 3 | SHGetFolderPath() is a deprecated API: |
4 | https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpatha | 4 | https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpatha |
5 | 5 | ||
6 | It is a wrapper for SHGetKnownFolderPath() and CSIDL_COMMON_PATH is | 6 | It is a wrapper for SHGetKnownFolderPath() and CSIDL_COMMON_PATH is |
7 | mapped to FOLDERID_ProgramData: | 7 | mapped to FOLDERID_ProgramData: |
8 | https://docs.microsoft.com/en-us/windows/win32/shell/csidl | 8 | https://docs.microsoft.com/en-us/windows/win32/shell/csidl |
9 | 9 | ||
10 | g_get_system_data_dirs() is a suitable replacement, as it will have | 10 | g_get_system_data_dirs() is a suitable replacement, as it will have |
11 | FOLDERID_ProgramData in the returned list. However, it follows the XDG | 11 | FOLDERID_ProgramData in the returned list. However, it follows the XDG |
12 | Base Directory Specification, if `XDG_DATA_DIRS` is defined, it will be | 12 | Base Directory Specification, if `XDG_DATA_DIRS` is defined, it will be |
13 | returned instead. | 13 | returned instead. |
14 | 14 | ||
15 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 15 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
16 | Reviewed-by: Stefan Weil <sw@weilnetz.de> | 16 | Reviewed-by: Stefan Weil <sw@weilnetz.de> |
17 | --- | 17 | --- |
18 | util/oslib-win32.c | 17 ++++------------- | 18 | util/oslib-win32.c | 17 ++++------------- |
19 | 1 file changed, 4 insertions(+), 13 deletions(-) | 19 | 1 file changed, 4 insertions(+), 13 deletions(-) |
20 | 20 | ||
21 | diff --git a/util/oslib-win32.c b/util/oslib-win32.c | 21 | diff --git a/util/oslib-win32.c b/util/oslib-win32.c |
22 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
23 | --- a/util/oslib-win32.c | 23 | --- a/util/oslib-win32.c |
24 | +++ b/util/oslib-win32.c | 24 | +++ b/util/oslib-win32.c |
25 | @@ -XXX,XX +XXX,XX @@ | 25 | @@ -XXX,XX +XXX,XX @@ |
26 | #include "qemu/error-report.h" | 26 | #include "qemu/error-report.h" |
27 | #include <malloc.h> | 27 | #include <malloc.h> |
28 | 28 | ||
29 | -/* this must come after including "trace.h" */ | 29 | -/* this must come after including "trace.h" */ |
30 | -#include <shlobj.h> | 30 | -#include <shlobj.h> |
31 | - | 31 | - |
32 | static int get_allocation_granularity(void) | 32 | static int get_allocation_granularity(void) |
33 | { | 33 | { |
34 | SYSTEM_INFO system_info; | 34 | SYSTEM_INFO system_info; |
35 | @@ -XXX,XX +XXX,XX @@ int qemu_get_thread_id(void) | 35 | @@ -XXX,XX +XXX,XX @@ int qemu_get_thread_id(void) |
36 | char * | 36 | char * |
37 | qemu_get_local_state_dir(void) | 37 | qemu_get_local_state_dir(void) |
38 | { | 38 | { |
39 | - HRESULT result; | 39 | - HRESULT result; |
40 | - char base_path[MAX_PATH+1] = ""; | 40 | - char base_path[MAX_PATH+1] = ""; |
41 | + const char * const *data_dirs = g_get_system_data_dirs(); | 41 | + const char * const *data_dirs = g_get_system_data_dirs(); |
42 | 42 | ||
43 | - result = SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, | 43 | - result = SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, |
44 | - /* SHGFP_TYPE_CURRENT */ 0, base_path); | 44 | - /* SHGFP_TYPE_CURRENT */ 0, base_path); |
45 | - if (result != S_OK) { | 45 | - if (result != S_OK) { |
46 | - /* misconfigured environment */ | 46 | - /* misconfigured environment */ |
47 | - g_critical("CSIDL_COMMON_APPDATA unavailable: %ld", (long)result); | 47 | - g_critical("CSIDL_COMMON_APPDATA unavailable: %ld", (long)result); |
48 | - abort(); | 48 | - abort(); |
49 | - } | 49 | - } |
50 | - return g_strdup(base_path); | 50 | - return g_strdup(base_path); |
51 | + g_assert(data_dirs && data_dirs[0]); | 51 | + g_assert(data_dirs && data_dirs[0]); |
52 | + | 52 | + |
53 | + return g_strdup(data_dirs[0]); | 53 | + return g_strdup(data_dirs[0]); |
54 | } | 54 | } |
55 | 55 | ||
56 | void qemu_set_tty_echo(int fd, bool echo) | 56 | void qemu_set_tty_echo(int fd, bool echo) |
57 | -- | 57 | -- |
58 | 2.36.1 | 58 | 2.36.1 |
59 | 59 | ||
60 | 60 | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 3 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
4 | Reviewed-by: Thomas Huth <thuth@redhat.com> | 4 | Reviewed-by: Thomas Huth <thuth@redhat.com> |
5 | --- | 5 | --- |
6 | tests/qtest/libqmp.h | 2 ++ | ||
6 | tests/qtest/libqmp.c | 34 +++++++++++++++++++++++++++++----- | 7 | tests/qtest/libqmp.c | 34 +++++++++++++++++++++++++++++----- |
7 | tests/qtest/libqmp.h | 2 ++ | ||
8 | 2 files changed, 31 insertions(+), 5 deletions(-) | 8 | 2 files changed, 31 insertions(+), 5 deletions(-) |
9 | 9 | ||
10 | diff --git a/tests/qtest/libqmp.h b/tests/qtest/libqmp.h | ||
11 | index XXXXXXX..XXXXXXX 100644 | ||
12 | --- a/tests/qtest/libqmp.h | ||
13 | +++ b/tests/qtest/libqmp.h | ||
14 | @@ -XXX,XX +XXX,XX @@ | ||
15 | #include "qapi/qmp/qdict.h" | ||
16 | |||
17 | QDict *qmp_fd_receive(int fd); | ||
18 | +#ifndef _WIN32 | ||
19 | void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, | ||
20 | const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0); | ||
21 | +#endif | ||
22 | void qmp_fd_vsend(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0); | ||
23 | void qmp_fd_send(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3); | ||
24 | void qmp_fd_send_raw(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3); | ||
10 | diff --git a/tests/qtest/libqmp.c b/tests/qtest/libqmp.c | 25 | diff --git a/tests/qtest/libqmp.c b/tests/qtest/libqmp.c |
11 | index XXXXXXX..XXXXXXX 100644 | 26 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/tests/qtest/libqmp.c | 27 | --- a/tests/qtest/libqmp.c |
13 | +++ b/tests/qtest/libqmp.c | 28 | +++ b/tests/qtest/libqmp.c |
14 | @@ -XXX,XX +XXX,XX @@ | 29 | @@ -XXX,XX +XXX,XX @@ |
15 | 30 | ||
16 | #include "libqmp.h" | 31 | #include "libqmp.h" |
17 | 32 | ||
18 | +#ifndef G_OS_WIN32 | 33 | +#ifndef _WIN32 |
19 | +#include <sys/socket.h> | 34 | +#include <sys/socket.h> |
20 | +#endif | 35 | +#endif |
21 | + | 36 | + |
22 | +#include "qemu/cutils.h" | 37 | +#include "qemu/cutils.h" |
23 | #include "qapi/error.h" | 38 | #include "qapi/error.h" |
24 | #include "qapi/qmp/json-parser.h" | 39 | #include "qapi/qmp/json-parser.h" |
25 | #include "qapi/qmp/qjson.h" | 40 | #include "qapi/qmp/qjson.h" |
26 | @@ -XXX,XX +XXX,XX @@ QDict *qmp_fd_receive(int fd) | 41 | @@ -XXX,XX +XXX,XX @@ QDict *qmp_fd_receive(int fd) |
27 | return qmp.response; | 42 | return qmp.response; |
28 | } | 43 | } |
29 | 44 | ||
30 | +#ifndef G_OS_WIN32 | 45 | +#ifndef _WIN32 |
31 | /* Sends a message and file descriptors to the socket. | 46 | /* Sends a message and file descriptors to the socket. |
32 | * It's needed for qmp-commands like getfd/add-fd */ | 47 | * It's needed for qmp-commands like getfd/add-fd */ |
33 | static void socket_send_fds(int socket_fd, int *fds, size_t fds_num, | 48 | static void socket_send_fds(int socket_fd, int *fds, size_t fds_num, |
34 | @@ -XXX,XX +XXX,XX @@ static void socket_send_fds(int socket_fd, int *fds, size_t fds_num, | 49 | @@ -XXX,XX +XXX,XX @@ static void socket_send_fds(int socket_fd, int *fds, size_t fds_num, |
35 | } while (ret < 0 && errno == EINTR); | 50 | } while (ret < 0 && errno == EINTR); |
... | ... | ||
48 | +_qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, | 63 | +_qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, |
49 | + const char *fmt, va_list ap) | 64 | + const char *fmt, va_list ap) |
50 | { | 65 | { |
51 | QObject *qobj; | 66 | QObject *qobj; |
52 | 67 | ||
53 | +#ifdef G_OS_WIN32 | 68 | +#ifdef _WIN32 |
54 | + assert(fds_num == 0); | 69 | + assert(fds_num == 0); |
55 | +#endif | 70 | +#endif |
56 | + | 71 | + |
57 | /* Going through qobject ensures we escape strings properly */ | 72 | /* Going through qobject ensures we escape strings properly */ |
58 | qobj = qobject_from_vjsonf_nofail(fmt, ap); | 73 | qobj = qobject_from_vjsonf_nofail(fmt, ap); |
59 | 74 | ||
60 | @@ -XXX,XX +XXX,XX @@ void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, | 75 | @@ -XXX,XX +XXX,XX @@ void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, |
61 | if (log) { | 76 | if (log) { |
62 | fprintf(stderr, "%s", str->str); | 77 | fprintf(stderr, "%s", str->str); |
63 | } | 78 | } |
64 | + | 79 | + |
65 | +#ifndef G_OS_WIN32 | 80 | +#ifndef _WIN32 |
66 | /* Send QMP request */ | 81 | /* Send QMP request */ |
67 | if (fds && fds_num > 0) { | 82 | if (fds && fds_num > 0) { |
68 | socket_send_fds(fd, fds, fds_num, str->str, str->len); | 83 | socket_send_fds(fd, fds, fds_num, str->str, str->len); |
69 | - } else { | 84 | - } else { |
70 | + } else | 85 | + } else |
... | ... | ||
75 | 90 | ||
76 | @@ -XXX,XX +XXX,XX @@ void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, | 91 | @@ -XXX,XX +XXX,XX @@ void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, |
77 | } | 92 | } |
78 | } | 93 | } |
79 | 94 | ||
80 | +#ifndef G_OS_WIN32 | 95 | +#ifndef _WIN32 |
81 | +void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, | 96 | +void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, |
82 | + const char *fmt, va_list ap) | 97 | + const char *fmt, va_list ap) |
83 | +{ | 98 | +{ |
84 | + _qmp_fd_vsend_fds(fd, fds, fds_num, fmt, ap); | 99 | + _qmp_fd_vsend_fds(fd, fds, fds_num, fmt, ap); |
85 | +} | 100 | +} |
... | ... | ||
97 | - qmp_fd_vsend_fds(fd, NULL, 0, fmt, ap); | 112 | - qmp_fd_vsend_fds(fd, NULL, 0, fmt, ap); |
98 | + _qmp_fd_vsend_fds(fd, NULL, 0, fmt, ap); | 113 | + _qmp_fd_vsend_fds(fd, NULL, 0, fmt, ap); |
99 | 114 | ||
100 | return qmp_fd_receive(fd); | 115 | return qmp_fd_receive(fd); |
101 | } | 116 | } |
102 | diff --git a/tests/qtest/libqmp.h b/tests/qtest/libqmp.h | ||
103 | index XXXXXXX..XXXXXXX 100644 | ||
104 | --- a/tests/qtest/libqmp.h | ||
105 | +++ b/tests/qtest/libqmp.h | ||
106 | @@ -XXX,XX +XXX,XX @@ | ||
107 | #include "qapi/qmp/qdict.h" | ||
108 | |||
109 | QDict *qmp_fd_receive(int fd); | ||
110 | +#ifndef G_OS_WIN32 | ||
111 | void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num, | ||
112 | const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0); | ||
113 | +#endif | ||
114 | void qmp_fd_vsend(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0); | ||
115 | void qmp_fd_send(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3); | ||
116 | void qmp_fd_send_raw(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3); | ||
117 | -- | 117 | -- |
118 | 2.36.1 | 118 | 2.36.1 |
119 | 119 | ||
120 | 120 | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
4 | a bit to improve readability. | 4 | a bit to improve readability. |
5 | 5 | ||
6 | This also helps with the following error handling changes. | 6 | This also helps with the following error handling changes. |
7 | 7 | ||
8 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 8 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
9 | Reviewed-by: Markus Armbruster <armbru@redhat.com> | ||
9 | --- | 10 | --- |
10 | qga/commands-posix.c | 122 ++++++++++++++++++++++--------------------- | 11 | qga/commands-posix.c | 120 +++++++++++++++++++++---------------------- |
11 | 1 file changed, 62 insertions(+), 60 deletions(-) | 12 | 1 file changed, 60 insertions(+), 60 deletions(-) |
12 | 13 | ||
13 | diff --git a/qga/commands-posix.c b/qga/commands-posix.c | 14 | diff --git a/qga/commands-posix.c b/qga/commands-posix.c |
14 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/qga/commands-posix.c | 16 | --- a/qga/commands-posix.c |
16 | +++ b/qga/commands-posix.c | 17 | +++ b/qga/commands-posix.c |
... | ... | ||
55 | + oflag &= ~(unsigned)O_CREAT; | 56 | + oflag &= ~(unsigned)O_CREAT; |
56 | + fd = open(path, oflag); | 57 | + fd = open(path, oflag); |
57 | + } | 58 | + } |
58 | + if (fd == -1) { | 59 | + if (fd == -1) { |
59 | + error_setg_errno(errp, errno, | 60 | + error_setg_errno(errp, errno, |
60 | + "failed to open file '%s' " | 61 | + "failed to open file '%s' (mode: '%s')", |
61 | + "(mode: '%s')", | ||
62 | + path, mode); | 62 | + path, mode); |
63 | + goto end; | 63 | + goto end; |
64 | + } | 64 | + } |
65 | 65 | ||
66 | - oflag = find_open_flag(mode, &local_err); | 66 | - oflag = find_open_flag(mode, &local_err); |
... | ... | ||
100 | - error_setg_errno(&local_err, errno, "failed to open file '%s' " | 100 | - error_setg_errno(&local_err, errno, "failed to open file '%s' " |
101 | - "(mode: '%s')", path, mode); | 101 | - "(mode: '%s')", path, mode); |
102 | - } else { | 102 | - } else { |
103 | - qemu_set_cloexec(fd); | 103 | - qemu_set_cloexec(fd); |
104 | + if ((oflag & O_CREAT) && fchmod(fd, DEFAULT_NEW_FILE_MODE) == -1) { | 104 | + if ((oflag & O_CREAT) && fchmod(fd, DEFAULT_NEW_FILE_MODE) == -1) { |
105 | + error_setg_errno(errp, errno, | 105 | + error_setg_errno(errp, errno, "failed to set permission " |
106 | + "failed to set permission 0%03o on new file '%s' (mode: '%s')", | 106 | + "0%03o on new file '%s' (mode: '%s')", |
107 | + (unsigned)DEFAULT_NEW_FILE_MODE, path, mode); | 107 | + (unsigned)DEFAULT_NEW_FILE_MODE, path, mode); |
108 | + goto end; | 108 | + goto end; |
109 | + } | 109 | + } |
110 | 110 | ||
111 | - if ((oflag & O_CREAT) && fchmod(fd, DEFAULT_NEW_FILE_MODE) == -1) { | 111 | - if ((oflag & O_CREAT) && fchmod(fd, DEFAULT_NEW_FILE_MODE) == -1) { |
... | ... | ||
124 | - return f; | 124 | - return f; |
125 | - } | 125 | - } |
126 | - } | 126 | - } |
127 | + f = fdopen(fd, mode); | 127 | + f = fdopen(fd, mode); |
128 | + if (f == NULL) { | 128 | + if (f == NULL) { |
129 | + error_setg_errno(errp, errno, | 129 | + error_setg_errno(errp, errno, "failed to associate stdio stream with " |
130 | + "failed to associate stdio stream with file descriptor %d, " | 130 | + "file descriptor %d, file '%s' (mode: '%s')", |
131 | + "file '%s' (mode: '%s')", | ||
132 | + fd, path, mode); | 131 | + fd, path, mode); |
133 | + } | 132 | + } |
134 | 133 | ||
135 | - close(fd); | 134 | - close(fd); |
136 | - if (oflag & O_CREAT) { | 135 | - if (oflag & O_CREAT) { |
... | ... | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Used in the next patch, to simplify qga code. | 3 | QGA calls qemu_open_old() in various places. Calling qemu_open() instead |
4 | isn't a great alternative, as it has special "/dev/fdset" handling and | ||
5 | depends on QEMU internal monitor data structures. | ||
6 | |||
7 | Instead, provide a simple helper for QGA needs, with Error* support. The | ||
8 | following patches will make use of it. | ||
4 | 9 | ||
5 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 10 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
11 | Reviewed-by: Markus Armbruster <armbru@redhat.com> | ||
6 | --- | 12 | --- |
7 | include/qemu/osdep.h | 1 + | 13 | qga/cutils.h | 8 ++++++++ |
8 | util/osdep.c | 10 ++++++++-- | 14 | qga/cutils.c | 33 +++++++++++++++++++++++++++++++++ |
9 | 2 files changed, 9 insertions(+), 2 deletions(-) | 15 | qga/meson.build | 1 + |
16 | 3 files changed, 42 insertions(+) | ||
17 | create mode 100644 qga/cutils.h | ||
18 | create mode 100644 qga/cutils.c | ||
10 | 19 | ||
11 | diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h | 20 | diff --git a/qga/cutils.h b/qga/cutils.h |
21 | new file mode 100644 | ||
22 | index XXXXXXX..XXXXXXX | ||
23 | --- /dev/null | ||
24 | +++ b/qga/cutils.h | ||
25 | @@ -XXX,XX +XXX,XX @@ | ||
26 | +#ifndef CUTILS_H_ | ||
27 | +#define CUTILS_H_ | ||
28 | + | ||
29 | +#include "qemu/osdep.h" | ||
30 | + | ||
31 | +int qga_open_cloexec(const char *name, int flags, mode_t mode); | ||
32 | + | ||
33 | +#endif /* CUTILS_H_ */ | ||
34 | diff --git a/qga/cutils.c b/qga/cutils.c | ||
35 | new file mode 100644 | ||
36 | index XXXXXXX..XXXXXXX | ||
37 | --- /dev/null | ||
38 | +++ b/qga/cutils.c | ||
39 | @@ -XXX,XX +XXX,XX @@ | ||
40 | +/* | ||
41 | + * This work is licensed under the terms of the GNU GPL, version 2 or later. | ||
42 | + * See the COPYING file in the top-level directory. | ||
43 | + */ | ||
44 | +#include "cutils.h" | ||
45 | + | ||
46 | +#include "qapi/error.h" | ||
47 | + | ||
48 | +/** | ||
49 | + * qga_open_cloexec: | ||
50 | + * @name: the pathname to open | ||
51 | + * @flags: as in open() | ||
52 | + * @mode: as in open() | ||
53 | + * | ||
54 | + * A wrapper for open() function which sets O_CLOEXEC. | ||
55 | + * | ||
56 | + * On error, -1 is returned. | ||
57 | + */ | ||
58 | +int qga_open_cloexec(const char *name, int flags, mode_t mode) | ||
59 | +{ | ||
60 | + int ret; | ||
61 | + | ||
62 | +#ifdef O_CLOEXEC | ||
63 | + ret = open(name, flags | O_CLOEXEC, mode); | ||
64 | +#else | ||
65 | + ret = open(name, flags, mode); | ||
66 | + if (ret >= 0) { | ||
67 | + qemu_set_cloexec(ret); | ||
68 | + } | ||
69 | +#endif | ||
70 | + | ||
71 | + return ret; | ||
72 | +} | ||
73 | diff --git a/qga/meson.build b/qga/meson.build | ||
12 | index XXXXXXX..XXXXXXX 100644 | 74 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/include/qemu/osdep.h | 75 | --- a/qga/meson.build |
14 | +++ b/include/qemu/osdep.h | 76 | +++ b/qga/meson.build |
15 | @@ -XXX,XX +XXX,XX @@ void sigaction_invoke(struct sigaction *action, | 77 | @@ -XXX,XX +XXX,XX @@ qga_ss.add(files( |
16 | */ | 78 | 'commands.c', |
17 | int qemu_open_old(const char *name, int flags, ...); | 79 | 'guest-agent-command-state.c', |
18 | int qemu_open(const char *name, int flags, Error **errp); | 80 | 'main.c', |
19 | +int qemu_open_cloexec(const char *name, int flags, mode_t mode, Error **errp); | 81 | + 'cutils.c', |
20 | int qemu_create(const char *name, int flags, mode_t mode, Error **errp); | 82 | )) |
21 | int qemu_close(int fd); | 83 | qga_ss.add(when: 'CONFIG_POSIX', if_true: files( |
22 | int qemu_unlink(const char *name); | 84 | 'channel-posix.c', |
23 | diff --git a/util/osdep.c b/util/osdep.c | ||
24 | index XXXXXXX..XXXXXXX 100644 | ||
25 | --- a/util/osdep.c | ||
26 | +++ b/util/osdep.c | ||
27 | @@ -XXX,XX +XXX,XX @@ int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive) | ||
28 | } | ||
29 | #endif | ||
30 | |||
31 | -static int qemu_open_cloexec(const char *name, int flags, mode_t mode) | ||
32 | +int qemu_open_cloexec(const char *name, int flags, mode_t mode, Error **errp) | ||
33 | { | ||
34 | + ERRP_GUARD(); | ||
35 | int ret; | ||
36 | + | ||
37 | #ifdef O_CLOEXEC | ||
38 | ret = open(name, flags | O_CLOEXEC, mode); | ||
39 | #else | ||
40 | @@ -XXX,XX +XXX,XX @@ static int qemu_open_cloexec(const char *name, int flags, mode_t mode) | ||
41 | qemu_set_cloexec(ret); | ||
42 | } | ||
43 | #endif | ||
44 | + if (ret == -1) { | ||
45 | + error_setg_errno(errp, errno, "Failed to open file '%s'", name); | ||
46 | + } | ||
47 | + | ||
48 | return ret; | ||
49 | } | ||
50 | |||
51 | @@ -XXX,XX +XXX,XX @@ qemu_open_internal(const char *name, int flags, mode_t mode, Error **errp) | ||
52 | } | ||
53 | #endif | ||
54 | |||
55 | - ret = qemu_open_cloexec(name, flags, mode); | ||
56 | + ret = qemu_open_cloexec(name, flags, mode, NULL); | ||
57 | |||
58 | if (ret == -1) { | ||
59 | const char *action = flags & O_CREAT ? "create" : "open"; | ||
60 | -- | 85 | -- |
61 | 2.36.1 | 86 | 2.36.1 |
62 | 87 | ||
63 | 88 | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | The function takes care of setting CLOEXEC, and reporting error. | 3 | The function takes care of setting CLOEXEC. |
4 | |||
5 | The reported error message will differ, from: | ||
6 | "failed to open file 'foo' (mode: 'r')" | ||
7 | to: | ||
8 | "Failed to open file 'foo'" | ||
9 | 4 | ||
10 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 5 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
6 | Reviewed-by: Markus Armbruster <armbru@redhat.com> | ||
11 | --- | 7 | --- |
12 | qga/commands-posix.c | 13 +++++-------- | 8 | qga/commands-posix.c | 7 +++---- |
13 | 1 file changed, 5 insertions(+), 8 deletions(-) | 9 | 1 file changed, 3 insertions(+), 4 deletions(-) |
14 | 10 | ||
15 | diff --git a/qga/commands-posix.c b/qga/commands-posix.c | 11 | diff --git a/qga/commands-posix.c b/qga/commands-posix.c |
16 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/qga/commands-posix.c | 13 | --- a/qga/commands-posix.c |
18 | +++ b/qga/commands-posix.c | 14 | +++ b/qga/commands-posix.c |
19 | @@ -XXX,XX +XXX,XX @@ find_open_flag(const char *mode_str, Error **errp) | 15 | @@ -XXX,XX +XXX,XX @@ |
20 | static FILE * | 16 | #include "qemu/cutils.h" |
21 | safe_open_or_create(const char *path, const char *mode, Error **errp) | 17 | #include "commands-common.h" |
22 | { | 18 | #include "block/nvme.h" |
23 | + ERRP_GUARD(); | 19 | +#include "cutils.h" |
24 | int oflag; | 20 | |
25 | int fd = -1; | 21 | #ifdef HAVE_UTMPX |
26 | FILE *f = NULL; | 22 | #include <utmpx.h> |
27 | @@ -XXX,XX +XXX,XX @@ safe_open_or_create(const char *path, const char *mode, Error **errp) | 23 | @@ -XXX,XX +XXX,XX @@ safe_open_or_create(const char *path, const char *mode, Error **errp) |
28 | * open() is decisive and its third argument is ignored, and the second | 24 | * open() is decisive and its third argument is ignored, and the second |
29 | * open() and the fchmod() are never called. | 25 | * open() and the fchmod() are never called. |
30 | */ | 26 | */ |
31 | - fd = open(path, oflag | ((oflag & O_CREAT) ? O_EXCL : 0), 0); | 27 | - fd = open(path, oflag | ((oflag & O_CREAT) ? O_EXCL : 0), 0); |
32 | + fd = qemu_open_cloexec(path, oflag | ((oflag & O_CREAT) ? O_EXCL : 0), 0, errp); | 28 | + fd = qga_open_cloexec(path, oflag | ((oflag & O_CREAT) ? O_EXCL : 0), 0); |
33 | if (fd == -1 && errno == EEXIST) { | 29 | if (fd == -1 && errno == EEXIST) { |
34 | + error_free(*errp); | ||
35 | + *errp = NULL; | ||
36 | oflag &= ~(unsigned)O_CREAT; | 30 | oflag &= ~(unsigned)O_CREAT; |
37 | - fd = open(path, oflag); | 31 | - fd = open(path, oflag); |
38 | + fd = qemu_open_cloexec(path, oflag, 0, errp); | 32 | + fd = qga_open_cloexec(path, oflag, 0); |
39 | } | 33 | } |
40 | if (fd == -1) { | 34 | if (fd == -1) { |
41 | - error_setg_errno(errp, errno, | 35 | error_setg_errno(errp, errno, |
42 | - "failed to open file '%s' " | 36 | @@ -XXX,XX +XXX,XX @@ safe_open_or_create(const char *path, const char *mode, Error **errp) |
43 | - "(mode: '%s')", | ||
44 | - path, mode); | ||
45 | goto end; | 37 | goto end; |
46 | } | 38 | } |
47 | 39 | ||
48 | - qemu_set_cloexec(fd); | 40 | - qemu_set_cloexec(fd); |
49 | - | 41 | - |
50 | if ((oflag & O_CREAT) && fchmod(fd, DEFAULT_NEW_FILE_MODE) == -1) { | 42 | if ((oflag & O_CREAT) && fchmod(fd, DEFAULT_NEW_FILE_MODE) == -1) { |
51 | error_setg_errno(errp, errno, | 43 | error_setg_errno(errp, errno, "failed to set permission " |
52 | "failed to set permission 0%03o on new file '%s' (mode: '%s')", | 44 | "0%03o on new file '%s' (mode: '%s')", |
53 | -- | 45 | -- |
54 | 2.36.1 | 46 | 2.36.1 |
55 | 47 | ||
56 | 48 | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Allow for a single point of error reporting, and further refactoring. | 3 | Allow for a single point of error reporting, and further refactoring. |
4 | 4 | ||
5 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 5 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
6 | Reviewed-by: Markus Armbruster <armbru@redhat.com> | ||
6 | --- | 7 | --- |
7 | qga/channel-posix.c | 43 ++++++++++++++++++------------------------- | 8 | qga/channel-posix.c | 42 +++++++++++++++++------------------------- |
8 | 1 file changed, 18 insertions(+), 25 deletions(-) | 9 | 1 file changed, 17 insertions(+), 25 deletions(-) |
9 | 10 | ||
10 | diff --git a/qga/channel-posix.c b/qga/channel-posix.c | 11 | diff --git a/qga/channel-posix.c b/qga/channel-posix.c |
11 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
12 | --- a/qga/channel-posix.c | 13 | --- a/qga/channel-posix.c |
13 | +++ b/qga/channel-posix.c | 14 | +++ b/qga/channel-posix.c |
... | ... | ||
16 | 17 | ||
17 | static gboolean ga_channel_open(GAChannel *c, const gchar *path, | 18 | static gboolean ga_channel_open(GAChannel *c, const gchar *path, |
18 | - GAChannelMethod method, int fd) | 19 | - GAChannelMethod method, int fd) |
19 | + GAChannelMethod method, int fd, Error **errp) | 20 | + GAChannelMethod method, int fd, Error **errp) |
20 | { | 21 | { |
21 | + ERRP_GUARD(); | ||
22 | int ret; | 22 | int ret; |
23 | c->method = method; | 23 | c->method = method; |
24 | |||
25 | @@ -XXX,XX +XXX,XX @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, | 24 | @@ -XXX,XX +XXX,XX @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, |
26 | #endif | 25 | #endif |
27 | ); | 26 | ); |
28 | if (fd == -1) { | 27 | if (fd == -1) { |
29 | - g_critical("error opening channel: %s", strerror(errno)); | 28 | - g_critical("error opening channel: %s", strerror(errno)); |
... | ... | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
3 | qemu_open_old() uses qemu_open_internal() which handles special | 3 | qemu_open_old() uses qemu_open_internal() which handles special |
4 | "/dev/fdset/" path for monitor fd sets, set CLOEXEC, and uses Error | 4 | "/dev/fdset/" path for monitor fd sets, set CLOEXEC, and uses Error |
5 | reporting (and some O_DIRECT special error casing). | 5 | reporting (and some O_DIRECT special error casing). |
6 | 6 | ||
7 | The monitor fdset handling is unnecessary for qga, use | 7 | The monitor fdset handling is unnecessary for qga, use |
8 | qemu_open_cloexec() instead. | 8 | qga_open_cloexec() instead. |
9 | 9 | ||
10 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 10 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
11 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> | ||
11 | --- | 12 | --- |
12 | qga/channel-posix.c | 14 +++++++++----- | 13 | qga/channel-posix.c | 13 +++++++++---- |
13 | qga/commands-posix.c | 24 ++++++++++++------------ | 14 | qga/commands-posix.c | 8 ++++---- |
14 | 2 files changed, 21 insertions(+), 17 deletions(-) | 15 | 2 files changed, 13 insertions(+), 8 deletions(-) |
15 | 16 | ||
16 | diff --git a/qga/channel-posix.c b/qga/channel-posix.c | 17 | diff --git a/qga/channel-posix.c b/qga/channel-posix.c |
17 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/qga/channel-posix.c | 19 | --- a/qga/channel-posix.c |
19 | +++ b/qga/channel-posix.c | 20 | +++ b/qga/channel-posix.c |
20 | @@ -XXX,XX +XXX,XX @@ | 21 | @@ -XXX,XX +XXX,XX @@ |
21 | #include "qemu/osdep.h" | 22 | #include "qemu/osdep.h" |
22 | +#include "qemu/cutils.h" | 23 | +#include "qemu/cutils.h" |
23 | #include <termios.h> | 24 | #include <termios.h> |
24 | #include "qapi/error.h" | 25 | #include "qapi/error.h" |
25 | #include "qemu/sockets.h" | 26 | #include "qemu/sockets.h" |
27 | #include "channel.h" | ||
28 | +#include "cutils.h" | ||
29 | |||
30 | #ifdef CONFIG_SOLARIS | ||
31 | #include <stropts.h> | ||
26 | @@ -XXX,XX +XXX,XX @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, | 32 | @@ -XXX,XX +XXX,XX @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, |
27 | switch (c->method) { | 33 | switch (c->method) { |
28 | case GA_CHANNEL_VIRTIO_SERIAL: { | 34 | case GA_CHANNEL_VIRTIO_SERIAL: { |
29 | assert(fd < 0); | 35 | assert(fd < 0); |
30 | - fd = qemu_open_old(path, O_RDWR | O_NONBLOCK | 36 | - fd = qemu_open_old(path, O_RDWR | O_NONBLOCK |
31 | + fd = qemu_open_cloexec( | 37 | + fd = qga_open_cloexec( |
32 | + path, | 38 | + path, |
33 | #ifndef CONFIG_SOLARIS | 39 | #ifndef CONFIG_SOLARIS |
34 | - | O_ASYNC | 40 | - | O_ASYNC |
35 | + O_ASYNC | | 41 | + O_ASYNC | |
36 | #endif | 42 | #endif |
37 | - ); | 43 | - ); |
38 | + O_RDWR | O_NONBLOCK, | 44 | + O_RDWR | O_NONBLOCK, |
39 | + 0, | 45 | + 0 |
40 | + errp | ||
41 | + ); | 46 | + ); |
42 | if (fd == -1) { | 47 | if (fd == -1) { |
43 | error_setg_errno(errp, errno, "error opening channel"); | 48 | error_setg_errno(errp, errno, "error opening channel"); |
44 | return false; | 49 | return false; |
45 | @@ -XXX,XX +XXX,XX @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, | 50 | @@ -XXX,XX +XXX,XX @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, |
46 | struct termios tio; | 51 | struct termios tio; |
47 | 52 | ||
48 | assert(fd < 0); | 53 | assert(fd < 0); |
49 | - fd = qemu_open_old(path, O_RDWR | O_NOCTTY | O_NONBLOCK); | 54 | - fd = qemu_open_old(path, O_RDWR | O_NOCTTY | O_NONBLOCK); |
50 | + fd = qemu_open_cloexec(path, O_RDWR | O_NOCTTY | O_NONBLOCK, 0, errp); | 55 | + fd = qga_open_cloexec(path, O_RDWR | O_NOCTTY | O_NONBLOCK, 0); |
51 | if (fd == -1) { | 56 | if (fd == -1) { |
52 | - error_setg_errno(errp, errno, "error opening channel"); | 57 | error_setg_errno(errp, errno, "error opening channel"); |
53 | return false; | 58 | return false; |
54 | } | ||
55 | tcgetattr(fd, &tio); | ||
56 | diff --git a/qga/commands-posix.c b/qga/commands-posix.c | 59 | diff --git a/qga/commands-posix.c b/qga/commands-posix.c |
57 | index XXXXXXX..XXXXXXX 100644 | 60 | index XXXXXXX..XXXXXXX 100644 |
58 | --- a/qga/commands-posix.c | 61 | --- a/qga/commands-posix.c |
59 | +++ b/qga/commands-posix.c | 62 | +++ b/qga/commands-posix.c |
60 | @@ -XXX,XX +XXX,XX @@ static GuestDiskInfoList *get_disk_partitions( | ||
61 | |||
62 | static void get_nvme_smart(GuestDiskInfo *disk) | ||
63 | { | ||
64 | + Error *err = NULL; | ||
65 | int fd; | ||
66 | GuestNVMeSmart *smart; | ||
67 | NvmeSmartLog log = {0}; | ||
68 | @@ -XXX,XX +XXX,XX @@ static void get_nvme_smart(GuestDiskInfo *disk) | 63 | @@ -XXX,XX +XXX,XX @@ static void get_nvme_smart(GuestDiskInfo *disk) |
69 | | (((sizeof(log) >> 2) - 1) << 16) | 64 | | (((sizeof(log) >> 2) - 1) << 16) |
70 | }; | 65 | }; |
71 | 66 | ||
72 | - fd = qemu_open_old(disk->name, O_RDONLY); | 67 | - fd = qemu_open_old(disk->name, O_RDONLY); |
73 | + fd = qemu_open_cloexec(disk->name, O_RDONLY, 0, &err); | 68 | + fd = qga_open_cloexec(disk->name, O_RDONLY, 0); |
74 | if (fd == -1) { | 69 | if (fd == -1) { |
75 | - g_debug("Failed to open device: %s: %s", disk->name, g_strerror(errno)); | 70 | g_debug("Failed to open device: %s: %s", disk->name, g_strerror(errno)); |
76 | + g_debug("Failed to open device: %s: %s", disk->name, error_get_pretty(err)); | ||
77 | + error_free(err); | ||
78 | return; | 71 | return; |
79 | } | ||
80 | |||
81 | @@ -XXX,XX +XXX,XX @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints, | 72 | @@ -XXX,XX +XXX,XX @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints, |
82 | } | 73 | } |
83 | } | 74 | } |
84 | 75 | ||
85 | - fd = qemu_open_old(mount->dirname, O_RDONLY); | 76 | - fd = qemu_open_old(mount->dirname, O_RDONLY); |
86 | + fd = qemu_open_cloexec(mount->dirname, O_RDONLY, 0, errp); | 77 | + fd = qga_open_cloexec(mount->dirname, O_RDONLY, 0); |
87 | if (fd == -1) { | 78 | if (fd == -1) { |
88 | - error_setg_errno(errp, errno, "failed to open %s", mount->dirname); | 79 | error_setg_errno(errp, errno, "failed to open %s", mount->dirname); |
89 | goto error; | 80 | goto error; |
90 | } | ||
91 | |||
92 | @@ -XXX,XX +XXX,XX @@ int64_t qmp_guest_fsfreeze_thaw(Error **errp) | 81 | @@ -XXX,XX +XXX,XX @@ int64_t qmp_guest_fsfreeze_thaw(Error **errp) |
93 | 82 | ||
94 | QTAILQ_FOREACH(mount, &mounts, next) { | 83 | QTAILQ_FOREACH(mount, &mounts, next) { |
95 | logged = false; | 84 | logged = false; |
96 | - fd = qemu_open_old(mount->dirname, O_RDONLY); | 85 | - fd = qemu_open_old(mount->dirname, O_RDONLY); |
97 | + fd = qemu_open_cloexec(mount->dirname, O_RDONLY, 0, NULL); | 86 | + fd = qga_open_cloexec(mount->dirname, O_RDONLY, 0); |
98 | if (fd == -1) { | 87 | if (fd == -1) { |
99 | continue; | 88 | continue; |
100 | } | 89 | } |
101 | @@ -XXX,XX +XXX,XX @@ static void guest_fsfreeze_cleanup(void) | ||
102 | GuestFilesystemTrimResponse * | ||
103 | qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp) | ||
104 | { | ||
105 | + ERRP_GUARD(); | ||
106 | GuestFilesystemTrimResponse *response; | ||
107 | GuestFilesystemTrimResult *result; | ||
108 | int ret = 0; | ||
109 | FsMountList mounts; | ||
110 | struct FsMount *mount; | ||
111 | int fd; | ||
112 | - Error *local_err = NULL; | ||
113 | struct fstrim_range r; | ||
114 | |||
115 | slog("guest-fstrim called"); | ||
116 | |||
117 | QTAILQ_INIT(&mounts); | ||
118 | - build_fs_mount_list(&mounts, &local_err); | ||
119 | - if (local_err) { | ||
120 | - error_propagate(errp, local_err); | ||
121 | + build_fs_mount_list(&mounts, errp); | ||
122 | + if (*errp) { | ||
123 | return NULL; | ||
124 | } | ||
125 | |||
126 | @@ -XXX,XX +XXX,XX @@ qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp) | 90 | @@ -XXX,XX +XXX,XX @@ qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp) |
127 | 91 | ||
128 | QAPI_LIST_PREPEND(response->paths, result); | 92 | QAPI_LIST_PREPEND(response->paths, result); |
129 | 93 | ||
130 | - fd = qemu_open_old(mount->dirname, O_RDONLY); | 94 | - fd = qemu_open_old(mount->dirname, O_RDONLY); |
131 | + fd = qemu_open_cloexec(mount->dirname, O_RDONLY, 0, errp); | 95 | + fd = qga_open_cloexec(mount->dirname, O_RDONLY, 0); |
132 | if (fd == -1) { | 96 | if (fd == -1) { |
133 | - result->error = g_strdup_printf("failed to open: %s", | 97 | result->error = g_strdup_printf("failed to open: %s", |
134 | - strerror(errno)); | 98 | strerror(errno)); |
135 | + result->error = g_strdup(error_get_pretty(*errp)); | ||
136 | result->has_error = true; | ||
137 | + g_clear_pointer(errp, error_free); | ||
138 | continue; | ||
139 | } | ||
140 | |||
141 | -- | 99 | -- |
142 | 2.36.1 | 100 | 2.36.1 |
143 | 101 | ||
144 | 102 | diff view generated by jsdifflib |
... | ... | ||
---|---|---|---|
4 | with the guidance under = Rules = in include/qapi/error.h | 4 | with the guidance under = Rules = in include/qapi/error.h |
5 | 5 | ||
6 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 6 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
7 | Suggested-by: Markus Armbruster <armbru@redhat.com> | 7 | Suggested-by: Markus Armbruster <armbru@redhat.com> |
8 | --- | 8 | --- |
9 | qga/commands-posix.c | 23 ++++++++++------------- | 9 | qga/commands-posix.c | 25 ++++++++++--------------- |
10 | 1 file changed, 10 insertions(+), 13 deletions(-) | 10 | 1 file changed, 10 insertions(+), 15 deletions(-) |
11 | 11 | ||
12 | diff --git a/qga/commands-posix.c b/qga/commands-posix.c | 12 | diff --git a/qga/commands-posix.c b/qga/commands-posix.c |
13 | index XXXXXXX..XXXXXXX 100644 | 13 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/qga/commands-posix.c | 14 | --- a/qga/commands-posix.c |
15 | +++ b/qga/commands-posix.c | 15 | +++ b/qga/commands-posix.c |
... | ... | ||
95 | + if (!build_fs_mount_list(&mounts, &local_err)) { | 95 | + if (!build_fs_mount_list(&mounts, &local_err)) { |
96 | error_propagate(errp, local_err); | 96 | error_propagate(errp, local_err); |
97 | return 0; | 97 | return 0; |
98 | } | 98 | } |
99 | @@ -XXX,XX +XXX,XX @@ qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp) | 99 | @@ -XXX,XX +XXX,XX @@ qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp) |
100 | FsMountList mounts; | ||
101 | struct FsMount *mount; | ||
102 | int fd; | ||
103 | - Error *local_err = NULL; | ||
104 | struct fstrim_range r; | ||
105 | |||
100 | slog("guest-fstrim called"); | 106 | slog("guest-fstrim called"); |
101 | 107 | ||
102 | QTAILQ_INIT(&mounts); | 108 | QTAILQ_INIT(&mounts); |
103 | - build_fs_mount_list(&mounts, errp); | 109 | - build_fs_mount_list(&mounts, &local_err); |
104 | - if (*errp) { | 110 | - if (local_err) { |
111 | - error_propagate(errp, local_err); | ||
105 | + if (!build_fs_mount_list(&mounts, errp)) { | 112 | + if (!build_fs_mount_list(&mounts, errp)) { |
106 | return NULL; | 113 | return NULL; |
107 | } | 114 | } |
108 | 115 | ||
109 | -- | 116 | -- |
110 | 2.36.1 | 117 | 2.36.1 |
111 | 118 | ||
112 | 119 | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | This a more accurate way to lookup the test data, and will allow to move | 3 | This a more accurate way to lookup the test data, and will allow to move |
4 | the test in a subproject. | 4 | the test in a subproject. |
5 | 5 | ||
6 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 6 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
7 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> | ||
7 | --- | 8 | --- |
8 | tests/unit/test-qga.c | 11 +++++------ | 9 | tests/unit/test-qga.c | 11 +++++------ |
9 | 1 file changed, 5 insertions(+), 6 deletions(-) | 10 | 1 file changed, 5 insertions(+), 6 deletions(-) |
10 | 11 | ||
11 | diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c | 12 | diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c |
... | ... | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | No need to setup an environment or to check if the variable is undefined | 3 | No need to setup an environment or to check if the variable is undefined |
4 | manually. | 4 | manually. |
5 | 5 | ||
6 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 6 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
7 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> | 7 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> |
8 | --- | 8 | --- |
9 | qga/installer/qemu-ga.wxs | 30 +++++++++--------------------- | 9 | qga/installer/qemu-ga.wxs | 30 +++++++++--------------------- |
10 | qga/meson.build | 9 ++++----- | 10 | qga/meson.build | 9 ++++----- |
11 | 2 files changed, 13 insertions(+), 26 deletions(-) | 11 | 2 files changed, 13 insertions(+), 26 deletions(-) |
12 | 12 | ||
13 | diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs | 13 | diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs |
14 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/qga/installer/qemu-ga.wxs | 15 | --- a/qga/installer/qemu-ga.wxs |
16 | +++ b/qga/installer/qemu-ga.wxs | 16 | +++ b/qga/installer/qemu-ga.wxs |
17 | @@ -XXX,XX +XXX,XX @@ | 17 | @@ -XXX,XX +XXX,XX @@ |
18 | <?xml version="1.0" encoding="UTF-8"?> | 18 | <?xml version="1.0" encoding="UTF-8"?> |
19 | <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | 19 | <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> |
20 | - <?ifndef env.QEMU_GA_VERSION ?> | 20 | - <?ifndef env.QEMU_GA_VERSION ?> |
21 | - <?error Environment variable QEMU_GA_VERSION undefined?> | 21 | - <?error Environment variable QEMU_GA_VERSION undefined?> |
22 | - <?endif?> | 22 | - <?endif?> |
23 | - | 23 | - |
24 | - <?ifndef env.QEMU_GA_DISTRO ?> | 24 | - <?ifndef env.QEMU_GA_DISTRO ?> |
25 | - <?error Environment variable QEMU_GA_DISTRO undefined?> | 25 | - <?error Environment variable QEMU_GA_DISTRO undefined?> |
26 | - <?endif?> | 26 | - <?endif?> |
27 | - | 27 | - |
28 | - <?ifndef env.QEMU_GA_MANUFACTURER ?> | 28 | - <?ifndef env.QEMU_GA_MANUFACTURER ?> |
29 | - <?error Environment variable QEMU_GA_MANUFACTURER undefined?> | 29 | - <?error Environment variable QEMU_GA_MANUFACTURER undefined?> |
30 | - <?endif?> | 30 | - <?endif?> |
31 | - | 31 | - |
32 | <?ifndef var.Arch?> | 32 | <?ifndef var.Arch?> |
33 | <?error Define Arch to 32 or 64?> | 33 | <?error Define Arch to 32 or 64?> |
34 | <?endif?> | 34 | <?endif?> |
35 | @@ -XXX,XX +XXX,XX @@ | 35 | @@ -XXX,XX +XXX,XX @@ |
36 | Name="QEMU guest agent" | 36 | Name="QEMU guest agent" |
37 | Id="*" | 37 | Id="*" |
38 | UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}" | 38 | UpgradeCode="{EB6B8302-C06E-4BEC-ADAC-932C68A3A98D}" |
39 | - Manufacturer="$(env.QEMU_GA_MANUFACTURER)" | 39 | - Manufacturer="$(env.QEMU_GA_MANUFACTURER)" |
40 | - Version="$(env.QEMU_GA_VERSION)" | 40 | - Version="$(env.QEMU_GA_VERSION)" |
41 | + Manufacturer="$(var.QEMU_GA_MANUFACTURER)" | 41 | + Manufacturer="$(var.QEMU_GA_MANUFACTURER)" |
42 | + Version="$(var.QEMU_GA_VERSION)" | 42 | + Version="$(var.QEMU_GA_VERSION)" |
43 | Language="1033"> | 43 | Language="1033"> |
44 | <?if $(var.Arch) = 32 ?> | 44 | <?if $(var.Arch) = 32 ?> |
45 | <Condition Message="Error: 32-bit version of Qemu GA can not be installed on 64-bit Windows.">NOT VersionNT64</Condition> | 45 | <Condition Message="Error: 32-bit version of Qemu GA can not be installed on 64-bit Windows.">NOT VersionNT64</Condition> |
46 | <?endif?> | 46 | <?endif?> |
47 | <Package | 47 | <Package |
48 | - Manufacturer="$(env.QEMU_GA_MANUFACTURER)" | 48 | - Manufacturer="$(env.QEMU_GA_MANUFACTURER)" |
49 | + Manufacturer="$(var.QEMU_GA_MANUFACTURER)" | 49 | + Manufacturer="$(var.QEMU_GA_MANUFACTURER)" |
50 | InstallerVersion="200" | 50 | InstallerVersion="200" |
51 | Languages="1033" | 51 | Languages="1033" |
52 | Compressed="yes" | 52 | Compressed="yes" |
53 | InstallScope="perMachine" | 53 | InstallScope="perMachine" |
54 | /> | 54 | /> |
55 | - <Media Id="1" Cabinet="qemu_ga.$(env.QEMU_GA_VERSION).cab" EmbedCab="yes" /> | 55 | - <Media Id="1" Cabinet="qemu_ga.$(env.QEMU_GA_VERSION).cab" EmbedCab="yes" /> |
56 | + <Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab" EmbedCab="yes" /> | 56 | + <Media Id="1" Cabinet="qemu_ga.$(var.QEMU_GA_VERSION).cab" EmbedCab="yes" /> |
57 | <Property Id="WHSLogo">1</Property> | 57 | <Property Id="WHSLogo">1</Property> |
58 | <MajorUpgrade | 58 | <MajorUpgrade |
59 | DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed." | 59 | DowngradeErrorMessage="Error: A newer version of QEMU guest agent is already installed." |
60 | @@ -XXX,XX +XXX,XX @@ | 60 | @@ -XXX,XX +XXX,XX @@ |
61 | <Directory Id="$(var.GaProgramFilesFolder)" Name="QEMU Guest Agent"> | 61 | <Directory Id="$(var.GaProgramFilesFolder)" Name="QEMU Guest Agent"> |
62 | <Directory Id="qemu_ga_directory" Name="Qemu-ga"> | 62 | <Directory Id="qemu_ga_directory" Name="Qemu-ga"> |
63 | <Component Id="qemu_ga" Guid="{908B7199-DE2A-4DC6-A8D0-27A5AE444FEA}"> | 63 | <Component Id="qemu_ga" Guid="{908B7199-DE2A-4DC6-A8D0-27A5AE444FEA}"> |
64 | - <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="$(env.BUILD_DIR)/qga/qemu-ga.exe" KeyPath="yes" DiskId="1"/> | 64 | - <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="$(env.BUILD_DIR)/qga/qemu-ga.exe" KeyPath="yes" DiskId="1"/> |
65 | + <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="$(var.BUILD_DIR)/qga/qemu-ga.exe" KeyPath="yes" DiskId="1"/> | 65 | + <File Id="qemu_ga.exe" Name="qemu-ga.exe" Source="$(var.BUILD_DIR)/qga/qemu-ga.exe" KeyPath="yes" DiskId="1"/> |
66 | <ServiceInstall | 66 | <ServiceInstall |
67 | Id="ServiceInstaller" | 67 | Id="ServiceInstaller" |
68 | Type="ownProcess" | 68 | Type="ownProcess" |
69 | @@ -XXX,XX +XXX,XX @@ | 69 | @@ -XXX,XX +XXX,XX @@ |
70 | <File Id="libstdc++-6.lib" Name="libstdc++-6.dll" Source="$(var.Mingw_bin)/libstdc++-6.dll" KeyPath="yes" DiskId="1"/> | 70 | <File Id="libstdc++-6.lib" Name="libstdc++-6.dll" Source="$(var.Mingw_bin)/libstdc++-6.dll" KeyPath="yes" DiskId="1"/> |
71 | </Component> | 71 | </Component> |
72 | <Component Id="qga_vss_dll" Guid="{CB19C453-FABB-4BB1-ABAB-6B74F687BFBB}"> | 72 | <Component Id="qga_vss_dll" Guid="{CB19C453-FABB-4BB1-ABAB-6B74F687BFBB}"> |
73 | - <File Id="qga_vss.dll" Name="qga-vss.dll" Source="$(env.BUILD_DIR)/qga/vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/> | 73 | - <File Id="qga_vss.dll" Name="qga-vss.dll" Source="$(env.BUILD_DIR)/qga/vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/> |
74 | + <File Id="qga_vss.dll" Name="qga-vss.dll" Source="$(var.BUILD_DIR)/qga/vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/> | 74 | + <File Id="qga_vss.dll" Name="qga-vss.dll" Source="$(var.BUILD_DIR)/qga/vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/> |
75 | </Component> | 75 | </Component> |
76 | <Component Id="qga_vss_tlb" Guid="{D8D584B1-59C2-4FB7-A91F-636FF7BFA66E}"> | 76 | <Component Id="qga_vss_tlb" Guid="{D8D584B1-59C2-4FB7-A91F-636FF7BFA66E}"> |
77 | - <File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="$(env.BUILD_DIR)/qga/vss-win32/qga-vss.tlb" KeyPath="yes" DiskId="1"/> | 77 | - <File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="$(env.BUILD_DIR)/qga/vss-win32/qga-vss.tlb" KeyPath="yes" DiskId="1"/> |
78 | + <File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="$(var.BUILD_DIR)/qga/vss-win32/qga-vss.tlb" KeyPath="yes" DiskId="1"/> | 78 | + <File Id="qga_vss.tlb" Name="qga-vss.tlb" Source="$(var.BUILD_DIR)/qga/vss-win32/qga-vss.tlb" KeyPath="yes" DiskId="1"/> |
79 | </Component> | 79 | </Component> |
80 | <?endif?> | 80 | <?endif?> |
81 | <?if $(var.Arch) = "32"?> | 81 | <?if $(var.Arch) = "32"?> |
82 | @@ -XXX,XX +XXX,XX @@ | 82 | @@ -XXX,XX +XXX,XX @@ |
83 | </Component> | 83 | </Component> |
84 | <Component Id="registry_entries" Guid="{D075D109-51CA-11E3-9F8B-000C29858960}"> | 84 | <Component Id="registry_entries" Guid="{D075D109-51CA-11E3-9F8B-000C29858960}"> |
85 | <RegistryKey Root="HKLM" | 85 | <RegistryKey Root="HKLM" |
86 | - Key="Software\$(env.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA"> | 86 | - Key="Software\$(env.QEMU_GA_MANUFACTURER)\$(env.QEMU_GA_DISTRO)\Tools\QemuGA"> |
87 | + Key="Software\$(var.QEMU_GA_MANUFACTURER)\$(var.QEMU_GA_DISTRO)\Tools\QemuGA"> | 87 | + Key="Software\$(var.QEMU_GA_MANUFACTURER)\$(var.QEMU_GA_DISTRO)\Tools\QemuGA"> |
88 | <RegistryValue Type="string" Name="ProductID" Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" /> | 88 | <RegistryValue Type="string" Name="ProductID" Value="fb0a0d66-c7fb-4e2e-a16b-c4a3bfe8d13b" /> |
89 | - <RegistryValue Type="string" Name="Version" Value="$(env.QEMU_GA_VERSION)" /> | 89 | - <RegistryValue Type="string" Name="Version" Value="$(env.QEMU_GA_VERSION)" /> |
90 | + <RegistryValue Type="string" Name="Version" Value="$(var.QEMU_GA_VERSION)" /> | 90 | + <RegistryValue Type="string" Name="Version" Value="$(var.QEMU_GA_VERSION)" /> |
91 | </RegistryKey> | 91 | </RegistryKey> |
92 | </Component> | 92 | </Component> |
93 | </Directory> | 93 | </Directory> |
94 | diff --git a/qga/meson.build b/qga/meson.build | 94 | diff --git a/qga/meson.build b/qga/meson.build |
95 | index XXXXXXX..XXXXXXX 100644 | 95 | index XXXXXXX..XXXXXXX 100644 |
96 | --- a/qga/meson.build | 96 | --- a/qga/meson.build |
97 | +++ b/qga/meson.build | 97 | +++ b/qga/meson.build |
98 | @@ -XXX,XX +XXX,XX @@ if targetos == 'windows' | 98 | @@ -XXX,XX +XXX,XX @@ if targetos == 'windows' |
99 | output: 'qemu-ga-@0@.msi'.format(host_arch), | 99 | output: 'qemu-ga-@0@.msi'.format(host_arch), |
100 | depends: deps, | 100 | depends: deps, |
101 | command: [ | 101 | command: [ |
102 | - find_program('env'), | 102 | - find_program('env'), |
103 | - 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'], | 103 | - 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'], |
104 | - 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'], | 104 | - 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'], |
105 | - 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'], | 105 | - 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'], |
106 | - 'BUILD_DIR=' + meson.build_root(), | 106 | - 'BUILD_DIR=' + meson.build_root(), |
107 | wixl, '-o', '@OUTPUT0@', '@INPUT0@', | 107 | wixl, '-o', '@OUTPUT0@', '@INPUT0@', |
108 | qemu_ga_msi_arch[cpu], | 108 | qemu_ga_msi_arch[cpu], |
109 | qemu_ga_msi_vss, | 109 | qemu_ga_msi_vss, |
110 | + '-D', 'BUILD_DIR=' + meson.build_root(), | 110 | + '-D', 'BUILD_DIR=' + meson.build_root(), |
111 | '-D', 'Mingw_bin=' + config_host['QEMU_GA_MSI_MINGW_BIN_PATH'], | 111 | '-D', 'Mingw_bin=' + config_host['QEMU_GA_MSI_MINGW_BIN_PATH'], |
112 | + '-D', 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'], | 112 | + '-D', 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'], |
113 | + '-D', 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'], | 113 | + '-D', 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'], |
114 | + '-D', 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'], | 114 | + '-D', 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'], |
115 | ]) | 115 | ]) |
116 | all_qga += [qga_msi] | 116 | all_qga += [qga_msi] |
117 | alias_target('msi', qga_msi) | 117 | alias_target('msi', qga_msi) |
118 | -- | 118 | -- |
119 | 2.36.1 | 119 | 2.36.1 |
120 | 120 | ||
121 | 121 | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | No clear reason to make guesses here. | 3 | No clear reason to make guesses here. |
4 | 4 | ||
5 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 5 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
6 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> | 6 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> |
7 | --- | 7 | --- |
8 | qga/installer/qemu-ga.wxs | 9 --------- | 8 | qga/installer/qemu-ga.wxs | 9 --------- |
9 | 1 file changed, 9 deletions(-) | 9 | 1 file changed, 9 deletions(-) |
10 | 10 | ||
11 | diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs | 11 | diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs |
12 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/qga/installer/qemu-ga.wxs | 13 | --- a/qga/installer/qemu-ga.wxs |
14 | +++ b/qga/installer/qemu-ga.wxs | 14 | +++ b/qga/installer/qemu-ga.wxs |
15 | @@ -XXX,XX +XXX,XX @@ | 15 | @@ -XXX,XX +XXX,XX @@ |
16 | <?error Define Arch to 32 or 64?> | 16 | <?error Define Arch to 32 or 64?> |
17 | <?endif?> | 17 | <?endif?> |
18 | 18 | ||
19 | - <?ifndef var.Mingw_bin?> | 19 | - <?ifndef var.Mingw_bin?> |
20 | - <?if $(var.Arch) = "64"?> | 20 | - <?if $(var.Arch) = "64"?> |
21 | - <?define Mingw_bin=/usr/x86_64-w64-mingw32/sys-root/mingw/bin ?> | 21 | - <?define Mingw_bin=/usr/x86_64-w64-mingw32/sys-root/mingw/bin ?> |
22 | - <?endif?> | 22 | - <?endif?> |
23 | - <?if $(var.Arch) = "32"?> | 23 | - <?if $(var.Arch) = "32"?> |
24 | - <?define Mingw_bin=/usr/i686-w64-mingw32/sys-root/mingw/bin ?> | 24 | - <?define Mingw_bin=/usr/i686-w64-mingw32/sys-root/mingw/bin ?> |
25 | - <?endif?> | 25 | - <?endif?> |
26 | - <?endif?> | 26 | - <?endif?> |
27 | - | 27 | - |
28 | <?if $(var.Arch) = "64"?> | 28 | <?if $(var.Arch) = "64"?> |
29 | <?define ArchLib=libgcc_s_seh-1.dll?> | 29 | <?define ArchLib=libgcc_s_seh-1.dll?> |
30 | <?define GaProgramFilesFolder="ProgramFiles64Folder" ?> | 30 | <?define GaProgramFilesFolder="ProgramFiles64Folder" ?> |
31 | -- | 31 | -- |
32 | 2.36.1 | 32 | 2.36.1 |
33 | 33 | ||
34 | 34 | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Sadly, wixl doesn't have 'elif'. | 3 | Sadly, wixl doesn't have 'elif'. |
4 | 4 | ||
5 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 5 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
6 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> | 6 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> |
7 | --- | 7 | --- |
8 | qga/installer/qemu-ga.wxs | 20 +++++++------------- | 8 | qga/installer/qemu-ga.wxs | 20 +++++++------------- |
9 | 1 file changed, 7 insertions(+), 13 deletions(-) | 9 | 1 file changed, 7 insertions(+), 13 deletions(-) |
10 | 10 | ||
11 | diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs | 11 | diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs |
12 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/qga/installer/qemu-ga.wxs | 13 | --- a/qga/installer/qemu-ga.wxs |
14 | +++ b/qga/installer/qemu-ga.wxs | 14 | +++ b/qga/installer/qemu-ga.wxs |
15 | @@ -XXX,XX +XXX,XX @@ | 15 | @@ -XXX,XX +XXX,XX @@ |
16 | <?xml version="1.0" encoding="UTF-8"?> | 16 | <?xml version="1.0" encoding="UTF-8"?> |
17 | <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | 17 | <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> |
18 | - <?ifndef var.Arch?> | 18 | - <?ifndef var.Arch?> |
19 | - <?error Define Arch to 32 or 64?> | 19 | - <?error Define Arch to 32 or 64?> |
20 | - <?endif?> | 20 | - <?endif?> |
21 | - | 21 | - |
22 | <?if $(var.Arch) = "64"?> | 22 | <?if $(var.Arch) = "64"?> |
23 | <?define ArchLib=libgcc_s_seh-1.dll?> | 23 | <?define ArchLib=libgcc_s_seh-1.dll?> |
24 | <?define GaProgramFilesFolder="ProgramFiles64Folder" ?> | 24 | <?define GaProgramFilesFolder="ProgramFiles64Folder" ?> |
25 | - <?endif?> | 25 | - <?endif?> |
26 | - | 26 | - |
27 | - <?if $(var.Arch) = "32"?> | 27 | - <?if $(var.Arch) = "32"?> |
28 | - <?define ArchLib=libgcc_s_dw2-1.dll?> | 28 | - <?define ArchLib=libgcc_s_dw2-1.dll?> |
29 | - <?define GaProgramFilesFolder="ProgramFilesFolder" ?> | 29 | - <?define GaProgramFilesFolder="ProgramFilesFolder" ?> |
30 | - <?endif?> | 30 | - <?endif?> |
31 | - | 31 | - |
32 | - <?ifndef var.ArchLib ?> | 32 | - <?ifndef var.ArchLib ?> |
33 | - <?error Unexpected Arch value $(var.Arch)?> | 33 | - <?error Unexpected Arch value $(var.Arch)?> |
34 | + <?else?> | 34 | + <?else?> |
35 | + <?if $(var.Arch) = "32"?> | 35 | + <?if $(var.Arch) = "32"?> |
36 | + <?define ArchLib=libgcc_s_dw2-1.dll?> | 36 | + <?define ArchLib=libgcc_s_dw2-1.dll?> |
37 | + <?define GaProgramFilesFolder="ProgramFilesFolder" ?> | 37 | + <?define GaProgramFilesFolder="ProgramFilesFolder" ?> |
38 | + <?else?> | 38 | + <?else?> |
39 | + <?error Unexpected Arch value $(var.Arch)?> | 39 | + <?error Unexpected Arch value $(var.Arch)?> |
40 | + <?endif?> | 40 | + <?endif?> |
41 | <?endif?> | 41 | <?endif?> |
42 | 42 | ||
43 | <Product | 43 | <Product |
44 | -- | 44 | -- |
45 | 2.36.1 | 45 | 2.36.1 |
46 | 46 | ||
47 | 47 | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Use more conventional variables to set the location of pre-built | 3 | Use more conventional variables to set the location of pre-built |
4 | DLL/bin. | 4 | DLL/bin. |
5 | 5 | ||
6 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 6 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
7 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> | 7 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> |
8 | --- | 8 | --- |
9 | configure | 9 ++++++--- | 9 | configure | 9 ++++++--- |
10 | meson.build | 5 ++++- | 10 | meson.build | 5 ++++- |
11 | qga/installer/qemu-ga.wxs | 24 ++++++++++++------------ | 11 | qga/installer/qemu-ga.wxs | 24 ++++++++++++------------ |
12 | qga/meson.build | 2 +- | 12 | qga/meson.build | 2 +- |
13 | 4 files changed, 23 insertions(+), 17 deletions(-) | 13 | 4 files changed, 23 insertions(+), 17 deletions(-) |
14 | 14 | ||
15 | diff --git a/configure b/configure | 15 | diff --git a/configure b/configure |
16 | index XXXXXXX..XXXXXXX 100755 | 16 | index XXXXXXX..XXXXXXX 100755 |
17 | --- a/configure | 17 | --- a/configure |
18 | +++ b/configure | 18 | +++ b/configure |
19 | @@ -XXX,XX +XXX,XX @@ for i in $glib_modules; do | 19 | @@ -XXX,XX +XXX,XX @@ for i in $glib_modules; do |
20 | fi | 20 | fi |
21 | done | 21 | done |
22 | 22 | ||
23 | +glib_bindir="$($pkg_config --variable=bindir glib-2.0)" | 23 | +glib_bindir="$($pkg_config --variable=bindir glib-2.0)" |
24 | +if test -z "$glib_bindir" ; then | 24 | +if test -z "$glib_bindir" ; then |
25 | + glib_bindir="$($pkg_config --variable=prefix glib-2.0)"/bin | 25 | + glib_bindir="$($pkg_config --variable=prefix glib-2.0)"/bin |
26 | +fi | 26 | +fi |
27 | + | 27 | + |
28 | # This workaround is required due to a bug in pkg-config file for glib as it | 28 | # This workaround is required due to a bug in pkg-config file for glib as it |
29 | # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static | 29 | # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static |
30 | 30 | ||
31 | @@ -XXX,XX +XXX,XX @@ if test "$QEMU_GA_VERSION" = ""; then | 31 | @@ -XXX,XX +XXX,XX @@ if test "$QEMU_GA_VERSION" = ""; then |
32 | QEMU_GA_VERSION=$(cat $source_path/VERSION) | 32 | QEMU_GA_VERSION=$(cat $source_path/VERSION) |
33 | fi | 33 | fi |
34 | 34 | ||
35 | -QEMU_GA_MSI_MINGW_BIN_PATH="$($pkg_config --variable=prefix glib-2.0)/bin" | 35 | -QEMU_GA_MSI_MINGW_BIN_PATH="$($pkg_config --variable=prefix glib-2.0)/bin" |
36 | - | 36 | - |
37 | # Mac OS X ships with a broken assembler | 37 | # Mac OS X ships with a broken assembler |
38 | roms= | 38 | roms= |
39 | if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ | 39 | if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ |
40 | @@ -XXX,XX +XXX,XX @@ if test "$debug_tcg" = "yes" ; then | 40 | @@ -XXX,XX +XXX,XX @@ if test "$debug_tcg" = "yes" ; then |
41 | fi | 41 | fi |
42 | if test "$mingw32" = "yes" ; then | 42 | if test "$mingw32" = "yes" ; then |
43 | echo "CONFIG_WIN32=y" >> $config_host_mak | 43 | echo "CONFIG_WIN32=y" >> $config_host_mak |
44 | - echo "QEMU_GA_MSI_MINGW_BIN_PATH=${QEMU_GA_MSI_MINGW_BIN_PATH}" >> $config_host_mak | 44 | - echo "QEMU_GA_MSI_MINGW_BIN_PATH=${QEMU_GA_MSI_MINGW_BIN_PATH}" >> $config_host_mak |
45 | echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak | 45 | echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak |
46 | echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak | 46 | echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak |
47 | echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak | 47 | echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak |
48 | @@ -XXX,XX +XXX,XX @@ echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak | 48 | @@ -XXX,XX +XXX,XX @@ echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak |
49 | echo "QEMU_OBJCFLAGS=$QEMU_OBJCFLAGS" >> $config_host_mak | 49 | echo "QEMU_OBJCFLAGS=$QEMU_OBJCFLAGS" >> $config_host_mak |
50 | echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak | 50 | echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak |
51 | echo "GLIB_LIBS=$glib_libs" >> $config_host_mak | 51 | echo "GLIB_LIBS=$glib_libs" >> $config_host_mak |
52 | +echo "GLIB_BINDIR=$glib_bindir" >> $config_host_mak | 52 | +echo "GLIB_BINDIR=$glib_bindir" >> $config_host_mak |
53 | echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak | 53 | echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak |
54 | echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak | 54 | echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak |
55 | echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak | 55 | echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak |
56 | diff --git a/meson.build b/meson.build | 56 | diff --git a/meson.build b/meson.build |
57 | index XXXXXXX..XXXXXXX 100644 | 57 | index XXXXXXX..XXXXXXX 100644 |
58 | --- a/meson.build | 58 | --- a/meson.build |
59 | +++ b/meson.build | 59 | +++ b/meson.build |
60 | @@ -XXX,XX +XXX,XX @@ add_project_arguments(config_host['GLIB_CFLAGS'].split(), | 60 | @@ -XXX,XX +XXX,XX @@ add_project_arguments(config_host['GLIB_CFLAGS'].split(), |
61 | native: false, language: ['c', 'cpp', 'objc']) | 61 | native: false, language: ['c', 'cpp', 'objc']) |
62 | glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(), | 62 | glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(), |
63 | link_args: config_host['GLIB_LIBS'].split(), | 63 | link_args: config_host['GLIB_LIBS'].split(), |
64 | - version: config_host['GLIB_VERSION']) | 64 | - version: config_host['GLIB_VERSION']) |
65 | + version: config_host['GLIB_VERSION'], | 65 | + version: config_host['GLIB_VERSION'], |
66 | + variables: { | 66 | + variables: { |
67 | + 'bindir': config_host['GLIB_BINDIR'], | 67 | + 'bindir': config_host['GLIB_BINDIR'], |
68 | + }) | 68 | + }) |
69 | # override glib dep with the configure results (for subprojects) | 69 | # override glib dep with the configure results (for subprojects) |
70 | meson.override_dependency('glib-2.0', glib) | 70 | meson.override_dependency('glib-2.0', glib) |
71 | 71 | ||
72 | diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs | 72 | diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs |
73 | index XXXXXXX..XXXXXXX 100644 | 73 | index XXXXXXX..XXXXXXX 100644 |
74 | --- a/qga/installer/qemu-ga.wxs | 74 | --- a/qga/installer/qemu-ga.wxs |
75 | +++ b/qga/installer/qemu-ga.wxs | 75 | +++ b/qga/installer/qemu-ga.wxs |
76 | @@ -XXX,XX +XXX,XX @@ | 76 | @@ -XXX,XX +XXX,XX @@ |
77 | </Component> | 77 | </Component> |
78 | <?ifdef var.InstallVss?> | 78 | <?ifdef var.InstallVss?> |
79 | <Component Id="libstdc++_6_lib" Guid="{55E737B5-9127-4A11-9FC3-A29367714574}"> | 79 | <Component Id="libstdc++_6_lib" Guid="{55E737B5-9127-4A11-9FC3-A29367714574}"> |
80 | - <File Id="libstdc++-6.lib" Name="libstdc++-6.dll" Source="$(var.Mingw_bin)/libstdc++-6.dll" KeyPath="yes" DiskId="1"/> | 80 | - <File Id="libstdc++-6.lib" Name="libstdc++-6.dll" Source="$(var.Mingw_bin)/libstdc++-6.dll" KeyPath="yes" DiskId="1"/> |
81 | + <File Id="libstdc++-6.lib" Name="libstdc++-6.dll" Source="$(var.BIN_DIR)/libstdc++-6.dll" KeyPath="yes" DiskId="1"/> | 81 | + <File Id="libstdc++-6.lib" Name="libstdc++-6.dll" Source="$(var.BIN_DIR)/libstdc++-6.dll" KeyPath="yes" DiskId="1"/> |
82 | </Component> | 82 | </Component> |
83 | <Component Id="qga_vss_dll" Guid="{CB19C453-FABB-4BB1-ABAB-6B74F687BFBB}"> | 83 | <Component Id="qga_vss_dll" Guid="{CB19C453-FABB-4BB1-ABAB-6B74F687BFBB}"> |
84 | <File Id="qga_vss.dll" Name="qga-vss.dll" Source="$(var.BUILD_DIR)/qga/vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/> | 84 | <File Id="qga_vss.dll" Name="qga-vss.dll" Source="$(var.BUILD_DIR)/qga/vss-win32/qga-vss.dll" KeyPath="yes" DiskId="1"/> |
85 | @@ -XXX,XX +XXX,XX @@ | 85 | @@ -XXX,XX +XXX,XX @@ |
86 | <?endif?> | 86 | <?endif?> |
87 | <?if $(var.Arch) = "32"?> | 87 | <?if $(var.Arch) = "32"?> |
88 | <Component Id="gspawn-helper-console" Guid="{446185B3-87BE-43D2-96B8-0FEFD9E8696D}"> | 88 | <Component Id="gspawn-helper-console" Guid="{446185B3-87BE-43D2-96B8-0FEFD9E8696D}"> |
89 | - <File Id="gspawn-win32-helper-console.exe" Name="gspawn-win32-helper-console.exe" Source="$(var.Mingw_bin)/gspawn-win32-helper-console.exe" KeyPath="yes" DiskId="1"/> | 89 | - <File Id="gspawn-win32-helper-console.exe" Name="gspawn-win32-helper-console.exe" Source="$(var.Mingw_bin)/gspawn-win32-helper-console.exe" KeyPath="yes" DiskId="1"/> |
90 | + <File Id="gspawn-win32-helper-console.exe" Name="gspawn-win32-helper-console.exe" Source="$(var.BIN_DIR)/gspawn-win32-helper-console.exe" KeyPath="yes" DiskId="1"/> | 90 | + <File Id="gspawn-win32-helper-console.exe" Name="gspawn-win32-helper-console.exe" Source="$(var.BIN_DIR)/gspawn-win32-helper-console.exe" KeyPath="yes" DiskId="1"/> |
91 | </Component> | 91 | </Component> |
92 | <Component Id="gspawn-helper" Guid="{CD67A5A3-2DB1-4DA1-A67A-8D71E797B466}"> | 92 | <Component Id="gspawn-helper" Guid="{CD67A5A3-2DB1-4DA1-A67A-8D71E797B466}"> |
93 | - <File Id="gspawn-win32-helper.exe" Name="gspawn-win32-helper.exe" Source="$(var.Mingw_bin)/gspawn-win32-helper-console.exe" KeyPath="yes" DiskId="1"/> | 93 | - <File Id="gspawn-win32-helper.exe" Name="gspawn-win32-helper.exe" Source="$(var.Mingw_bin)/gspawn-win32-helper-console.exe" KeyPath="yes" DiskId="1"/> |
94 | + <File Id="gspawn-win32-helper.exe" Name="gspawn-win32-helper.exe" Source="$(var.BIN_DIR)/gspawn-win32-helper-console.exe" KeyPath="yes" DiskId="1"/> | 94 | + <File Id="gspawn-win32-helper.exe" Name="gspawn-win32-helper.exe" Source="$(var.BIN_DIR)/gspawn-win32-helper-console.exe" KeyPath="yes" DiskId="1"/> |
95 | </Component> | 95 | </Component> |
96 | <?endif?> | 96 | <?endif?> |
97 | <?if $(var.Arch) = "64"?> | 97 | <?if $(var.Arch) = "64"?> |
98 | <Component Id="gspawn-helper-console" Guid="{9E615A9F-349A-4992-A5C2-C10BAD173660}"> | 98 | <Component Id="gspawn-helper-console" Guid="{9E615A9F-349A-4992-A5C2-C10BAD173660}"> |
99 | - <File Id="gspawn-win64-helper-console.exe" Name="gspawn-win64-helper-console.exe" Source="$(var.Mingw_bin)/gspawn-win64-helper-console.exe" KeyPath="yes" DiskId="1"/> | 99 | - <File Id="gspawn-win64-helper-console.exe" Name="gspawn-win64-helper-console.exe" Source="$(var.Mingw_bin)/gspawn-win64-helper-console.exe" KeyPath="yes" DiskId="1"/> |
100 | + <File Id="gspawn-win64-helper-console.exe" Name="gspawn-win64-helper-console.exe" Source="$(var.BIN_DIR)/gspawn-win64-helper-console.exe" KeyPath="yes" DiskId="1"/> | 100 | + <File Id="gspawn-win64-helper-console.exe" Name="gspawn-win64-helper-console.exe" Source="$(var.BIN_DIR)/gspawn-win64-helper-console.exe" KeyPath="yes" DiskId="1"/> |
101 | </Component> | 101 | </Component> |
102 | <Component Id="gspawn-helper" Guid="{D201AD22-1846-4E4F-B6E1-C7A908ED2457}"> | 102 | <Component Id="gspawn-helper" Guid="{D201AD22-1846-4E4F-B6E1-C7A908ED2457}"> |
103 | - <File Id="gspawn-win64-helper.exe" Name="gspawn-win64-helper.exe" Source="$(var.Mingw_bin)/gspawn-win64-helper-console.exe" KeyPath="yes" DiskId="1"/> | 103 | - <File Id="gspawn-win64-helper.exe" Name="gspawn-win64-helper.exe" Source="$(var.Mingw_bin)/gspawn-win64-helper-console.exe" KeyPath="yes" DiskId="1"/> |
104 | + <File Id="gspawn-win64-helper.exe" Name="gspawn-win64-helper.exe" Source="$(var.BIN_DIR)/gspawn-win64-helper-console.exe" KeyPath="yes" DiskId="1"/> | 104 | + <File Id="gspawn-win64-helper.exe" Name="gspawn-win64-helper.exe" Source="$(var.BIN_DIR)/gspawn-win64-helper-console.exe" KeyPath="yes" DiskId="1"/> |
105 | </Component> | 105 | </Component> |
106 | <?endif?> | 106 | <?endif?> |
107 | <Component Id="iconv" Guid="{35EE3558-D34B-4F0A-B8BD-430FF0775246}"> | 107 | <Component Id="iconv" Guid="{35EE3558-D34B-4F0A-B8BD-430FF0775246}"> |
108 | - <File Id="iconv.dll" Name="iconv.dll" Source="$(var.Mingw_bin)/iconv.dll" KeyPath="yes" DiskId="1"/> | 108 | - <File Id="iconv.dll" Name="iconv.dll" Source="$(var.Mingw_bin)/iconv.dll" KeyPath="yes" DiskId="1"/> |
109 | + <File Id="iconv.dll" Name="iconv.dll" Source="$(var.BIN_DIR)/iconv.dll" KeyPath="yes" DiskId="1"/> | 109 | + <File Id="iconv.dll" Name="iconv.dll" Source="$(var.BIN_DIR)/iconv.dll" KeyPath="yes" DiskId="1"/> |
110 | </Component> | 110 | </Component> |
111 | <Component Id="libgcc_arch_lib" Guid="{ADD4D07D-4515-4AB6-AF3E-C904961B4BB0}"> | 111 | <Component Id="libgcc_arch_lib" Guid="{ADD4D07D-4515-4AB6-AF3E-C904961B4BB0}"> |
112 | - <File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.Mingw_bin)/$(var.ArchLib)" KeyPath="yes" DiskId="1"/> | 112 | - <File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.Mingw_bin)/$(var.ArchLib)" KeyPath="yes" DiskId="1"/> |
113 | + <File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.BIN_DIR)/$(var.ArchLib)" KeyPath="yes" DiskId="1"/> | 113 | + <File Id="libgcc_arch_lib" Name="$(var.ArchLib)" Source="$(var.BIN_DIR)/$(var.ArchLib)" KeyPath="yes" DiskId="1"/> |
114 | </Component> | 114 | </Component> |
115 | <Component Id="libglib" Guid="{D31BFD83-2773-4B65-B45A-E0D2ADA58679}"> | 115 | <Component Id="libglib" Guid="{D31BFD83-2773-4B65-B45A-E0D2ADA58679}"> |
116 | - <File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.Mingw_bin)/libglib-2.0-0.dll" KeyPath="yes" DiskId="1"/> | 116 | - <File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.Mingw_bin)/libglib-2.0-0.dll" KeyPath="yes" DiskId="1"/> |
117 | + <File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.BIN_DIR)/libglib-2.0-0.dll" KeyPath="yes" DiskId="1"/> | 117 | + <File Id="libglib_2.0_0.dll" Name="libglib-2.0-0.dll" Source="$(var.BIN_DIR)/libglib-2.0-0.dll" KeyPath="yes" DiskId="1"/> |
118 | </Component> | 118 | </Component> |
119 | <Component Id="libintl" Guid="{A641BC2D-A907-4A94-9149-F30ED430878F}"> | 119 | <Component Id="libintl" Guid="{A641BC2D-A907-4A94-9149-F30ED430878F}"> |
120 | - <File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.Mingw_bin)/libintl-8.dll" KeyPath="yes" DiskId="1"/> | 120 | - <File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.Mingw_bin)/libintl-8.dll" KeyPath="yes" DiskId="1"/> |
121 | + <File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.BIN_DIR)/libintl-8.dll" KeyPath="yes" DiskId="1"/> | 121 | + <File Id="libintl_8.dll" Name="libintl-8.dll" Source="$(var.BIN_DIR)/libintl-8.dll" KeyPath="yes" DiskId="1"/> |
122 | </Component> | 122 | </Component> |
123 | <Component Id="libssp" Guid="{7880087B-02B4-4EF6-A5D3-D18F8E3D90E1}"> | 123 | <Component Id="libssp" Guid="{7880087B-02B4-4EF6-A5D3-D18F8E3D90E1}"> |
124 | - <File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.Mingw_bin)/libssp-0.dll" KeyPath="yes" DiskId="1"/> | 124 | - <File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.Mingw_bin)/libssp-0.dll" KeyPath="yes" DiskId="1"/> |
125 | + <File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.BIN_DIR)/libssp-0.dll" KeyPath="yes" DiskId="1"/> | 125 | + <File Id="libssp_0.dll" Name="libssp-0.dll" Source="$(var.BIN_DIR)/libssp-0.dll" KeyPath="yes" DiskId="1"/> |
126 | </Component> | 126 | </Component> |
127 | <Component Id="libwinpthread" Guid="{6C117C78-0F47-4B07-8F34-6BEE11643829}"> | 127 | <Component Id="libwinpthread" Guid="{6C117C78-0F47-4B07-8F34-6BEE11643829}"> |
128 | - <File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.Mingw_bin)/libwinpthread-1.dll" KeyPath="yes" DiskId="1"/> | 128 | - <File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.Mingw_bin)/libwinpthread-1.dll" KeyPath="yes" DiskId="1"/> |
129 | + <File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.BIN_DIR)/libwinpthread-1.dll" KeyPath="yes" DiskId="1"/> | 129 | + <File Id="libwinpthread_1.dll" Name="libwinpthread-1.dll" Source="$(var.BIN_DIR)/libwinpthread-1.dll" KeyPath="yes" DiskId="1"/> |
130 | </Component> | 130 | </Component> |
131 | <Component Id="libpcre" Guid="{7A86B45E-A009-489A-A849-CE3BACF03CD0}"> | 131 | <Component Id="libpcre" Guid="{7A86B45E-A009-489A-A849-CE3BACF03CD0}"> |
132 | - <File Id="libpcre_1.dll" Name="libpcre-1.dll" Source="$(var.Mingw_bin)/libpcre-1.dll" KeyPath="yes" DiskId="1"/> | 132 | - <File Id="libpcre_1.dll" Name="libpcre-1.dll" Source="$(var.Mingw_bin)/libpcre-1.dll" KeyPath="yes" DiskId="1"/> |
133 | + <File Id="libpcre_1.dll" Name="libpcre-1.dll" Source="$(var.BIN_DIR)/libpcre-1.dll" KeyPath="yes" DiskId="1"/> | 133 | + <File Id="libpcre_1.dll" Name="libpcre-1.dll" Source="$(var.BIN_DIR)/libpcre-1.dll" KeyPath="yes" DiskId="1"/> |
134 | </Component> | 134 | </Component> |
135 | <Component Id="registry_entries" Guid="{D075D109-51CA-11E3-9F8B-000C29858960}"> | 135 | <Component Id="registry_entries" Guid="{D075D109-51CA-11E3-9F8B-000C29858960}"> |
136 | <RegistryKey Root="HKLM" | 136 | <RegistryKey Root="HKLM" |
137 | diff --git a/qga/meson.build b/qga/meson.build | 137 | diff --git a/qga/meson.build b/qga/meson.build |
138 | index XXXXXXX..XXXXXXX 100644 | 138 | index XXXXXXX..XXXXXXX 100644 |
139 | --- a/qga/meson.build | 139 | --- a/qga/meson.build |
140 | +++ b/qga/meson.build | 140 | +++ b/qga/meson.build |
141 | @@ -XXX,XX +XXX,XX @@ if targetos == 'windows' | 141 | @@ -XXX,XX +XXX,XX @@ if targetos == 'windows' |
142 | qemu_ga_msi_arch[cpu], | 142 | qemu_ga_msi_arch[cpu], |
143 | qemu_ga_msi_vss, | 143 | qemu_ga_msi_vss, |
144 | '-D', 'BUILD_DIR=' + meson.build_root(), | 144 | '-D', 'BUILD_DIR=' + meson.build_root(), |
145 | - '-D', 'Mingw_bin=' + config_host['QEMU_GA_MSI_MINGW_BIN_PATH'], | 145 | - '-D', 'Mingw_bin=' + config_host['QEMU_GA_MSI_MINGW_BIN_PATH'], |
146 | + '-D', 'BIN_DIR=' + glib.get_variable('bindir'), | 146 | + '-D', 'BIN_DIR=' + glib.get_variable('bindir'), |
147 | '-D', 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'], | 147 | '-D', 'QEMU_GA_VERSION=' + config_host['QEMU_GA_VERSION'], |
148 | '-D', 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'], | 148 | '-D', 'QEMU_GA_MANUFACTURER=' + config_host['QEMU_GA_MANUFACTURER'], |
149 | '-D', 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'], | 149 | '-D', 'QEMU_GA_DISTRO=' + config_host['QEMU_GA_DISTRO'], |
150 | -- | 150 | -- |
151 | 2.36.1 | 151 | 2.36.1 |
152 | 152 | ||
153 | 153 | diff view generated by jsdifflib |
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | 3 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
4 | Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> | ||
4 | --- | 5 | --- |
5 | tests/unit/test-qga.c | 121 +++++++++++++++--------------------------- | 6 | tests/unit/test-qga.c | 121 +++++++++++++++--------------------------- |
6 | 1 file changed, 43 insertions(+), 78 deletions(-) | 7 | 1 file changed, 43 insertions(+), 78 deletions(-) |
7 | 8 | ||
8 | diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c | 9 | diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c |
... | ... | diff view generated by jsdifflib |