Cherry-picked Red Hat support from tommodore/master.