This patch set was part of the IPMI patches, but people have asked it to be separated out because it's useful by itself and the IPMI patches are stuck in legal limbo.
I have left the patch to move allocating CharDriverState in one place (patch 1). I didn't get much opinion either way, but I think it is an improvement and a net reduction in code. I also added a patch (patch 6) that goes another step there, it makes the error handling in qmp_chardev_add() consistent and is also a net reduction in code. The main patches to add the feature are patch 2 and patch 3. The rest are little possible bug fixes that I noticed while working in the code. I went through all the comments and I believe I fixed everything. Thanks to everyone that reviewed this before.