[libvirt] [PATCH libvirt v2 6/9] remote/rpc: Use virNetServerGetProgram() to determine the program

John Ferlan jferlan at redhat.com
Thu Apr 26 15:08:15 UTC 2018



On 04/12/2018 08:41 AM, Marc Hartmayer wrote:
> Use virNetServerGetProgram() to determine the virNetServerProgram
> instead of using hard coded global variables. This allows us to remove
> the global variables @remoteProgram and @qemuProgram as they're now no
> longer necessary.
> 
> Signed-off-by: Marc Hartmayer <mhartmay at linux.vnet.ibm.com>
> Reviewed-by: Boris Fiuczynski <fiuczy at linux.ibm.com>
> ---
> 
> Note: I'm not 100% sure that there is no case where the lock for
> @client is already held by the thread which is calling
> virNetServerGetProgram and thus the lock order would be violated (the
> lock order has to be @server -> @client in the violating case it would
> be @client -> @server and therefore a deadlock might occur).
> 

Well the way I read virNetServerProgramDispatchCall it would seem both
@server and @client must be unlocked:

    /*
     * When the RPC handler is called:
     *
     *  - Server object is unlocked
     *  - Client object is unlocked
     *
     * Without locking, it is safe to use:
     *
     *   'args and 'ret'
     */
    rv = (dispatcher->func)(server, client, msg, &rerr, arg, ret);

> ---
>  src/libvirt_remote.syms             |   1 +
>  src/remote/remote_daemon.c          |   4 +-
>  src/remote/remote_daemon.h          |   3 -
>  src/remote/remote_daemon_dispatch.c | 116 +++++++++++++++++++++++++++---------
>  src/rpc/gendispatch.pl              |   6 ++
>  src/rpc/virnetserver.c              |  23 +++++++
>  src/rpc/virnetserver.h              |   2 +
>  7 files changed, 122 insertions(+), 33 deletions(-)
> 

Reviewed-by: John Ferlan <jferlan at redhat.com>

John




More information about the libvir-list mailing list