Crash Debugging VDSM Hook

Hi All, While debugging some Qemu 6 issue I was requested to remove the error_policy from the libvirt xml. See https://bugzilla.redhat.com/show_bug.cgi?id=1999051#c12 Now to have this working I just wrote some small python hook for VDSM which adjusts the XML before startup. Just added the file in /usr/libexec/vdsm/hooks/before_vm_start: # cat 40_crashtest #!/usr/libexec/platform-python import os import hooking class CrashTestHook(object): def __init__(self): super(CrashTestHook, self).__init__() self.config = {} self.domxml = hooking.read_domxml() def save(self): hooking.write_domxml(self.domxml) def set_error_policy(self): drivers = self.domxml.getElementsByTagName('driver') for driver in drivers: policy = driver.getAttribute('error_policy') if policy == 'stop': driver.removeAttribute('error_policy') def main(self): self.set_error_policy() self.save() if __name__ == "__main__": CrashTestHook().main() # vim: expandtab tabstop=4 shiftwidth=4 Might be usefull if somebody else needs the same thing :) Jean-Louis
participants (1)
-
Jean-Louis Dupond