提交 337a1362 编写于 作者: J Jim Fehlig

src/xenconfig: move common parsing/formatting to xen_common

XM and XL config are very similar.  Disks are specified differently
in XL, but the old XM disk config is still supported by XL.  XL also
supports new config like spice that was never supported by XM.

This patch moves all the common parsing and formatting functions to
the new file xen_common.c and adapts the XM parser/formatter accordingly.
This restructuring paves way for introducing an XL parser/formatter in
the future.

While moving the code, fixup whitespace, comments, and style issues.
Signed-off-by: NJim Fehlig <jfehlig@suse.com>
上级 f67bf6e9
......@@ -232,6 +232,7 @@ src/xen/xm_internal.c
src/xen/xs_internal.c
src/xenapi/xenapi_driver.c
src/xenapi/xenapi_utils.c
src/xenconfig/xen_common.c
src/xenconfig/xen_sxpr.c
src/xenconfig/xen_xm.c
tools/libvirt-guests.sh.in
......
......@@ -966,6 +966,7 @@ VMX_SOURCES = \
XENCONFIG_SOURCES = \
xenconfig/xenxs_private.h \
xenconfig/xen_common.c xenconfig/xen_common.h \
xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h \
xenconfig/xen_xm.c xenconfig/xen_xm.h
......
此差异已折叠。
/*
* xen_common.h: Parsing and formatting functions for config common
*
* Copyright (C) 2014 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/>.
*
* Author: Jim Fehlig <jfehlig@suse.com>
*/
#ifndef __VIR_XEN_COMMON_H__
# define __VIR_XEN_COMMON_H__
# include "internal.h"
# include "virconf.h"
# include "domain_conf.h"
int
xenConfigGetString(virConfPtr conf,
const char *name,
const char **value,
const char *def);
int xenParseConfigCommon(virConfPtr conf,
virDomainDefPtr def,
virCapsPtr caps,
int xendConfigVersion);
int xenFormatConfigCommon(virConfPtr conf,
virDomainDefPtr def,
virConnectPtr conn,
int xendConfigVersion);
#endif /* __VIR_XEN_COMMON_H__ */
此差异已折叠。
......@@ -36,14 +36,4 @@ virConfPtr xenFormatXM(virConnectPtr conn, virDomainDefPtr def,
virDomainDefPtr xenParseXM(virConfPtr conf, int xendConfigVersion,
virCapsPtr caps);
int xenParseConfigCommon(virConfPtr conf,
virDomainDefPtr def,
virCapsPtr caps,
int xendConfigVersion);
int xenFormatConfigCommon(virConfPtr conf,
virDomainDefPtr def,
virConnectPtr conn,
int xendConfigVersion);
#endif /* __VIR_XEN_XM_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册