feat(qemu): make Qemu class extensible and QemuProcess injectable#122
feat(qemu): make Qemu class extensible and QemuProcess injectable#122Rahul-Sutariya wants to merge 1 commit into
Conversation
dff9347 to
14ea215
Compare
|
@Rahul-Sutariya What a coincidence. I am also working on extending the QEMU code: #123 |
lurtz
left a comment
There was a problem hiding this comment.
Changes look ok to me, but I am not really a code owner of ITF, thus not approving.
We should have a discussion what features the QEMU plugin should have and how its extension points look like.
Hi @lurtz, thanks for the feedback. This PR is focused on making the Regarding the broader discussion about the QEMU plugin's features and extension points, I think that is a separate design topic and outside the scope of this PR. I'm probably not the right person to drive that discussion, so I'd prefer to keep this change focused on the extensibility improvements it introduces. |
14ea215 to
a748f87
Compare
Add a single overridable hook `_extra_qemu_args()` to the Qemu class that returns additional command-line flags to append after the base devices. Defaults to [] so existing behavior is unchanged. Also add `qemu=None` parameter to QemuProcess.__init__ for dependency injection: when a pre-configured Qemu subclass instance is provided, it is used directly instead of constructing a default one. These two changes allow downstream plugins to inject custom QEMU devices (e.g. ivshmem-plain for inter-VM shared memory) via inheritance + override.
a748f87 to
fea832a
Compare
lurtz
left a comment
There was a problem hiding this comment.
approving because it looks like nobody else is looking at this PR. Might there be another refactoring of this code or is it final now?
feat(qemu): add _extra_qemu_args() hook and QemuProcess DI support
Add a single overridable hook
_extra_qemu_args()to the Qemu classthat returns additional command-line flags to append after the base
devices. Defaults to [] so existing behavior is unchanged.
Also add
qemu=Noneparameter to QemuProcess.init for dependencyinjection: when a pre-configured Qemu subclass instance is provided, it
is used directly instead of constructing a default one.
These two changes allow downstream plugins to inject custom QEMU devices
(e.g. ivshmem-plain for inter-VM shared memory) via inheritance +
override.