[libvirt] [PATCH 8/8] Implement RPC driver support for virDomainOpenGraphics

Eric Blake eblake at redhat.com
Mon Oct 24 22:32:24 UTC 2011


On 10/21/2011 06:56 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange"<berrange at redhat.com>
>
> Since it needs to access file descriptors pass in the msg,

s/pass/passed/

> the RPC driver for virDomainOpenGraphics needs to be manually
> implemented.
>
> * daemon/remote.c: RPC server dispatcher
> * src/remote/remote_driver.c: RPC client dispatcher
> * src/remote/remote_protocol.x: Define protocol
> ---
>   daemon/remote.c              |   43 ++++++++++++++++++++++++
>   src/remote/remote_driver.c   |   73 +++++++++++++++++++++++++++++++++++------
>   src/remote/remote_protocol.x |    9 ++++-
>   3 files changed, 113 insertions(+), 12 deletions(-)
>
> diff --git a/daemon/remote.c b/daemon/remote.c
> index 2507e91..291011a 100644
> --- a/daemon/remote.c
> +++ b/daemon/remote.c
> @@ -44,6 +44,7 @@
>   #include "intprops.h"
>   #include "virnetserverservice.h"
>   #include "virnetserver.h"
> +#include "virfile.h"
>
>   #include "remote_protocol.h"
>   #include "qemu_protocol.h"
> @@ -3124,6 +3125,48 @@ cleanup:
>   }
>

>
> +static int
> +remoteDispatchDomainOpenGraphics(virNetServerPtr server ATTRIBUTE_UNUSED,
> +                                 virNetServerClientPtr client ATTRIBUTE_UNUSED,
> +                                 virNetMessagePtr msg,
> +                                 virNetMessageErrorPtr rerr,
> +                                 remote_domain_open_graphics_args *args)
> +{
> +    virDomainPtr dom = NULL;
> +    int rv = -1;
> +    int fd;

Must set fd to -1 here; otherwise, the first goto cleanup will end up 
calling VIR_FORCE_CLOSE on an uninit value, which could close an 
unintended fd.

> +++ b/src/remote/remote_protocol.x
> @@ -2253,6 +2253,12 @@ struct remote_domain_get_control_info_ret { /* insert at 1 */
>       unsigned hyper stateTime;
>   };
>
> +struct remote_domain_open_graphics_args {
> +    remote_nonnull_domain dom;
> +    unsigned int idx;
> +    unsigned int flags;
> +};
> +
>   /*----- Protocol. -----*/
>
>   /* Define the program number, protocol version and procedure numbers here. */
> @@ -2546,7 +2552,8 @@ enum remote_procedure {
>       REMOTE_PROC_DOMAIN_SNAPSHOT_GET_PARENT = 244, /* autogen autogen priority:high */
>       REMOTE_PROC_DOMAIN_RESET = 245, /* autogen autogen */
>       REMOTE_PROC_DOMAIN_SNAPSHOT_NUM_CHILDREN = 246, /* autogen autogen priority:high */
> -    REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_CHILDREN_NAMES = 247 /* autogen autogen priority:high */
> +    REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_CHILDREN_NAMES = 247, /* autogen autogen priority:high */
> +    REMOTE_PROC_DOMAIN_OPEN_GRAPHICS = 248 /* skipgen skipgen */
>
>       /*
>        * Notice how the entries are grouped in sets of 10 ?

Missing src/remote_protocol-structs changes.

ACK with those problems fixed.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list