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
_______________________________________________
Users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/[email protected]/message/H5XXRX7CD6E7S4JIO6VAKYYY2JCZRUHA/

Reply via email to