[PATCH v2 17/35] qemu: snapshot: Move flag checks to top level functions