This looks more like a compile time feature check than runtime. The PKG_CONFIG() api number which had the initial set of QEMU requirements was 3 (i.e, PKG_CONFIG(..,glusterfs-api>=3,..). The new updates for Samba requirements has api number 4. Depending on whether discard support makes it before the next release (and api numbers gets published) or not, glfs_discard() would either be available in 4 or 5. Also, you might also want to add a second AC_CHECK_FUNC macro in
configure.ac to be doubly sure.
Avati