[libvirt PATCH 1/9] qemu: start the D-Bus daemon as needed
Marc-André Lureau
marcandre.lureau at redhat.com
Thu Dec 2 13:52:54 UTC 2021
On Mon, Nov 29, 2021 at 9:20 PM Michal Prívozník <mprivozn at redhat.com> wrote:
>
> On 11/5/21 11:51, marcandre.lureau at redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau at redhat.com>
> >
> > The daemon is started on daemon in external devices and hotplug code.
> > Add a mechanism to start it before qemu, if qemu itself needs it. (it is
> > already stopped in qemuProcessStop)
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
> > ---
> > src/qemu/qemu_domain.h | 1 +
> > src/qemu/qemu_process.c | 4 ++++
> > 2 files changed, 5 insertions(+)
> >
> > diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
> > index 6728ab047ed0..575fb8393b83 100644
> > --- a/src/qemu/qemu_domain.h
> > +++ b/src/qemu/qemu_domain.h
> > @@ -237,6 +237,7 @@ struct _qemuDomainObjPrivate {
> > /* running backup job */
> > virDomainBackupDef *backup;
> >
> > + bool dbusDaemonWanted;
> > bool dbusDaemonRunning;
> >
> > /* list of Ids to migrate */
> > diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> > index d5f8a47ac293..4ca9b100a802 100644
> > --- a/src/qemu/qemu_process.c
> > +++ b/src/qemu/qemu_process.c
> > @@ -7284,6 +7284,10 @@ qemuProcessLaunch(virConnectPtr conn,
> > &nnicindexes, &nicindexes, 0)))
> > goto cleanup;
> >
> > + if (QEMU_DOMAIN_PRIVATE(vm)->dbusDaemonWanted &&
> > + qemuDBusStart(driver, vm) < 0)
> > + goto cleanup;
> > +
>
> We already have priv variable, so s/QEMU_DOMAIN_PRIVATE(vm)/priv/.
> However, we already have qemuExtDevicesStart() which I believe can be
> used to check whether dbus graphics was defined and thus whether dbus
> daemon needs to be started.
indeed, done.
thanks
>
>
> > if (incoming && incoming->fd != -1)
> > virCommandPassFD(cmd, incoming->fd, 0);
> >
> >
>
> Michal
>
More information about the libvir-list
mailing list