[Spice-devel] [vdagent-linux] vdagent: Silently ignore missing spicevmc device
Christophe Fergeau
cfergeau at redhat.com
Tue Jan 29 12:11:05 UTC 2019
On Tue, Jan 29, 2019 at 06:05:35AM -0500, Frediano Ziglio wrote:
> >
> > On most distros, spice-vdagent will be autostarted as part of the
> > startup of the desktop environment session. This is done by
> > spice-vdagent.desktop, which has no way of checking if we are in a virt
> > environment with the needed devices present.
> >
> > Currently, if /dev/virtio-ports/com.redhat.spice.0 is missing, we log an
> > error in syslog, and exit with an error exit code. This is too noisy
> > when autostarting it on a bare metal machine which have no use for
> > spice-vdagent. This reverts 0159111b to get rid of these warnings in the
> > session's logs
> >
> > https://gitlab.freedesktop.org/spice/linux/vd_agent/issues/12
> >
> > Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
>
> Sounds reasonable.
>
> > ---
> > src/vdagent/vdagent.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/vdagent/vdagent.c b/src/vdagent/vdagent.c
> > index 90247f9..dd89aa4 100644
> > --- a/src/vdagent/vdagent.c
> > +++ b/src/vdagent/vdagent.c
> > @@ -451,8 +451,8 @@ int main(int argc, char *argv[])
> > LOG_USER);
> >
> > if (file_test(portdev) != 0) {
> > - syslog(LOG_ERR, "Cannot access vdagent virtio channel %s", portdev);
> > - return 1;
> > + g_print("vdagent virtio channel %s is not available, exiting\n",
> > portdev);
>
> The "is not available" is weird. The file_test (quite misleading name too,
> what is testing? existence? access?) returns if we can get statistics
> information, more or less I assume we are checking the existence of the
> file (can also returns failure if we don't have directory access),
> maybe "vdagent virtio channel %s does not exist, exiting\n" ?
Fine with me.
>
> OT: why not using "access" function?
I was wondering exactly the same, I'll look into it.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190129/566a8f3f/attachment.sig>
More information about the Spice-devel
mailing list