]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuProcessRefreshDisks: Properly compare tray status
authorPeter Krempa <pkrempa@redhat.com>
Wed, 19 Apr 2023 13:44:28 +0000 (15:44 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 24 Apr 2023 10:57:56 +0000 (12:57 +0200)
commitc8e7ed7f7bdae18a2405ab871c763df5ce583023
tree2293e006b6f5ea529465d499809a25f46e0ca748
parent476cc5f48b34d710cf36482cdc66bd7c66b5cdb8
qemuProcessRefreshDisks: Properly compare tray status

The code compares the 'tray_open' boolean from 'struct
qemuDomainDiskInfo' directly against 'disk->tray_status' which is
declared as virDomainDiskTray (enum). Now the logic works correctly
because the _OPEN enum has value '1'.

Separate the event emission code from the update code and remember the
old tray state in a separate variable rather than having the sneaky
logic we have today.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c