On Mon, Sep 02, 2013 at 12:22:40PM +0100, Daniel P. Berrange wrote:
On Fri, Aug 30, 2013 at 03:46:48PM -0600, Jim Fehlig wrote:
> Create libxl_domain.[ch] and move all functions operating on
> libxlDomainObjPrivate to these files. This will be useful for
> future patches that e.g. add job support for libxlDomainObjPrivate.
>
> Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
> ---
> po/POTFILES.in | 1 +
> src/Makefile.am | 1 +
> src/libxl/libxl_conf.c | 2 +-
> src/libxl/libxl_conf.h | 18 --
> src/libxl/libxl_domain.c | 469 +++++++++++++++++++++++++++++++++++++++++++++++
> src/libxl/libxl_domain.h | 61 ++++++
> src/libxl/libxl_driver.c | 436 +------------------------------------------
> 7 files changed, 535 insertions(+), 453 deletions(-)
>
> diff --git a/po/POTFILES.in b/po/POTFILES.in
> index 9a83069..281274e 100644
> --- a/po/POTFILES.in
> +++ b/po/POTFILES.in
> @@ -67,6 +67,7 @@ src/lxc/lxc_conf.c
> src/lxc/lxc_controller.c
> src/lxc/lxc_driver.c
> src/lxc/lxc_process.c
> +src/libxl/libxl_domain.c
> src/libxl/libxl_driver.c
> src/libxl/libxl_conf.c
> src/network/bridge_driver.c
> diff --git a/src/Makefile.am b/src/Makefile.am
> index d8b943d..82aefe3 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -657,6 +657,7 @@ XENAPI_DRIVER_SOURCES = \
>
> LIBXL_DRIVER_SOURCES = \
> libxl/libxl_conf.c libxl/libxl_conf.h \
> + libxl/libxl_domain.c libxl/libxl_domain.h \
> libxl/libxl_driver.c libxl/libxl_driver.h
>
> UML_DRIVER_SOURCES = \
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index f8937a4..f9ffe5d 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -39,7 +39,7 @@
> #include "viralloc.h"
> #include "viruuid.h"
> #include "capabilities.h"
> -#include "libxl_driver.h"
> +#include "libxl_domain.h"
> #include "libxl_conf.h"
> #include "libxl_utils.h"
> #include "virstoragefile.h"
> diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
> index 0498012..68e770c 100644
> --- a/src/libxl/libxl_conf.h
> +++ b/src/libxl/libxl_conf.h
> @@ -89,24 +89,6 @@ struct _libxlDriverPrivate {
> typedef struct _libxlEventHookInfo libxlEventHookInfo;
> typedef libxlEventHookInfo *libxlEventHookInfoPtr;
>
> -typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
> -typedef libxlDomainObjPrivate *libxlDomainObjPrivatePtr;
> -struct _libxlDomainObjPrivate {
> - virObjectLockable parent;
> -
> - /* per domain log stream for libxl messages */
> - FILE *logger_file;
> - xentoollog_logger *logger;
> - /* per domain libxl ctx */
> - libxl_ctx *ctx;
> - /* console */
> - virChrdevsPtr devs;
> - libxl_evgen_domain_death *deathW;
> -
> - /* list of libxl timeout registrations */
> - libxlEventHookInfoPtr timerRegistrations;
> -};
> -
> # define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
> # define LIBXL_SAVE_VERSION 1
>
> diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> new file mode 100644
> index 0000000..1d03797
> --- /dev/null
> +++ b/src/libxl/libxl_domain.c
> @@ -0,0 +1,469 @@
> +/*---------------------------------------------------------------------------*/
> +/* Copyright (C) 2011-2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
It is a pretty minor nitpick, but the normal style
/*
* filename.h: blah description blah
*
* Copyright (C) 2013 ....
without any '/*-------------------....'
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library. If not, see
> + * <
http://www.gnu.org/licenses/>.
> + *
> + * Authors:
> + * Jim Fehlig <jfehlig(a)suse.com>
> + */
> +/*---------------------------------------------------------------------------*/
Can remove the '------------------' here too
> diff --git a/src/libxl/libxl_domain.h b/src/libxl/libxl_domain.h
> new file mode 100644
> index 0000000..2797d38
> --- /dev/null
> +++ b/src/libxl/libxl_domain.h
> @@ -0,0 +1,61 @@
> +/*---------------------------------------------------------------------------*/
> +/* Copyright (C) 2011-2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
> + *
> + * This library is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * This library is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this library. If not, see
> + * <
http://www.gnu.org/licenses/>.
> + *
> + * Authors:
> + * Jim Fehlig <jfehlig(a)suse.com>
> + */
> +/*---------------------------------------------------------------------------*/
Same nitpick here too.