Re: [PATCH v2 1/4] Add virDomainSendProcessSignal API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > Add an API for sending signals to arbitrary processes in the
> > guest OS. This is primarily useful for container based virt,
> > but can be used for machine virt too, if there is a suitable
> > guest agent,
> > 

> > +
> > +    if (signum > VIR_DOMAIN_PROCESS_SIGNAL_LAST) {
> > +        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
> > +        goto error;
> > +    }
> 
> Drop this hunk (rather, move it to patch 4/4).  Such a check
> should be done in the hypervisor driver, not in the entry
> point.  Otherwise, if we add a new signal later, this hunk
> would prevent an older virsh from sending the new signal.

On the other hand, you _should_ add a check here that prevents
signum==0, since we have documented that signum must be non-zero
as part of the API contract.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]