[PATCH] qemuxml2argvmock: Deduplicate some code