qemu-char: check optional fields using has_*