[smcv: separated out from a larger commit, added commit message] Reviewed-by: Simon McVittie <smcv@collabora.com>