提交 d860b2f5 编写于 作者: J John Ferlan

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.
上级 336d4dac
...@@ -132,6 +132,7 @@ src/qemu/qemu_migration.c ...@@ -132,6 +132,7 @@ src/qemu/qemu_migration.c
src/qemu/qemu_monitor.c src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_json.c src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_text.c src/qemu/qemu_monitor_text.c
src/qemu/qemu_parse_command.c
src/qemu/qemu_process.c src/qemu/qemu_process.c
src/remote/remote_client_bodies.h src/remote/remote_client_bodies.h
src/remote/remote_driver.c src/remote/remote_driver.c
......
...@@ -794,6 +794,7 @@ QEMU_DRIVER_SOURCES = \ ...@@ -794,6 +794,7 @@ QEMU_DRIVER_SOURCES = \
qemu/qemu_blockjob.c qemu/qemu_blockjob.h \ qemu/qemu_blockjob.c qemu/qemu_blockjob.h \
qemu/qemu_capabilities.c qemu/qemu_capabilities.h \ qemu/qemu_capabilities.c qemu/qemu_capabilities.h \
qemu/qemu_command.c qemu/qemu_command.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_domain.c qemu/qemu_domain.h \
qemu/qemu_cgroup.c qemu/qemu_cgroup.h \ qemu/qemu_cgroup.c qemu/qemu_cgroup.h \
qemu/qemu_hostdev.c qemu/qemu_hostdev.h \ qemu/qemu_hostdev.c qemu/qemu_hostdev.h \
......
此差异已折叠。
/* /*
* qemu_command.h: QEMU command generation * 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 * Copyright (C) 2006 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
# define QEMU_MIGRATION_PORT_MIN 49152 # define QEMU_MIGRATION_PORT_MIN 49152
# define QEMU_MIGRATION_PORT_MAX 49215 # define QEMU_MIGRATION_PORT_MAX 49215
# define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024 VIR_ENUM_DECL(qemuVideo)
typedef struct _qemuBuildCommandLineCallbacks qemuBuildCommandLineCallbacks; typedef struct _qemuBuildCommandLineCallbacks qemuBuildCommandLineCallbacks;
typedef qemuBuildCommandLineCallbacks *qemuBuildCommandLineCallbacksPtr; typedef qemuBuildCommandLineCallbacks *qemuBuildCommandLineCallbacksPtr;
...@@ -245,23 +245,6 @@ int qemuOpenVhostNet(virDomainDefPtr def, ...@@ -245,23 +245,6 @@ int qemuOpenVhostNet(virDomainDefPtr def,
int qemuNetworkPrepareDevices(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, int qemuDomainAssignAddresses(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps, virQEMUCapsPtr qemuCaps,
virDomainObjPtr obj) virDomainObjPtr obj)
...@@ -291,13 +274,6 @@ int qemuAssignDeviceChrAlias(virDomainDefPtr def, ...@@ -291,13 +274,6 @@ int qemuAssignDeviceChrAlias(virDomainDefPtr def,
ssize_t idx); ssize_t idx);
int qemuAssignDeviceRNGAlias(virDomainRNGDefPtr rng, size_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, int qemuGetDriveSourceString(virStorageSourcePtr src,
virConnectPtr conn, virConnectPtr conn,
char **source); char **source);
......
/* /*
* qemu_domain.c: QEMU domain private state * 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 * Copyright (C) 2006 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "qemu_domain.h" #include "qemu_domain.h"
#include "qemu_command.h" #include "qemu_command.h"
#include "qemu_parse_command.h"
#include "qemu_capabilities.h" #include "qemu_capabilities.h"
#include "qemu_migration.h" #include "qemu_migration.h"
#include "viralloc.h" #include "viralloc.h"
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "qemu_conf.h" #include "qemu_conf.h"
#include "qemu_capabilities.h" #include "qemu_capabilities.h"
#include "qemu_command.h" #include "qemu_command.h"
#include "qemu_parse_command.h"
#include "qemu_cgroup.h" #include "qemu_cgroup.h"
#include "qemu_hostdev.h" #include "qemu_hostdev.h"
#include "qemu_hotplug.h" #include "qemu_hotplug.h"
......
/* /*
* qemu_monitor_json.c: interaction with QEMU monitor console * 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 * Copyright (C) 2006 Daniel P. Berrange
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "qemu_monitor_text.h" #include "qemu_monitor_text.h"
#include "qemu_monitor_json.h" #include "qemu_monitor_json.h"
#include "qemu_command.h" #include "qemu_command.h"
#include "qemu_parse_command.h"
#include "qemu_capabilities.h" #include "qemu_capabilities.h"
#include "viralloc.h" #include "viralloc.h"
#include "virlog.h" #include "virlog.h"
......
此差异已折叠。
/*
* 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__*/
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#ifdef WITH_QEMU #ifdef WITH_QEMU
# include "internal.h" # include "internal.h"
# include "qemu/qemu_command.h" # include "qemu/qemu_parse_command.h"
# include "testutilsqemu.h" # include "testutilsqemu.h"
# include "virstring.h" # include "virstring.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册