qemu-char: check optional fields using has_*

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
Gerd Hoffmann
2013-06-28 22:10:33 +04:00
committed by Michael Tokarev
parent d1ec72a44e
commit e859eda585
+2 -2
View File
@@ -3493,7 +3493,7 @@ static CharDriverState *qmp_chardev_open_file(ChardevFile *file, Error **errp)
{
HANDLE out;
if (file->in) {
if (file->has_in) {
error_setg(errp, "input file not supported");
return NULL;
}
@@ -3544,7 +3544,7 @@ static CharDriverState *qmp_chardev_open_file(ChardevFile *file, Error **errp)
return NULL;
}
if (file->in) {
if (file->has_in) {
flags = O_RDONLY;
in = qmp_chardev_open_file_source(file->in, flags, errp);
if (error_is_set(errp)) {