qemu: Split the command parsing routines into own module

Extract out the qemuParseCommandLine{String|Pid} into their own
separate module - taking with it all the various static functions.

Causes a ripple effect with a few other modules to include the
new qemu_parse_command.h.

Narrowed down the list of #include's in the split out module to
those that are necessary for build.
This commit is contained in:
John Ferlan 2016-02-10 07:33:47 -05:00
parent 336d4dace4
commit d860b2f537
10 changed files with 2805 additions and 2737 deletions

View File

@ -132,6 +132,7 @@ src/qemu/qemu_migration.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_text.c
src/qemu/qemu_parse_command.c
src/qemu/qemu_process.c
src/remote/remote_client_bodies.h
src/remote/remote_driver.c

View File

@ -794,6 +794,7 @@ QEMU_DRIVER_SOURCES = \
qemu/qemu_blockjob.c qemu/qemu_blockjob.h \
qemu/qemu_capabilities.c qemu/qemu_capabilities.h \
qemu/qemu_command.c qemu/qemu_command.h \
qemu/qemu_parse_command.c qemu/qemu_parse_command.h \
qemu/qemu_domain.c qemu/qemu_domain.h \
qemu/qemu_cgroup.c qemu/qemu_cgroup.h \
qemu/qemu_hostdev.c qemu/qemu_hostdev.h \

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/*
* qemu_command.h: QEMU command generation
*
* Copyright (C) 2006-2015 Red Hat, Inc.
* Copyright (C) 2006-2016 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@ -54,7 +54,7 @@
# define QEMU_MIGRATION_PORT_MIN 49152
# define QEMU_MIGRATION_PORT_MAX 49215
# define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024
VIR_ENUM_DECL(qemuVideo)
typedef struct _qemuBuildCommandLineCallbacks qemuBuildCommandLineCallbacks;
typedef qemuBuildCommandLineCallbacks *qemuBuildCommandLineCallbacksPtr;
@ -245,23 +245,6 @@ int qemuOpenVhostNet(virDomainDefPtr def,
int qemuNetworkPrepareDevices(virDomainDefPtr def);
/*
* NB: def->name can be NULL upon return and the caller
* *must* decide how to fill in a name in this case
*/
virDomainDefPtr qemuParseCommandLineString(virCapsPtr qemuCaps,
virDomainXMLOptionPtr xmlopt,
const char *args,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
bool *monJSON);
virDomainDefPtr qemuParseCommandLinePid(virCapsPtr qemuCaps,
virDomainXMLOptionPtr xmlopt,
pid_t pid,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
bool *monJSON);
int qemuDomainAssignAddresses(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps,
virDomainObjPtr obj)
@ -291,13 +274,6 @@ int qemuAssignDeviceChrAlias(virDomainDefPtr def,
ssize_t idx);
int qemuAssignDeviceRNGAlias(virDomainRNGDefPtr rng, size_t idx);
int
qemuParseKeywords(const char *str,
char ***retkeywords,
char ***retvalues,
int *retnkeywords,
int allowEmptyValue);
int qemuGetDriveSourceString(virStorageSourcePtr src,
virConnectPtr conn,
char **source);

View File

@ -1,7 +1,7 @@
/*
* qemu_domain.c: QEMU domain private state
*
* Copyright (C) 2006-2015 Red Hat, Inc.
* Copyright (C) 2006-2016 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@ -25,6 +25,7 @@
#include "qemu_domain.h"
#include "qemu_command.h"
#include "qemu_parse_command.h"
#include "qemu_capabilities.h"
#include "qemu_migration.h"
#include "viralloc.h"

View File

@ -49,6 +49,7 @@
#include "qemu_conf.h"
#include "qemu_capabilities.h"
#include "qemu_command.h"
#include "qemu_parse_command.h"
#include "qemu_cgroup.h"
#include "qemu_hostdev.h"
#include "qemu_hotplug.h"

View File

@ -1,7 +1,7 @@
/*
* qemu_monitor_json.c: interaction with QEMU monitor console
*
* Copyright (C) 2006-2015 Red Hat, Inc.
* Copyright (C) 2006-2016 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@ -34,6 +34,7 @@
#include "qemu_monitor_text.h"
#include "qemu_monitor_json.h"
#include "qemu_command.h"
#include "qemu_parse_command.h"
#include "qemu_capabilities.h"
#include "viralloc.h"
#include "virlog.h"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
/*
* qemu_parse_command.h: QEMU command parser
*
* Copyright (C) 2006-2016 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* 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: Daniel P. Berrange <berrange@redhat.com>
*/
#ifndef __QEMU_PARSE_COMMAND_H__
# define __QEMU_PARSE_COMMAND_H__
# define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024
/*
* NB: def->name can be NULL upon return and the caller
* *must* decide how to fill in a name in this case
*/
virDomainDefPtr qemuParseCommandLineString(virCapsPtr qemuCaps,
virDomainXMLOptionPtr xmlopt,
const char *args,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
bool *monJSON);
virDomainDefPtr qemuParseCommandLinePid(virCapsPtr qemuCaps,
virDomainXMLOptionPtr xmlopt,
pid_t pid,
char **pidfile,
virDomainChrSourceDefPtr *monConfig,
bool *monJSON);
int
qemuParseKeywords(const char *str,
char ***retkeywords,
char ***retvalues,
int *retnkeywords,
int allowEmptyValue);
#endif /* __QEMU_PARSE_COMMAND_H__*/

View File

@ -13,7 +13,7 @@
#ifdef WITH_QEMU
# include "internal.h"
# include "qemu/qemu_command.h"
# include "qemu/qemu_parse_command.h"
# include "testutilsqemu.h"
# include "virstring.h"