From f7a30375bd672986a0e670ea33038e7b9c728e03 Mon Sep 17 00:00:00 2001 From: Jim Fehlig Date: Fri, 9 Jan 2015 15:33:11 -0700 Subject: [PATCH] Revert "src/xenconfig: Xen-xl parser" This reverts commit 2c78051a14acfb7aba078d569b1632dfe0ca0853. Conflicts: src/Makefile.am Signed-off-by: Jim Fehlig --- .gitignore | 1 - cfg.mk | 3 +- configure.ac | 1 - po/POTFILES.in | 1 - src/Makefile.am | 25 +- src/libvirt_xenconfig.syms | 4 - src/xenconfig/xen_common.c | 3 +- src/xenconfig/xen_xl.c | 499 ---------------------------------- src/xenconfig/xen_xl.h | 33 --- src/xenconfig/xen_xl_disk.l | 256 ----------------- src/xenconfig/xen_xl_disk_i.h | 39 --- 11 files changed, 4 insertions(+), 861 deletions(-) delete mode 100644 src/xenconfig/xen_xl.c delete mode 100644 src/xenconfig/xen_xl.h delete mode 100644 src/xenconfig/xen_xl_disk.l delete mode 100644 src/xenconfig/xen_xl_disk_i.h diff --git a/.gitignore b/.gitignore index eac2203265..9d09709c5f 100644 --- a/.gitignore +++ b/.gitignore @@ -140,7 +140,6 @@ /src/remote/*_protocol.[ch] /src/rpc/virkeepaliveprotocol.[ch] /src/rpc/virnetprotocol.[ch] -/src/xenconfig/xen_xl_disk.[ch] /src/test_libvirt*.aug /src/test_virtlockd.aug /src/util/virkeymaps.h diff --git a/cfg.mk b/cfg.mk index 3df3dcbc31..21f83c3435 100644 --- a/cfg.mk +++ b/cfg.mk @@ -89,9 +89,8 @@ distdir: sc_vulnerable_makefile_CVE-2012-3386.z endif # Files that should never cause syntax check failures. -# (^(HACKING|docs/(news\.html\.in|.*\.patch))|\.(po|fig|gif|ico|png))$$ VC_LIST_ALWAYS_EXCLUDE_REGEX = \ - (^(HACKING|docs/(news\.html\.in|.*\.patch)|src/xenconfig/xen_xl_disk.[chl])|\.(po|fig|gif|ico|png))$$ + (^(HACKING|docs/(news\.html\.in|.*\.patch))|\.(po|fig|gif|ico|png))$$ # Functions like free() that are no-ops on NULL arguments. useless_free_options = \ diff --git a/configure.ac b/configure.ac index 167b875c9b..9d12079458 100644 --- a/configure.ac +++ b/configure.ac @@ -146,7 +146,6 @@ m4_ifndef([LT_INIT], [ ]) AM_PROG_CC_C_O AM_PROG_LD -AM_PROG_LEX AC_MSG_CHECKING([for how to mark DSO non-deletable at runtime]) LIBVIRT_NODELETE= diff --git a/po/POTFILES.in b/po/POTFILES.in index 094c8e3704..e7cb2cc197 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -247,7 +247,6 @@ src/xenapi/xenapi_driver.c src/xenapi/xenapi_utils.c src/xenconfig/xen_common.c src/xenconfig/xen_sxpr.c -src/xenconfig/xen_xl.c src/xenconfig/xen_xm.c tests/virpolkittest.c tools/libvirt-guests.sh.in diff --git a/src/Makefile.am b/src/Makefile.am index c7975e5d4f..e0e47d0658 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1000,22 +1000,11 @@ CPU_SOURCES = \ VMX_SOURCES = \ vmx/vmx.c vmx/vmx.h -AM_LFLAGS = -Pxl_disk_ --header-file=../$*.h -LEX_OUTPUT_ROOT = lex.xl_disk_ -BUILT_SOURCES += xenconfig/xen_xl_disk.c xenconfig/xen_xl_disk.h -# Generated header file is not implicitly added to dist -EXTRA_DIST += xenconfig/xen_xl_disk.h -CLEANFILES += xenconfig/xen_xl_disk.h xenconfig/xen_xl_disk.c - -XENXLDISKPARSER_SOURCES = xenconfig/xen_xl_disk.l - XENCONFIG_SOURCES = \ xenconfig/xenxs_private.h \ - xenconfig/xen_common.c xenconfig/xen_common.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 \ - xenconfig/xen_xl.c xenconfig/xen_xl.h \ - xenconfig/xen_xl_disk_i.h + xenconfig/xen_xm.c xenconfig/xen_xm.h pkgdata_DATA = cpu/cpu_map.xml @@ -1070,19 +1059,10 @@ libvirt_vmx_la_SOURCES = $(VMX_SOURCES) endif WITH_VMX if WITH_XENCONFIG -# Flex generated XL disk parser needs to be compiled without WARN_FLAGS -# Add the generated object to its own library to control CFLAGS -noinst_LTLIBRARIES += libvirt_xenxldiskparser.la -libvirt_xenxldiskparser_la_CFLAGS = \ - -I$(srcdir)/conf $(AM_CFLAGS) -Wno-unused-parameter -libvirt_xenxldiskparser_la_SOURCES = \ - $(XENXLDISKPARSER_SOURCES) - noinst_LTLIBRARIES += libvirt_xenconfig.la libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la libvirt_xenconfig_la_CFLAGS = \ -I$(srcdir)/conf $(AM_CFLAGS) -libvirt_xenconfig_la_LIBADD = libvirt_xenxldiskparser.la libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES) endif WITH_XENCONFIG @@ -1844,7 +1824,6 @@ EXTRA_DIST += \ $(VBOX_DRIVER_EXTRA_DIST) \ $(VMWARE_DRIVER_SOURCES) \ $(XENCONFIG_SOURCES) \ - $(XENXLDISKPARSER_SOURCES) \ $(ACCESS_DRIVER_POLKIT_POLICY) check-local: check-augeas diff --git a/src/libvirt_xenconfig.syms b/src/libvirt_xenconfig.syms index 3e2e5d6cbd..6541685fe5 100644 --- a/src/libvirt_xenconfig.syms +++ b/src/libvirt_xenconfig.syms @@ -16,10 +16,6 @@ xenParseSxprChar; xenParseSxprSound; xenParseSxprString; -#xenconfig/xen_xl.h -xenFormatXL; -xenParseXL; - # xenconfig/xen_xm.h xenFormatXM; xenParseXM; diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c index a2a1474f56..b40a72237b 100644 --- a/src/xenconfig/xen_common.c +++ b/src/xenconfig/xen_common.c @@ -1812,8 +1812,7 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def, int xendConfigVersion) { int hvm = STREQ(def->os.type, "hvm") ? 1 : 0; - if (def->ngraphics == 1 && - def->graphics[0]->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { + if (def->ngraphics == 1) { if (hvm || (xendConfigVersion < XEND_CONFIG_MIN_VERS_PVFB_NEWCONF)) { if (def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) { if (xenConfigSetInt(conf, "sdl", 1) < 0) diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c deleted file mode 100644 index 8d1d2a79ff..0000000000 --- a/src/xenconfig/xen_xl.c +++ /dev/null @@ -1,499 +0,0 @@ -/* - * xen_xl.c: Xen XL parsing functions - * - * 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 - * . - * - * Author: Kiarie Kahurani - */ - -#include - -#include "virconf.h" -#include "virerror.h" -#include "domain_conf.h" -#include "viralloc.h" -#include "virstring.h" -#include "xen_xl.h" -#include "xen_xl_disk.h" -#include "xen_xl_disk_i.h" - -#define VIR_FROM_THIS VIR_FROM_NONE - - -static int -xenParseXLSpice(virConfPtr conf, virDomainDefPtr def) -{ - virDomainGraphicsDefPtr graphics = NULL; - unsigned long port; - char *listenAddr = NULL; - int val; - - if (STREQ(def->os.type, "hvm")) { - if (xenConfigGetBool(conf, "spice", &val, 0) < 0) - return -1; - - if (val) { - if (VIR_ALLOC(graphics) < 0) - return -1; - - graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_SPICE; - if (xenConfigCopyStringOpt(conf, "spicehost", &listenAddr) < 0) - goto cleanup; - if (listenAddr && - virDomainGraphicsListenSetAddress(graphics, 0, listenAddr, - -1, true) < 0) { - goto cleanup; - } - VIR_FREE(listenAddr); - - if (xenConfigGetULong(conf, "spicetls_port", &port, 0) < 0) - goto cleanup; - graphics->data.spice.tlsPort = (int)port; - - if (xenConfigGetULong(conf, "spiceport", &port, 0) < 0) - goto cleanup; - - graphics->data.spice.port = (int)port; - - if (!graphics->data.spice.tlsPort && - !graphics->data.spice.port) - graphics->data.spice.autoport = 1; - - if (xenConfigGetBool(conf, "spicedisable_ticketing", &val, 0) < 0) - goto cleanup; - if (val) { - if (xenConfigCopyStringOpt(conf, "spicepasswd", - &graphics->data.spice.auth.passwd) < 0) - goto cleanup; - } - - if (xenConfigGetBool(conf, "spiceagent_mouse", - &graphics->data.spice.mousemode, 0) < 0) - goto cleanup; - if (xenConfigGetBool(conf, "spicedvagent", &val, 0) < 0) - goto cleanup; - if (val) { - if (xenConfigGetBool(conf, "spice_clipboard_sharing", - &graphics->data.spice.copypaste, - 0) < 0) - goto cleanup; - } - - if (VIR_ALLOC_N(def->graphics, 1) < 0) - goto cleanup; - def->graphics[0] = graphics; - def->ngraphics = 1; - } - } - - return 0; - - cleanup: - virDomainGraphicsDefFree(graphics); - return -1; -} - - -void -xenXLDiskParserError(xenXLDiskParserContext *dpc, - const char *erroneous, - const char *message) -{ - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk config %s not supported: %s"), - erroneous, message); - - if (!dpc->err) - dpc->err = EINVAL; -} - - -static int -xenXLDiskParserPrep(xenXLDiskParserContext *dpc, - const char *spec, - virDomainDiskDefPtr disk) -{ - int err; - - dpc->spec = spec; - dpc->disk = disk; - dpc->access_set = 0; - - err = xl_disk_lex_init_extra(dpc, &dpc->scanner); - if (err) - goto fail; - - dpc->buf = xl_disk__scan_bytes(spec, strlen(spec), dpc->scanner); - if (!dpc->buf) { - err = ENOMEM; - goto fail; - } - - return 0; - - fail: - virReportSystemError(errno, "%s", - _("failed to initialize disk configuration parser")); - return err; -} - - -static void -xenXLDiskParserCleanup(xenXLDiskParserContext *dpc) -{ - if (dpc->buf) { - xl_disk__delete_buffer(dpc->buf, dpc->scanner); - dpc->buf = NULL; - } - - if (dpc->scanner) { - xl_disk_lex_destroy(dpc->scanner); - dpc->scanner = NULL; - } -} - - -/* - * positional parameters - * (If the strings are not separated by "=" - * the string is split following ',' and assigned to - * the following options in the following order) - * target,format,vdev,access - * ================================================================ - * - * The parameters below cannot be specified as positional parameters: - * - * other parameters - * devtype = - * backendtype = - * parameters not taken care of - * backend = - * script =