]> git.proxmox.com Git - mirror_qemu.git/commit - qapi/block-core.json
block: Fix NULL dereference on empty drive error
authorKevin Wolf <kwolf@redhat.com>
Mon, 5 Mar 2018 14:59:35 +0000 (15:59 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 5 Mar 2018 17:45:32 +0000 (18:45 +0100)
commitbfe1a14c180ec44c033be12b9151252ffda69292
treec0f703563f7578cdaf949e7d70764946ec9b1c8b
parent9d9b4b640f9e583ff4b24dc762630945f3ccc16d
block: Fix NULL dereference on empty drive error

blk_error_action() sends a BLOCK_IO_ERROR QMP event which includes the
node name of its root node. If the BlockBackend represents an empty
drive, there is no root node, so we should not try to access its node
name. Make the field optional in the event and include it only when
the BlockBackend isn't empty.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
block/block-backend.c
qapi/block-core.json