Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1480c1/be196e48c66c9c611126e55759acdb6a to your computer and use it in GitHub Desktop.
Save 1480c1/be196e48c66c9c611126e55759acdb6a to your computer and use it in GitHub Desktop.
libvirt patches
From 031f67b288bf8078c080d36633b7532a666173b2 Mon Sep 17 00:00:00 2001
From: Christopher Degawa <ccom@randomderp.com>
Date: Sat, 4 Mar 2023 21:44:24 -0500
Subject: [PATCH 1/5] meson: template SEARCH_PATH for msys2
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
---
meson.build | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index 319ed790f9..e9bce85a8d 100644
--- a/meson.build
+++ b/meson.build
@@ -728,9 +728,7 @@ conf.set('SIZEOF_LONG', cc.sizeof('long'))
# Where we look for daemons and admin binaries during configure
libvirt_sbin_path = [
- '/sbin',
- '/usr/sbin',
- '/usr/local/sbin',
+ @@SEARCH_PATH@@
]
--
2.39.1.windows.1
From 3f807018447a160b483cef3a85ab04641c57a746 Mon Sep 17 00:00:00 2001
From: Christopher Degawa <ccom@randomderp.com>
Date: Sat, 4 Mar 2023 21:46:41 -0500
Subject: [PATCH 2/5] genprotocol.pl: make rpcgen portable for msys2
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
---
src/rpc/genprotocol.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl
index f567260588..f7cb0b209d 100755
--- a/src/rpc/genprotocol.pl
+++ b/src/rpc/genprotocol.pl
@@ -57,6 +57,8 @@ while (<RPCGEN>) {
# We only want to fixup the GLibc rpcgen output
# So just print data unchanged, if non-Linux
unless ($fixup) {
+ # Fix VPATH builds
+ s,#include ".*/([^/]+)protocol\.h",#include "${1}protocol.h",;
print TARGET;
next;
}
--
2.39.1.windows.1
From 22e3b98edc65516186e4c18b6f2028731349ad19 Mon Sep 17 00:00:00 2001
From: Christopher Degawa <ccom@randomderp.com>
Date: Sat, 4 Mar 2023 22:16:11 -0500
Subject: [PATCH 3/5] virnetlibsshsession: Don't use ssh-agent auth on windows
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
---
src/rpc/virnetlibsshsession.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c
index bba37210df..8e7be0f93a 100644
--- a/src/rpc/virnetlibsshsession.c
+++ b/src/rpc/virnetlibsshsession.c
@@ -703,6 +703,7 @@ virNetLibsshAuthenticate(virNetLibsshSession *sess)
ret = virNetLibsshAuthenticateKeyboardInteractive(sess, auth);
break;
case VIR_NET_LIBSSH_AUTH_AGENT:
+#ifndef _WIN32
/* try to authenticate using ssh-agent */
ret = ssh_userauth_agent(sess->session, NULL);
if (ret == SSH_AUTH_ERROR) {
@@ -711,6 +712,12 @@ virNetLibsshAuthenticate(virNetLibsshSession *sess)
_("failed to authenticate using agent: %s"),
errmsg);
}
+#else
+ /* Windows doesn't support authenticate using ssh-agent */
+ ret = SSH_AUTH_ERROR;
+ errmsg = ssh_get_error(sess->session);
+ virReportError(VIR_ERR_LIBSSH, _("Libssh not support authenticate via ssh-agent on Windows"));
+#endif
break;
case VIR_NET_LIBSSH_AUTH_PRIVKEY:
/* try to authenticate using the provided ssh key */
--
2.39.1.windows.1
From c0ceca8d450753eb838ff4ed698e034d19e69cb8 Mon Sep 17 00:00:00 2001
From: Christopher Degawa <ccom@randomderp.com>
Date: Sat, 4 Mar 2023 22:33:00 -0500
Subject: [PATCH 4/5] meson: remove usage of python3_prog
for all of the scripts with proper shebangs, meson will properly prepend python automatically if needed (like on Windows)
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
---
docs/manpages/meson.build | 4 +--
docs/meson.build | 12 ++++-----
meson.build | 4 +--
src/access/meson.build | 6 ++---
src/admin/meson.build | 4 +--
src/esx/meson.build | 4 +--
src/hyperv/meson.build | 2 +-
src/meson.build | 53 ++++++++++++++++++---------------------
src/network/meson.build | 2 +-
src/qemu/meson.build | 2 +-
src/util/meson.build | 4 +--
tests/meson.build | 2 +-
12 files changed, 47 insertions(+), 52 deletions(-)
diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build
index 84b2e247e9..38f05feced 100644
--- a/docs/manpages/meson.build
+++ b/docs/manpages/meson.build
@@ -49,7 +49,7 @@ foreach name : keycode_list
input: keymap_src_file,
output: 'virkeycode-@0@.rst'.format(name),
command: [
- meson_python_prog, python3_prog, keymap_gen_prog, 'code-docs',
+ meson_python_prog, keymap_gen_prog, 'code-docs',
'--lang', 'rst',
'--title', 'virkeycode-@0@'.format(name),
'--subtitle', 'Key code values for @0@'.format(name),
@@ -70,7 +70,7 @@ foreach name : keyname_list
input: keymap_src_file,
output: 'virkeyname-@0@.rst'.format(name),
command: [
- meson_python_prog, python3_prog, keymap_gen_prog, 'name-docs',
+ meson_python_prog, keymap_gen_prog, 'name-docs',
'--lang', 'rst',
'--title', 'virkeyname-@0@'.format(name),
'--subtitle', 'Key name values for @0@'.format(name),
diff --git a/docs/meson.build b/docs/meson.build
index 864abf0ba5..d5b31a2fad 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -124,13 +124,13 @@ aclperms_gen = custom_target(
input: access_perm_h,
output: 'aclperms.htmlinc',
command: [
- meson_python_prog, python3_prog, genaclperms_prog, '@INPUT@',
+ meson_python_prog, genaclperms_prog, '@INPUT@',
],
capture: true,
)
docs_timestamp = run_command(
- python3_prog, meson_timestamp_prog.full_path(), env: runutf8, check: true,
+ meson_timestamp_prog.full_path(), env: runutf8, check: true,
).stdout().strip()
site_xsl = files('site.xsl')
@@ -146,7 +146,7 @@ docs_api_generated = custom_target(
'libvirt-admin-api.xml',
],
command: [
- meson_python_prog, python3_prog, apibuild_prog,
+ meson_python_prog, apibuild_prog,
meson.current_source_dir(),
meson.current_build_dir(),
],
@@ -266,7 +266,6 @@ hvsupport_html_in = custom_target(
output: 'hvsupport.html.in',
command: [
meson_python_prog,
- python3_prog,
hvsupport_prog,
meson.project_source_root(),
meson.project_build_root(),
@@ -353,7 +352,7 @@ endforeach
run_target(
'install-web',
command: [
- meson_python_prog, python3_prog.full_path(), meson_install_web_prog.full_path(),
+ meson_python_prog, meson_install_web_prog,
install_web_files,
],
depends: install_web_deps,
@@ -361,9 +360,8 @@ run_target(
test(
'check-html-references',
- python3_prog,
+ check_html_references_prog,
args: [
- check_html_references_prog.full_path(),
'--webroot',
meson.project_build_root() / 'docs'
],
diff --git a/meson.build b/meson.build
index e9bce85a8d..f3e00ac86f 100644
--- a/meson.build
+++ b/meson.build
@@ -2079,7 +2079,7 @@ if git
configuration: spec_conf,
)
- authors = run_command(python3_prog, meson_gen_authors_prog.full_path(),
+ authors = run_command(meson_gen_authors_prog.full_path(),
env: runutf8, check: true)
authors_file = 'AUTHORS.rst.in'
@@ -2101,7 +2101,7 @@ if git
foreach file : dist_files
meson.add_dist_script(
- meson_python_prog.full_path(), python3_prog.full_path(), meson_dist_prog.full_path(),
+ meson_python_prog.full_path(), meson_dist_prog.full_path(),
meson.project_build_root(), file
)
endforeach
diff --git a/src/access/meson.build b/src/access/meson.build
index 07c703e8b5..b291f1a8db 100644
--- a/src/access/meson.build
+++ b/src/access/meson.build
@@ -70,7 +70,7 @@ if conf.has('WITH_POLKIT')
'org.libvirt.api.policy',
input: access_perm_h,
output: 'org.libvirt.api.policy',
- command: [ meson_python_prog, python3_prog, genpolkit_prog, '@INPUT@' ],
+ command: [ meson_python_prog, genpolkit_prog, '@INPUT@' ],
capture: true,
install: true,
install_dir: datadir / 'polkit-1' / 'actions',
@@ -107,7 +107,7 @@ generated_sym_files += access_gen_sym
test(
'check-aclperms',
- python3_prog,
- args: [ check_aclperms_prog.full_path(), access_perm_h, files('viraccessperm.c') ],
+ check_aclperms_prog,
+ args: [ access_perm_h, files('viraccessperm.c') ],
env: runutf8,
)
diff --git a/src/admin/meson.build b/src/admin/meson.build
index 692cc128a3..5972c6b1ef 100644
--- a/src/admin/meson.build
+++ b/src/admin/meson.build
@@ -68,7 +68,7 @@ libvirt_admin_syms = custom_target(
],
output: 'libvirt_admin.syms',
command: [
- meson_python_prog, python3_prog, meson_gen_sym_prog,
+ meson_python_prog, meson_gen_sym_prog,
'@OUTPUT@', 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPUT@',
],
)
@@ -79,7 +79,7 @@ if host_machine.system() == 'windows'
input: libvirt_admin_syms,
output: 'libvirt_admin.def',
command: [
- meson_python_prog, python3_prog, meson_gen_def_prog,
+ meson_python_prog, meson_gen_def_prog,
'@INPUT@', '@OUTPUT@',
],
)
diff --git a/src/esx/meson.build b/src/esx/meson.build
index d1f42fdcc4..7c727670d4 100644
--- a/src/esx/meson.build
+++ b/src/esx/meson.build
@@ -25,7 +25,7 @@ esx_gen_headers = custom_target(
'esx_vi_types.generated.typeenum',
],
command: [
- meson_python_prog, python3_prog, esx_vi_generator_prog,
+ meson_python_prog, esx_vi_generator_prog,
meson.project_source_root() / 'src',
meson.project_build_root() / 'src',
'header',
@@ -46,7 +46,7 @@ esx_gen_sources = custom_target(
'esx_vi_types.generated.typetostring',
],
command: [
- meson_python_prog, python3_prog, esx_vi_generator_prog,
+ meson_python_prog, esx_vi_generator_prog,
meson.project_source_root() / 'src',
meson.project_build_root() / 'src',
'source',
diff --git a/src/hyperv/meson.build b/src/hyperv/meson.build
index 3509ce12f7..0ee48e0a6d 100644
--- a/src/hyperv/meson.build
+++ b/src/hyperv/meson.build
@@ -17,7 +17,7 @@ hyperv_gen_sources = custom_target(
'hyperv_wmi_classes.generated.typedef',
],
command: [
- meson_python_prog, python3_prog, hyperv_wmi_generator_prog,
+ meson_python_prog, hyperv_wmi_generator_prog,
meson.project_source_root() / 'src',
meson.project_build_root() / 'src',
],
diff --git a/src/meson.build b/src/meson.build
index 35951d8990..d67d51b8a5 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -75,7 +75,7 @@ if conf.has('WITH_DTRACE_PROBES')
input: infile,
output: out_stp,
command: [
- meson_python_prog, python3_prog, dtrace2systemtap_prog,
+ meson_python_prog, dtrace2systemtap_prog,
bindir, sbindir, libdir, '@INPUT@'
],
capture: true,
@@ -350,7 +350,7 @@ libvirt_syms = custom_target(
input: [ public_sym_file ] + used_sym_files + generated_sym_files,
output: 'libvirt.syms',
command: [
- meson_python_prog, python3_prog, meson_gen_sym_prog,
+ meson_python_prog, meson_gen_sym_prog,
'@OUTPUT@', 'LIBVIRT_PRIVATE_' + meson.project_version(), '@INPUT@',
],
)
@@ -361,7 +361,7 @@ if host_machine.system() == 'windows'
input: libvirt_syms,
output: 'libvirt.def',
command: [
- meson_python_prog, python3_prog, meson_gen_def_prog,
+ meson_python_prog, meson_gen_def_prog,
'@INPUT@', '@OUTPUT@',
],
)
@@ -417,7 +417,7 @@ if host_machine.system() == 'windows'
input: libvirt_qemu_syms,
output: 'libvirt_qemu.def',
command: [
- meson_python_prog, python3_prog, meson_gen_def_prog,
+ meson_python_prog, meson_gen_def_prog,
'@INPUT@', '@OUTPUT@',
],
)
@@ -476,7 +476,7 @@ if host_machine.system() == 'windows'
input: libvirt_lxc_syms,
output: 'libvirt_lxc.def',
command: [
- meson_python_prog, python3_prog, meson_gen_def_prog,
+ meson_python_prog, meson_gen_def_prog,
'@INPUT@', '@OUTPUT@',
],
)
@@ -692,7 +692,7 @@ foreach data : virt_test_aug_files
input: [ data['conf'], data['aug'] ],
output: data['name'],
command: [
- meson_python_prog, python3_prog, augeas_gentest_prog,
+ meson_python_prog, augeas_gentest_prog,
'@INPUT@',
],
capture: true,
@@ -709,7 +709,7 @@ endforeach
foreach data : virt_daemon_confs
capitalize_args = [ '-c', 'print("@0@".capitalize())'.format(data['name']) ]
- name_uc = run_command(python3_prog, capitalize_args, check: true, env: runutf8).stdout().strip()
+ name_uc = run_command(capitalize_args, check: true, env: runutf8).stdout().strip()
if conf.has('WITH_POLKIT')
default_auth = 'polkit'
@@ -771,7 +771,7 @@ foreach data : virt_daemon_confs
input: [ conf_out, test_aug_tmp ],
output: test_aug_out,
command: [
- meson_python_prog, python3_prog, augeas_gentest_prog,
+ meson_python_prog, augeas_gentest_prog,
'@INPUT@',
],
capture: true,
@@ -889,7 +889,7 @@ if conf.has('WITH_DTRACE_PROBES')
input: rpc_probe_files,
output: 'libvirt_functions.stp',
command: [
- meson_python_prog, python3_prog, gensystemtap_prog,
+ meson_python_prog, gensystemtap_prog,
'@INPUT@',
],
capture: true,
@@ -909,7 +909,7 @@ virt_install_dirs += [
]
meson.add_install_script(
- meson_python_prog.full_path(), python3_prog.full_path(), meson_install_dirs_prog.full_path(),
+ meson_python_prog.full_path(), meson_install_dirs_prog.full_path(),
virt_install_dirs,
)
@@ -919,16 +919,16 @@ meson.add_install_script(
if host_machine.system() == 'linux'
test(
'check-symfile',
- python3_prog,
- args: [ check_symfile_prog.full_path(), libvirt_syms, libvirt_lib ],
+ check_symfile_prog,
+ args: [ libvirt_syms, libvirt_lib ],
env: runutf8,
)
if conf.has('WITH_REMOTE')
test(
'check-admin-symfile',
- python3_prog,
- args: [ check_symfile_prog.full_path(), libvirt_admin_syms, libvirt_admin_lib ],
+ check_symfile_prog,
+ args: [ libvirt_admin_syms, libvirt_admin_lib ],
env: runutf8,
)
endif
@@ -936,9 +936,8 @@ endif
test(
'check-symsorting',
- python3_prog,
+ check_symsorting_prog,
args: [
- check_symsorting_prog.full_path(),
meson.current_source_dir(),
files(sym_files, used_sym_files),
],
@@ -947,9 +946,8 @@ test(
test(
'check-admin-symsorting',
- python3_prog,
+ check_symsorting_prog,
args: [
- check_symsorting_prog.full_path(),
meson.current_source_dir(),
libvirt_admin_private_syms,
],
@@ -958,9 +956,9 @@ test(
test(
'check-drivername',
- python3_prog,
+ check_drivername_prog,
args: [
- check_drivername_prog.full_path(), files(driver_headers),
+ files(driver_headers),
files('libvirt_public.syms'), libvirt_qemu_syms, libvirt_lxc_syms,
],
env: runutf8,
@@ -968,24 +966,24 @@ test(
test(
'check-admin-drivername',
- python3_prog,
+ check_drivername_prog,
args: [
- check_drivername_prog.full_path(), libvirt_admin_public_syms,
+ libvirt_admin_public_syms,
],
env: runutf8,
)
test(
'check-driverimpls',
- python3_prog,
- args: [ check_driverimpls_prog.full_path(), driver_source_files ],
+ check_driverimpls_prog,
+ args: [ driver_source_files ],
env: runutf8,
)
test(
'check-aclrules',
- python3_prog,
- args: [ check_aclrules_prog.full_path(), files('remote/remote_protocol.x'), stateful_driver_source_files ],
+ check_aclrules_prog,
+ args: [ files('remote/remote_protocol.x'), stateful_driver_source_files ],
env: runutf8,
)
@@ -1008,9 +1006,8 @@ if pdwtags_prog.found() and cc.get_id() != 'clang'
lib = proto['lib']
test(
'check-@0@'.format(proto['name']),
- python3_prog,
+ check_remote_protocol_prog,
args: [
- check_remote_protocol_prog.full_path(),
proto['name'],
lib.name(),
lib.full_path(),
diff --git a/src/network/meson.build b/src/network/meson.build
index d266bb225a..aad29deaed 100644
--- a/src/network/meson.build
+++ b/src/network/meson.build
@@ -90,7 +90,7 @@ if conf.has('WITH_NETWORK')
)
meson.add_install_script(
- meson_python_prog.full_path(), python3_prog.full_path(), meson_install_symlink_prog.full_path(),
+ meson_python_prog.full_path(), meson_install_symlink_prog.full_path(),
confdir / 'qemu' / 'networks' / 'autostart',
'../default.xml', 'default.xml',
)
diff --git a/src/qemu/meson.build b/src/qemu/meson.build
index c8806bbc36..271a0b4139 100644
--- a/src/qemu/meson.build
+++ b/src/qemu/meson.build
@@ -73,7 +73,7 @@ if conf.has('WITH_DTRACE_PROBES')
input: infile,
output: out_stp,
command: [
- meson_python_prog, python3_prog, dtrace2systemtap_prog,
+ meson_python_prog, dtrace2systemtap_prog,
bindir, sbindir, libdir, '@INPUT@',
],
capture: true,
diff --git a/src/util/meson.build b/src/util/meson.build
index c81500ea04..5641dafa35 100644
--- a/src/util/meson.build
+++ b/src/util/meson.build
@@ -146,7 +146,7 @@ foreach name : keycode_list
input: keymap_src_file,
output: 'virkeycodetable_@0@.h'.format(name),
command: [
- meson_python_prog, python3_prog, keymap_gen_prog, 'code-table',
+ meson_python_prog, keymap_gen_prog, 'code-table',
'--lang', 'stdc',
'--varname', 'virKeyCodeTable_@0@'.format(name),
'@INPUT@', name,
@@ -161,7 +161,7 @@ foreach name : keyname_list
input: keymap_src_file,
output: 'virkeynametable_@0@.h'.format(name),
command: [
- meson_python_prog, python3_prog, keymap_gen_prog, 'name-table',
+ meson_python_prog, keymap_gen_prog, 'name-table',
'--lang', 'stdc',
'--varname', 'virKeyNameTable_@0@'.format(name),
'@INPUT@', name,
diff --git a/tests/meson.build b/tests/meson.build
index 15b049c6ac..1e407b8860 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -707,7 +707,7 @@ testenv += 'VIR_TEST_FILE_ACCESS=1'
add_test_setup(
'access',
env: testenv,
- exe_wrapper: [ python3_prog, check_file_access_prog.full_path() ],
+ exe_wrapper: [ check_file_access_prog.full_path() ],
)
add_test_setup(
--
2.39.1.windows.1
From 0c0a96ec4560c0883b79ac9f1fe92f520c895f79 Mon Sep 17 00:00:00 2001
From: Christopher Degawa <ccom@randomderp.com>
Date: Sat, 4 Mar 2023 22:33:47 -0500
Subject: [PATCH 5/5] virgdbusmock: guard usage of RTLD_DEFAULT with DLFCN
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
---
tests/virgdbusmock.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/virgdbusmock.c b/tests/virgdbusmock.c
index 8f5cc97911..48e34ee92f 100644
--- a/tests/virgdbusmock.c
+++ b/tests/virgdbusmock.c
@@ -54,6 +54,7 @@ VIR_MOCK_STUB_RET_ARGS(g_dbus_connection_close_sync,
GCancellable *, cancellable,
GError **, error)
+#if WITH_DLFCN_H
VIR_MOCK_LINK_RET_ARGS(g_dbus_connection_call_sync,
GVariant *,
GDBusConnection *, connection,
@@ -67,6 +68,7 @@ VIR_MOCK_LINK_RET_ARGS(g_dbus_connection_call_sync,
gint, timeout_msec,
GCancellable *, cancellable,
GError **, error)
+#endif
#ifdef G_OS_UNIX
VIR_MOCK_LINK_RET_ARGS(g_dbus_connection_call_with_unix_fd_list_sync,
--
2.39.1.windows.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment