diff --git a/configure b/configure index 4901b9ab05..8c6151af8d 100755 --- a/configure +++ b/configure @@ -3078,6 +3078,13 @@ if test "$modules" = yes; then glib_modules="$glib_modules gmodule-2.0" fi +# This workaround is required due to a bug in pkg-config file for glib as it +# doesn't define GLIB_STATIC_COMPILATION for pkg-config --static + +if test "$static" = yes -a "$mingw32" = yes; then + QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS" +fi + for i in $glib_modules; do if $pkg_config --atleast-version=$glib_req_ver $i; then glib_cflags=$($pkg_config --cflags $i) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 73d93eb5ce..915df9ed90 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -999,7 +999,9 @@ static void build_guest_fsinfo_for_virtual_device(char const *syspath, dirpath = g_strdup_printf("%s/slaves", syspath); dir = opendir(dirpath); if (!dir) { - error_setg_errno(errp, errno, "opendir(\"%s\")", dirpath); + if (errno != ENOENT) { + error_setg_errno(errp, errno, "opendir(\"%s\")", dirpath); + } g_free(dirpath); return; }