testimage: Refactoring and fixing.
PATCH v2 1/4 testimage: Refactoring and fixing.
The testimage.bbclass invocation of controllers besides simpletarget and qemutarget was broken. Setting TEST_TARGET to class names did not work, only hardcoded values set in context.py were allowed. On the other hand the other TEST_TARGETs available were supposedly available through the class name convetion but none of them were working. See:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=12842
In this commit qemuwrapper and simpletarget TEST_TARGETS are now not available through these names, but through the common convention of class names.
The code for layer defined controllers was outdated and broken because the example controllers in meta-yocto-bsp as well as the controllers available in masterimage were dependent only on the datastore d being available for __init__ contruction, when the testimage.bbclass and context.py, which initialize test controllers never passed the datastore. This commit fixes all the openembedded controllers to not use the datastore, but the testdata json file that is loaded by the testimage.bbclass. This way the tests can still be exported to be ran outside bitbake. The kwargs and logger is still passed in the constructor and there maybe some redundancies between the kwargs and the td test datstore, but this is not addressed in this commit.
In masterimage.py there was a duplicate SystemdbootTarget which was removed. It is my opinion that all targets should go to meta-yocto-bsp or meta/ and should not get special treatment whether they come from poky or other layer.
In this commit functionality that was lost in masterimage about retrieving a fresh BB_ORIGENV. The test data json file does not store this variable, so the build-time enviromental variables cannot be retrieved later on, when running the tests.
The deploy() method invocation of the test cases was removed in the refactoring and this commit re-adds it in the same logical place. The deploy method was added as an abstract method so that all Test controller classes have this method. This method had been lost and was not used in the simpleremote and qemuwrapper, because these controllers do not need the functionality, but almost any real board requires certain steps to deploy the new images, before the tests can be ran. An example of this need was visible in the master image and subclasses in meta-yocto-bsp.
A dependency on images fstypes of qemu was removed from testimage. The allowed file system types were not relevant for other controllers, and made it so that there was an import of the OEQemuTarget python class applicable to all possible controllers, including non qemu.
The SimpleRemoteTarget, OEQemuTarget and a custom controller, developed according to the manual were successfully tested.
---
meta/classes/testimage.bbclass | 18 +---
meta/lib/oeqa/controllers/masterimage.py | 107 ++++++---------------
.../target/qemu.py => controllers/qemutarget.py} | 30 ++++--
meta/lib/oeqa/controllers/simpleremote.py | 33 +++++++
.../target/ssh.py => controllers/sshtarget.py} | 9 +-
meta/lib/oeqa/core/target/__init__.py | 4 +
meta/lib/oeqa/runtime/context.py | 32 +-----
meta/lib/oeqa/targetcontrol.py | 97 ++++++-------------
8 files changed, 137 insertions(+), 193 deletions(-)
rename meta/lib/oeqa/{core/target/qemu.py => controllers/qemutarget.py} (58%)
create mode 100644 meta/lib/oeqa/controllers/simpleremote.py
rename meta/lib/oeqa/{core/target/ssh.py => controllers/sshtarget.py} (98%)meta/classes/testimage.bbclass +3 -15
@@ -75,7 +75,7 @@ DEFAULT_TEST_SUITES_remove_qemumips64 = "${MIPSREMOVE}" TEST_SUITES ?= "${DEFAULT_TEST_SUITES}" TEST_QEMUBOOT_TIMEOUT ?= "1000" -TEST_TARGET ?= "qemu" +TEST_TARGET ?= "OEQemuTarget" TESTIMAGEDEPENDS = "" TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot"
@@ -147,7 +147,6 @@ def testimage_main(d): from oeqa.core.utils.misc import updateTestData from oeqa.runtime.context import OERuntimeTestContext from oeqa.runtime.context import OERuntimeTestContextExecutor - from oeqa.core.target.qemu import supported_fstypes from oeqa.core.utils.test import getSuiteCases from oeqa.utils import make_logger_bitbake_compatible
@@ -189,15 +188,6 @@ def testimage_main(d): # Get machine machine = d.getVar("MACHINE") - # Get rootfs - fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ') - if fs in supported_fstypes] - if not fstypes: - bb.fatal('Unsupported image type built. Add a comptible image to ' - 'IMAGE_FSTYPES. Supported types: %s' % - ', '.join(supported_fstypes)) - rootfs = '%s.%s' % (image_name, fstypes[0]) - # Get tmpdir (not really used, just for compatibility) tmpdir = d.getVar("TMPDIR")
@@ -230,7 +220,6 @@ def testimage_main(d): # TODO: We use the current implementatin of qemu runner because of # time constrains, qemu runner really needs a refactor too. target_kwargs = { 'machine' : machine, - 'rootfs' : rootfs, 'tmpdir' : tmpdir, 'dir_image' : dir_image, 'display' : display,
@@ -253,9 +242,7 @@ def testimage_main(d): d.getVar("TESTIMAGE_DUMP_DIR")) # the robot dance - target = OERuntimeTestContextExecutor.getTarget( - d.getVar("TEST_TARGET"), logger, d.getVar("TEST_TARGET_IP"), - d.getVar("TEST_SERVER_IP"), **target_kwargs) + target = OERuntimeTestContextExecutor.getTarget(d.getVar("TEST_TARGET"), td, logger, **target_kwargs) # test context tc = OERuntimeTestContext(td, logger, target, host_dumper,
@@ -282,6 +269,7 @@ def testimage_main(d): # Add systemd.log_level=debug to enable systemd debug logging bootparams = 'systemd.log_target=console' + tc.target.deploy() results = None orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) try:
meta/lib/oeqa/controllers/masterimage.py +32 -75
148 lines not on this page · raw message
meta/lib/oeqa/controllers/qemutarget.py renamed from meta/lib/oeqa/core/target/qemu.py +23 -7
@@ -6,24 +6,37 @@ import sys import signal import time -from .ssh import OESSHTarget +from oeqa.controllers.sshtarget import OESSHTarget from oeqa.utils.qemurunner import QemuRunner -supported_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic'] class OEQemuTarget(OESSHTarget): - def __init__(self, logger, ip, server_ip, timeout=300, user='root', + supported_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic'] + def __init__(self, td, logger, timeout=300, user='root', port=None, machine='', rootfs='', kernel='', kvm=False, dump_dir='', dump_host_cmds='', display='', bootlog='', tmpdir='', dir_image='', boottime=60, **kwargs): - super(OEQemuTarget, self).__init__(logger, ip, server_ip, timeout, - user, port) + super(OEQemuTarget, self).__init__(td, logger, timeout, user, port) - self.ip = ip - self.server_ip = server_ip + self.ip = td['TEST_TARGET_IP'] + self.server_ip = td['TEST_SERVER_IP'] self.machine = machine + + + image_name = ("%s/%s" % (td['DEPLOY_DIR_IMAGE'], td['IMAGE_LINK_NAME'])) + + # Get rootfs + if not rootfs: + fstypes = [fs for fs in td['IMAGE_FSTYPES'].split(' ') + if fs in self.supported_fstypes] + if not fstypes: + bb.fatal('Unsupported image type built. Add a comptible image to ' + 'IMAGE_FSTYPES. Supported types: %s' % + ', '.join(self.supported_fstypes)) + rootfs = '%s.%s' % (image_name, fstypes[0]) self.rootfs = rootfs + self.kernel = kernel self.kvm = kvm
@@ -41,5 +54,8 @@ class OEQemuTarget(OESSHTarget): self.stop() raise RuntimeError("FAILED to start qemu - check the task log and the boot log") + def deploy(self): + pass + def stop(self): self.runner.stop()
meta/lib/oeqa/controllers/simpleremote.py new file +33 -0
@@ -0,0 +1,33 @@ +from oeqa.targetcontrol import BaseTarget +from oeqa.utils.sshcontrol import SSHControl + +class SimpleRemoteTarget(BaseTarget): + + def __init__(self, td, logger, **kwargs): + super(SimpleRemoteTarget, self).__init__(td, logger, **kwargs) + addr = td['TEST_TARGET_IP'] or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.') + self.ip = addr.split(":")[0] + try: + self.port = addr.split(":")[1] + except IndexError: + self.port = None + self.logger.info("Target IP: %s" % self.ip) + self.server_ip = td['TEST_SERVER_IP'] + if not self.server_ip: + try: + self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1] + except Exception as e: + bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e) + self.logger.info("Server IP: %s" % self.server_ip) + + def deploy(self): + super(SimpleRemoteTarget, self).deploy() + + def start(self, params=None, ssh=True, extra_bootparams=None): + if ssh: + self.connection = SSHControl(self.ip, logfile=self.sshlog, port=self.port) + + def stop(self): + self.connection = None + self.ip = None + self.server_ip = None
meta/lib/oeqa/controllers/sshtarget.py renamed from meta/lib/oeqa/core/target/ssh.py +5 -4
@@ -8,10 +8,10 @@ import logging import subprocess import codecs -from . import OETarget +from oeqa.core.target import OETarget class OESSHTarget(OETarget): - def __init__(self, logger, ip, server_ip, timeout=300, user='root', + def __init__(self, td, logger, timeout=300, user='root', port=None, **kwargs): if not logger: logger = logging.getLogger('target')
@@ -25,8 +25,9 @@ class OESSHTarget(OETarget): logger.addHandler(fileHandler) super(OESSHTarget, self).__init__(logger) - self.ip = ip - self.server_ip = server_ip + self.ip = td['TEST_TARGET_IP'] + self.server_ip = td['TEST_SERVER_IP'] + self.timeout = timeout self.user = user ssh_options = [
meta/lib/oeqa/core/target/__init__.py +4 -0
@@ -21,6 +21,10 @@ class OETarget(object): pass @abstractmethod + def deploy(self): + pass + + @abstractmethod def copyTo(self, localSrc, remoteDst): pass
meta/lib/oeqa/runtime/context.py +5 -27
@@ -4,8 +4,6 @@ import os from oeqa.core.context import OETestContext, OETestContextExecutor -from oeqa.core.target.ssh import OESSHTarget -from oeqa.core.target.qemu import OEQemuTarget from oeqa.utils.dump import HostDumper from oeqa.runtime.loader import OERuntimeTestLoader
@@ -89,32 +87,12 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): help="Qemu boot configuration, only needed when target_type is QEMU.") @staticmethod - def getTarget(target_type, logger, target_ip, server_ip, **kwargs): + def getTarget(target_type, td, logger, **kwargs): target = None - if target_ip: - target_ip_port = target_ip.split(':') - if len(target_ip_port) == 2: - target_ip = target_ip_port[0] - kwargs['port'] = target_ip_port[1] - - if target_type == 'simpleremote': - target = OESSHTarget(logger, target_ip, server_ip, **kwargs) - elif target_type == 'qemu': - target = OEQemuTarget(logger, target_ip, server_ip, **kwargs) - else: - # XXX: This code uses the old naming convention for controllers and - # targets, the idea it is to leave just targets as the controller - # most of the time was just a wrapper. - # XXX: This code tries to import modules from lib/oeqa/controllers - # directory and treat them as controllers, it will less error prone - # to use introspection to load such modules. - # XXX: Don't base your targets on this code it will be refactored - # in the near future. - # Custom target module loading - target_modules_path = kwargs.get('target_modules_path', '') - controller = OERuntimeTestContextExecutor.getControllerModule(target_type, target_modules_path) - target = controller(logger, target_ip, server_ip, **kwargs) + target_modules_path = kwargs.get('target_modules_path', '') + controller = OERuntimeTestContextExecutor.getControllerModule(target_type, target_modules_path) + target = controller(td, logger, **kwargs) return target
@@ -176,7 +154,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): try: obj = getattr(module, target) except: - obj = None + pass return obj @staticmethod
meta/lib/oeqa/targetcontrol.py +32 -65
157 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 2/4 testimage: target.start exceptions not masked.
Previously the target.start exceptions were being masked by the catch clause of RuntimeError and BlockingIOError which are very broad. We decoupled the start method try clause from the runTests try clause which requires catching the BlockingIOError and RuntimeError.
--- meta/classes/testimage.bbclass | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-)
meta/classes/testimage.bbclass +21 -15
@@ -269,24 +269,30 @@ def testimage_main(d): # Add systemd.log_level=debug to enable systemd debug logging bootparams = 'systemd.log_target=console' + tc.target.deploy() - results = None - orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) + + #We do not want the runTests to mask exeptions of target.start but we want a failed start + #to trigger a stop. try: - # We need to check if runqemu ends unexpectedly - # or if the worker send us a SIGTERM - tc.target.start(extra_bootparams=bootparams) - results = tc.runTests() - except (RuntimeError, BlockingIOError) as err: - if isinstance(err, RuntimeError): - bb.error('testimage received SIGTERM, shutting down...') - else: - bb.error('runqemu failed, shutting down...') - if results: - results.stop() - results = None + tc.target.start(extra_bootparams=bootparams) + results = None + orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) + try: + # We need to check if runqemu ends unexpectedly + # or if the worker send us a SIGTERM + results = tc.runTests() + except (RuntimeError, BlockingIOError) as err: + if isinstance(err, RuntimeError): + bb.error('testimage received SIGTERM, shutting down...') + else: + bb.error('runqemu failed, shutting down...') + if results: + results.stop() + results = None + finally: + signal.signal(signal.SIGTERM, orig_sigterm_handler) finally: - signal.signal(signal.SIGTERM, orig_sigterm_handler) tc.target.stop() # Show results (if we have them)
Signature · 1 line
2.7.4
PATCH v2 3/4 masterimage: Check for rootfs path instead of file.
In reply to Paulo NevesThe rootfs might be a directory path or a file path. A case in point is if the test wants to deploy a rootfs directly by rsyncing it to the target or even use it as part of a tftp server.
--- meta/lib/oeqa/controllers/masterimage.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
meta/lib/oeqa/controllers/masterimage.py +1 -5
@@ -51,11 +51,7 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta self.image_fstype = self.get_image_fstype(td) self.rootfs = os.path.join(td['DEPLOY_DIR_IMAGE'], td['IMAGE_LINK_NAME'] + '.' + self.image_fstype) self.kernel = os.path.join(td['DEPLOY_DIR_IMAGE'], td["KERNEL_IMAGETYPE"] + '-' + td['MACHINE'] + '.bin') - if not os.path.isfile(self.rootfs): - # we could've checked that IMAGE_FSTYPES contains tar.gz but the config for running testimage might not be - # the same as the config with which the image was build, ie - # you bitbake core-image-sato with IMAGE_FSTYPES += "tar.gz" - # and your autobuilder overwrites the config, adds the test bits and runs bitbake core-image-sato -c testimage + if not os.path.exists(self.rootfs): bb.fatal("No rootfs found. Did you build the image ?\n" \ "If yes, did you build it with IMAGE_FSTYPES += \"{}\" ?" \ "\nExpected path: {}".format(" ".join(self.supported_image_fstypes), self.rootfs))
Signature · 1 line
2.7.4
PATCH v2 4/4 testimage: Moved write_image_test_data to testimage bbclass.
In reply to Paulo NevesPreviously the write_image_test_data was a rootfs post process command. This function ran only when the rootfs task was ran. Due to this if a variable was changed or added to the datastore that would not trigger the do_rootfs task, the variable would never be written into the json file. Consequently the do_testimage task was potentially unreproduceable and could fail if for some reason this variable was then used.
In this commit we move the recording of the datastore to the start of the do_testimage task. The do_testimage
task then reads this freshly generated json and passes it into the normal test machinery. This approach allows for the test machinery to still be loosely coupled to bitbake, and thus still allows for the tests to be exported and used independently from bitbake. The caveat is, if there are datastore changes then the bitbake testimage task should be run before the tests can be ran independently again.
--- meta/classes/rootfs-postcommands.bbclass | 22 ---------------------- meta/classes/testimage.bbclass | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 23 deletions(-)
meta/classes/rootfs-postcommands.bbclass +0 -22
@@ -25,9 +25,6 @@ ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only # and we don't want to disable such a default that by setting a value here. APPEND_append = '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", " ro", "", d)}' -# Generates test data file with data store variables expanded in json format -ROOTFS_POSTPROCESS_COMMAND += "write_image_test_data ; " - # Write manifest IMAGE_MANIFEST = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.manifest" ROOTFS_POSTUNINSTALL_COMMAND =+ "write_image_manifest ; "
@@ -312,25 +309,6 @@ rootfs_sysroot_relativelinks () { sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT} } -# Generated test data json file -python write_image_test_data() { - from oe.data import export2json - - deploy_dir = d.getVar('IMGDEPLOYDIR') - link_name = d.getVar('IMAGE_LINK_NAME') - testdata_name = os.path.join(deploy_dir, "%s.testdata.json" % d.getVar('IMAGE_NAME')) - - searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/") - export2json(d, testdata_name, searchString=searchString, replaceString="") - - if os.path.exists(testdata_name): - testdata_link = os.path.join(deploy_dir, "%s.testdata.json" % link_name) - if os.path.lexists(testdata_link): - os.remove(testdata_link) - os.symlink(os.path.basename(testdata_name), testdata_link) -} -write_image_test_data[vardepsexclude] += "TOPDIR" - # Check for unsatisfied recommendations (RRECOMMENDS) python rootfs_log_check_recommends() { log_path = d.expand("${T}/log.do_rootfs")
meta/classes/testimage.bbclass +18 -1
@@ -137,6 +137,21 @@ def testimage_sanity(d): bb.fatal('When TEST_TARGET is set to "simpleremote" ' 'TEST_TARGET_IP and TEST_SERVER_IP are needed too.') +# Generated test data json file +def write_image_test_data(d): + from oe.data import export2json + + testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_NAME')) + testdata_link = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME')) + + bb.utils.mkdirhier(os.path.dirname(testdata)) + searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/") + export2json(d, testdata,searchString=searchString,replaceString="") + if testdata_link != testdata: + if os.path.lexists(testdata_link): + os.remove(testdata_link) + os.symlink(os.path.basename(testdata), testdata_link) + def testimage_main(d): import os import json
@@ -170,12 +185,14 @@ def testimage_main(d): image_name = ("%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))) + + write_image_test_data(d) + tdname = "%s.testdata.json" % image_name try: td = json.load(open(tdname, "r")) except (FileNotFoundError) as err: bb.fatal('File %s Not Found. Have you built the image with INHERIT+="testimage" in the conf/local.conf?' % tdname) - # Some variables need to be updates (mostly paths) with the # ones of the current environment because some tests require them. updateTestData(d, td, d.getVar('TESTIMAGE_UPDATE_VARS').split())
Signature · 1 line
2.7.4
Re: [meta-oe][PATCH v2 4/4] testimage: Moved write_image_test_data to testimage bbclass.
Quoted 9 lines · Paulo Neves
Previously the
write_image_test_datawas a rootfs post process command. This function ran only when the rootfs task was ran. Due to this if a variable was changed or added to the datastore that would not trigger thedo_rootfstask, the variable would never be written into the json file. Consequently thedo_testimagetask was potentially unreproduceable and could fail if for some reason this variable was then used.
Quoted 9 lines
In this commit we move the recording of the datastore to the start of the
do_testimagetask. Thedo_testimage
task then reads this freshly generated json and passes it into the normal test machinery. This approach allows for the test machinery to still be loosely coupled to bitbake, and thus still allows for the tests to be exported and used independently from bitbake. The caveat is, if there are datastore changes then the bitbake testimage task should be run before the tests can be ran independently again.
I'm not sure I agree with this. The test data really should be written at either rootfs or image generation, not just before the tests are run.
If you wanted to run the tests independently, after this change you have no way to generate the data to do that without first running the tests at least once. That doesn't make sense.
The correct thing to do here is to ensure the write_image_test_data() function indicates which variables it depends upon and hence reruns correctly.
Cheers,
Richard
Re: [meta-oe][PATCH v2 4/4] testimage: Moved write_image_test_data to testimage bbclass.
Hello Richard,
Would assure you if it generated the test data on image creation *and* on test task?
If not please describe more or less how I could collect which variables write_image_test_data depends upon. Just a high level description would do.
I have really been in a good spirit to get this topic merged but I do not see a clear guidance for me to fix what was clearly broken. Actually the current code put there by intel should should be reverted in my opinion, as it broke all the controllers besides simpleremote and qemu.
Paulo Neves
Quoted 36 lines · Richard Purdie
Quoted 9 lines · Paulo Neves
Previously the
write_image_test_datawas a rootfs post process command. This function ran only when the rootfs task was ran. Due to this if a variable was changed or added to the datastore that would not trigger thedo_rootfstask, the variable would never be written into the json file. Consequently thedo_testimagetask was potentially unreproduceable and could fail if for some reason this variable was then used.Quoted 9 lines
In this commit we move the recording of the datastore to the start of the
do_testimagetask. Thedo_testimage
task then reads this freshly generated json and passes it into the normal test machinery. This approach allows for the test machinery to still be loosely coupled to bitbake, and thus still allows for the tests to be exported and used independently from bitbake. The caveat is, if there are datastore changes then the bitbake testimage task should be run before the tests can be ran independently again.I'm not sure I agree with this. The test data really should be written at either rootfs or image generation, not just before the tests are run.
If you wanted to run the tests independently, after this change you have no way to generate the data to do that without first running the tests at least once. That doesn't make sense.
The correct thing to do here is to ensure the
write_image_test_data()function indicates which variables it depends upon and hence reruns correctly.Cheers,
Richard
Re: [meta-oe][PATCH v2 4/4] testimage: Moved write_image_test_data to testimage bbclass.
Quoted 2 lines · Paulo Neves
Would assure you if it generated the test data on image creation *and* on test task?
No, it wouldn't.
Quoted 3 lines
If not please describe more or less how I could collect which variables
write_image_test_datadepends upon. Just a high level description would do.
I thought testdata contained a filtered list of variable keys but it doesn't, its a complete dump of the data store with some variables "broken" by the removal of TOPDIR. My proposal was based on my thought that it was filtered so that won't work.
Quoted 2 lines
I have really been in a good spirit to get this topic merged but I do not see a clear guidance for me to fix what was clearly broken.
It is not clearly broken. Its broken in the way you're trying to use it and expect it to work.
The usage of testdata is alongside the image that is built, they're a paired item. The image and the testdata go together. Either both are rebuilt together or they're not.
Personally, I think testdata should get filtered to the list of variables the testing code really needs, not just a dump of every value.
I thought the tests had markup to indicate which variables they needed for that reason, so a list of variables could be constructed. If we did that, this would allow us to rewrite the file (and rebuild the rootfs) when the values changed.
Quoted 3 lines
Actually the current code put there by intel should should be reverted in my opinion, as it broke all the controllers besides simpleremote and qemu.
I would very much like to fix that and your other patches in this area are good. Unfortunately you change a lot in the patches in one go though and it was too difficult to review like that.
If you were able to split those into smaller pieces that make one logical change/fix in each, that would help in getting those ones in at least.
Improving the test coverage so that things don't get broken again would also be very helpful.
Cheers,
Richard