[Libvir] PATCH 6/9: Split qemud_server struct in two

Richard W.M. Jones rjones at redhat.com
Mon Jun 18 13:08:34 UTC 2007


Daniel P. Berrange wrote:
> This is a very big patch, but actually there is no real functional change
> in it at all. It is splitting the qemud_server struct into 2 pieces. The
> qemud_server struct now only deals with client/server socket stuff. The
> new  qemud_driver struct deals with QEMU vms and networks. The driver.c
> and conf.c files are now 100% independant of the QEMU daemon, and so ready
> for the final adaption to the libvirt driver API.
> 
>  conf.c     |  192 ++++++++---------
>  conf.h     |   30 +-
>  dispatch.c |  295 +++++++++++----------------
>  driver.c   |  657 ++++++++++++++++++++++++++++++++++---------------------------
>  driver.h   |  335 ++++++++++++++++++++++++++-----
>  internal.h |  237 ----------------------
>  qemud.c    |   50 ----
>  7 files changed, 909 insertions(+), 887 deletions(-)

That's a complicated patch to follow, but the guts of it appears to be 
this, the rest being just code movement[1].

> diff -r af6d5f54a13a qemud/driver.h
> --- a/qemud/driver.h	Sun Jun 17 22:11:10 2007 -0400
> +++ b/qemud/driver.h	Sun Jun 17 22:11:17 2007 -0400
> @@ -27,21 +27,266 @@
[...]
> +/* Main driver state */
> +struct qemud_driver {
> +    int qemuVersion;
> +    int qemuCmdFlags; /* values from enum qemud_cmd_flags */
> +    int nactivevms;
> +    int ninactivevms;
> +    struct qemud_vm *vms;
> +    int nextvmid;
> +    int nactivenetworks;
> +    int ninactivenetworks;
> +    struct qemud_network *networks;
> +    brControl *brctl;
> +    iptablesContext *iptables;
> +    char *configDir;
> +    char *autostartDir;
> +    char *networkConfigDir;
> +    char *networkAutostartDir;
> +    char logDir[PATH_MAX];
> +};

> @@ -333,25 +123,9 @@ struct qemud_server {
>  struct qemud_server {
>      int nsockets;
>      struct qemud_socket *sockets;
> -    int qemuVersion;
> -    int qemuCmdFlags; /* values from enum qemud_cmd_flags */
>      int nclients;
>      struct qemud_client *clients;
>      int sigread;
> -    int nvmfds;
> -    int nactivevms;
> -    int ninactivevms;
> -    struct qemud_vm *vms;
> -    int nextvmid;
> -    int nactivenetworks;
> -    int ninactivenetworks;
> -    struct qemud_network *networks;
> -    brControl *brctl;
> -    iptablesContext *iptables;
> -    char *configDir;
> -    char *autostartDir;
> -    char *networkConfigDir;
> -    char *networkAutostartDir;
>      char logDir[PATH_MAX];
>      unsigned int shutdown : 1;
>  };

That did lead me to wonder what happened to server->nvmfds - there are 
two references to it in the code and both have been removed, but it 
turns out it was only ever being written to, which I guess made it less 
than useful.

Rich.

[1] Now if only there was a computer language where you define the 
structures and the code just followed ...

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070618/368081de/attachment-0001.bin>


More information about the libvir-list mailing list