[PATCH 16/20] qemu: Refactor tray_status handling