meson, configure: move ntddscsi API check to meson

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-02-02 10:19:04 +01:00 committed by Paolo Bonzini
parent e23460ce92
commit b7e4ab15c3
4 changed files with 21 additions and 28 deletions

23
configure vendored
View file

@ -2302,26 +2302,6 @@ EOF
fi fi
fi fi
##########################################
# check if mingw environment provides a recent ntddscsi.h
guest_agent_ntddscsi="no"
if test "$mingw32" = "yes"; then
cat > $TMPC << EOF
#include <windows.h>
#include <ntddscsi.h>
int main(void) {
#if !defined(IOCTL_SCSI_GET_ADDRESS)
#error Missing required ioctl definitions
#endif
SCSI_ADDRESS addr = { .Lun = 0, .TargetId = 0, .PathId = 0 };
return addr.Lun;
}
EOF
if compile_prog "" "" ; then
guest_agent_ntddscsi=yes
fi
fi
########################################## ##########################################
# capstone # capstone
@ -2831,9 +2811,6 @@ if test "$debug_tcg" = "yes" ; then
fi fi
if test "$mingw32" = "yes" ; then if test "$mingw32" = "yes" ; then
echo "CONFIG_WIN32=y" >> $config_host_mak echo "CONFIG_WIN32=y" >> $config_host_mak
if test "$guest_agent_ntddscsi" = "yes" ; then
echo "CONFIG_QGA_NTDDSCSI=y" >> $config_host_mak
fi
echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak
echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak

View file

@ -1938,6 +1938,22 @@ if targetos == 'windows' and link_language == 'cpp'
int main(void) { return VSS_CTX_BACKUP; }''') int main(void) { return VSS_CTX_BACKUP; }''')
endif endif
have_ntddscsi = false
if targetos == 'windows'
have_ntddscsi = cc.compiles('''
#include <windows.h>
#include <ntddscsi.h>
int main(void) {
#if !defined(IOCTL_SCSI_GET_ADDRESS)
#error Missing required ioctl definitions
#endif
SCSI_ADDRESS addr = { .Lun = 0, .TargetId = 0, .PathId = 0 };
return addr.Lun;
}
''')
endif
config_host_data.set('HAVE_NTDDSCSI', have_ntddscsi)
ignored = ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target ignored = ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target
'HAVE_GDB_BIN'] 'HAVE_GDB_BIN']
arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] arrays = ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST']
@ -3605,7 +3621,7 @@ summary_info += {'libnfs support': libnfs}
if targetos == 'windows' if targetos == 'windows'
if have_ga if have_ga
summary_info += {'QGA VSS support': have_qga_vss} summary_info += {'QGA VSS support': have_qga_vss}
summary_info += {'QGA w32 disk info': config_host.has_key('CONFIG_QGA_NTDDSCSI')} summary_info += {'QGA w32 disk info': have_ntddscsi}
endif endif
endif endif
summary_info += {'seccomp support': seccomp} summary_info += {'seccomp support': seccomp}

View file

@ -18,7 +18,7 @@
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <iptypes.h> #include <iptypes.h>
#include <iphlpapi.h> #include <iphlpapi.h>
#ifdef CONFIG_QGA_NTDDSCSI #ifdef HAVE_NTDDSCSI
#include <winioctl.h> #include <winioctl.h>
#include <ntddscsi.h> #include <ntddscsi.h>
#endif #endif
@ -474,7 +474,7 @@ void qmp_guest_file_flush(int64_t handle, Error **errp)
} }
} }
#ifdef CONFIG_QGA_NTDDSCSI #ifdef HAVE_NTDDSCSI
static GuestDiskBusType win2qemu[] = { static GuestDiskBusType win2qemu[] = {
[BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN, [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
@ -1111,7 +1111,7 @@ GuestDiskInfoList *qmp_guest_get_disks(Error **errp)
return NULL; return NULL;
} }
#endif /* CONFIG_QGA_NTDDSCSI */ #endif /* HAVE_NTDDSCSI */
static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp) static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp)
{ {

View file

@ -88,7 +88,7 @@ if targetos == 'windows'
qga_libs += ['-lole32', '-loleaut32', '-lshlwapi', '-lstdc++', '-Wl,--enable-stdcall-fixup'] qga_libs += ['-lole32', '-loleaut32', '-lshlwapi', '-lstdc++', '-Wl,--enable-stdcall-fixup']
subdir('vss-win32') subdir('vss-win32')
endif endif
if 'CONFIG_QGA_NTDDSCSI' in config_host if have_ntddscsi
qga_libs += ['-lsetupapi', '-lcfgmgr32'] qga_libs += ['-lsetupapi', '-lcfgmgr32']
endif endif
endif endif