I’m currently using a script that is essentially an awk wrapper around qvm-ls that formats the output for use by conky (creating a list of the running qubes on my desktop).
I would like to extend the script to include an indication of the “restart status” (don’t know if that’s what it is actually called). What I mean replicating the green and gray arrows that show up in the Qubes Manager state column, the ones indicating the AppVM needs a restart due to template VM updates.
I have been searching, reading documentation, and can’t figure out where that information comes from, or how to replicate that information on the command line. It doesn’t appear to be in the FLAGS for qvm-ls, and no other qvm-* seems to be the command I’m looking for.
Does anyone know where I can pull that information via a script?
Thanks @renehoj. Using the is_outdated property of qvm-volume does indeed get me the information I needed to get this working.
I noticed that running qvm-volume on all of the running VMs created a CPU spike that was too high for a script that runs every 15 seconds. I ended up rewriting the script to cache that information for 15 minutes, to limit resource usage. This gives me the behavior I want with a simple enough mechanism to force a refresh (rm the cache file).
Thanks again @renehoj, the Python snippet above definitely pointed me in a better direction where I do not have to use qvm-volume to get that information.
I now have a Python script that watches for shutdowns as you suggested. When I have time to figure out qubesadmin a little more, I suspect I can rewrite the whole thing in Python and skip using qvm-ls as well.