mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
qemu: Separate out namespace handling code
The qemu_domain.c file is big as is and we should split it into separate semantic blocks. Start with code that handles domain namespaces. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
587a32672e
commit
90eee87569
@ -167,6 +167,7 @@
|
||||
@SRCDIR@src/qemu/qemu_monitor.c
|
||||
@SRCDIR@src/qemu/qemu_monitor_json.c
|
||||
@SRCDIR@src/qemu/qemu_monitor_text.c
|
||||
@SRCDIR@src/qemu/qemu_namespace.c
|
||||
@SRCDIR@src/qemu/qemu_process.c
|
||||
@SRCDIR@src/qemu/qemu_qapi.c
|
||||
@SRCDIR@src/qemu/qemu_slirp.c
|
||||
|
@ -26,6 +26,7 @@ qemu_driver_sources = [
|
||||
'qemu_monitor.c',
|
||||
'qemu_monitor_json.c',
|
||||
'qemu_monitor_text.c',
|
||||
'qemu_namespace.c',
|
||||
'qemu_process.c',
|
||||
'qemu_qapi.c',
|
||||
'qemu_security.c',
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "qemu_capabilities.h"
|
||||
#include "qemu_domain.h"
|
||||
#include "qemu_firmware.h"
|
||||
#include "qemu_namespace.h"
|
||||
#include "qemu_security.h"
|
||||
#include "viruuid.h"
|
||||
#include "virbuffer.h"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -91,15 +91,6 @@ struct _qemuDomainUnpluggingDevice {
|
||||
#define QEMU_DEVICE_MAPPER_CONTROL_PATH "/dev/mapper/control"
|
||||
|
||||
|
||||
typedef enum {
|
||||
QEMU_DOMAIN_NS_MOUNT = 0,
|
||||
QEMU_DOMAIN_NS_LAST
|
||||
} qemuDomainNamespace;
|
||||
VIR_ENUM_DECL(qemuDomainNamespace);
|
||||
|
||||
bool qemuDomainNamespaceEnabled(virDomainObjPtr vm,
|
||||
qemuDomainNamespace ns);
|
||||
|
||||
/* Type of domain secret */
|
||||
typedef enum {
|
||||
VIR_DOMAIN_SECRET_INFO_TYPE_PLAIN = 0,
|
||||
@ -919,54 +910,6 @@ int qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev,
|
||||
char **path,
|
||||
int *perms);
|
||||
|
||||
int qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg,
|
||||
virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm);
|
||||
|
||||
int qemuDomainCreateNamespace(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm);
|
||||
|
||||
void qemuDomainDestroyNamespace(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm);
|
||||
|
||||
bool qemuDomainNamespaceAvailable(qemuDomainNamespace ns);
|
||||
|
||||
int qemuDomainNamespaceSetupDisk(virDomainObjPtr vm,
|
||||
virStorageSourcePtr src);
|
||||
|
||||
int qemuDomainNamespaceTeardownDisk(virDomainObjPtr vm,
|
||||
virStorageSourcePtr src);
|
||||
|
||||
int qemuDomainNamespaceSetupHostdev(virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr hostdev);
|
||||
|
||||
int qemuDomainNamespaceTeardownHostdev(virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr hostdev);
|
||||
|
||||
int qemuDomainNamespaceSetupMemory(virDomainObjPtr vm,
|
||||
virDomainMemoryDefPtr memory);
|
||||
|
||||
int qemuDomainNamespaceTeardownMemory(virDomainObjPtr vm,
|
||||
virDomainMemoryDefPtr memory);
|
||||
|
||||
int qemuDomainNamespaceSetupChardev(virDomainObjPtr vm,
|
||||
virDomainChrDefPtr chr);
|
||||
|
||||
int qemuDomainNamespaceTeardownChardev(virDomainObjPtr vm,
|
||||
virDomainChrDefPtr chr);
|
||||
|
||||
int qemuDomainNamespaceSetupRNG(virDomainObjPtr vm,
|
||||
virDomainRNGDefPtr rng);
|
||||
|
||||
int qemuDomainNamespaceTeardownRNG(virDomainObjPtr vm,
|
||||
virDomainRNGDefPtr rng);
|
||||
|
||||
int qemuDomainNamespaceSetupInput(virDomainObjPtr vm,
|
||||
virDomainInputDefPtr input);
|
||||
|
||||
int qemuDomainNamespaceTeardownInput(virDomainObjPtr vm,
|
||||
virDomainInputDefPtr input);
|
||||
|
||||
virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virDomainDefPtr def,
|
||||
const char *nodename,
|
||||
virStorageSourcePtr *src);
|
||||
|
@ -50,6 +50,7 @@
|
||||
#include "qemu_security.h"
|
||||
#include "qemu_checkpoint.h"
|
||||
#include "qemu_backup.h"
|
||||
#include "qemu_namespace.h"
|
||||
|
||||
#include "virerror.h"
|
||||
#include "virlog.h"
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "qemu_capabilities.h"
|
||||
#include "qemu_domain.h"
|
||||
#include "qemu_domain_address.h"
|
||||
#include "qemu_namespace.h"
|
||||
#include "qemu_command.h"
|
||||
#include "qemu_hostdev.h"
|
||||
#include "qemu_interface.h"
|
||||
|
1885
src/qemu/qemu_namespace.c
Normal file
1885
src/qemu/qemu_namespace.c
Normal file
File diff suppressed because it is too large
Load Diff
86
src/qemu/qemu_namespace.h
Normal file
86
src/qemu/qemu_namespace.h
Normal file
@ -0,0 +1,86 @@
|
||||
/*
|
||||
* qemu_namespace.h: QEMU domain namespace helpers
|
||||
*
|
||||
* Copyright (C) 2006-2020 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "virenum.h"
|
||||
#include "qemu_conf.h"
|
||||
#include "virconf.h"
|
||||
|
||||
typedef enum {
|
||||
QEMU_DOMAIN_NS_MOUNT = 0,
|
||||
QEMU_DOMAIN_NS_LAST
|
||||
} qemuDomainNamespace;
|
||||
VIR_ENUM_DECL(qemuDomainNamespace);
|
||||
|
||||
int qemuDomainEnableNamespace(virDomainObjPtr vm,
|
||||
qemuDomainNamespace ns);
|
||||
|
||||
bool qemuDomainNamespaceEnabled(virDomainObjPtr vm,
|
||||
qemuDomainNamespace ns);
|
||||
|
||||
int qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg,
|
||||
virSecurityManagerPtr mgr,
|
||||
virDomainObjPtr vm);
|
||||
|
||||
int qemuDomainCreateNamespace(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm);
|
||||
|
||||
void qemuDomainDestroyNamespace(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm);
|
||||
|
||||
bool qemuDomainNamespaceAvailable(qemuDomainNamespace ns);
|
||||
|
||||
int qemuDomainNamespaceSetupDisk(virDomainObjPtr vm,
|
||||
virStorageSourcePtr src);
|
||||
|
||||
int qemuDomainNamespaceTeardownDisk(virDomainObjPtr vm,
|
||||
virStorageSourcePtr src);
|
||||
|
||||
int qemuDomainNamespaceSetupHostdev(virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr hostdev);
|
||||
|
||||
int qemuDomainNamespaceTeardownHostdev(virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr hostdev);
|
||||
|
||||
int qemuDomainNamespaceSetupMemory(virDomainObjPtr vm,
|
||||
virDomainMemoryDefPtr memory);
|
||||
|
||||
int qemuDomainNamespaceTeardownMemory(virDomainObjPtr vm,
|
||||
virDomainMemoryDefPtr memory);
|
||||
|
||||
int qemuDomainNamespaceSetupChardev(virDomainObjPtr vm,
|
||||
virDomainChrDefPtr chr);
|
||||
|
||||
int qemuDomainNamespaceTeardownChardev(virDomainObjPtr vm,
|
||||
virDomainChrDefPtr chr);
|
||||
|
||||
int qemuDomainNamespaceSetupRNG(virDomainObjPtr vm,
|
||||
virDomainRNGDefPtr rng);
|
||||
|
||||
int qemuDomainNamespaceTeardownRNG(virDomainObjPtr vm,
|
||||
virDomainRNGDefPtr rng);
|
||||
|
||||
int qemuDomainNamespaceSetupInput(virDomainObjPtr vm,
|
||||
virDomainInputDefPtr input);
|
||||
|
||||
int qemuDomainNamespaceTeardownInput(virDomainObjPtr vm,
|
||||
virDomainInputDefPtr input);
|
@ -45,6 +45,7 @@
|
||||
#include "qemu_block.h"
|
||||
#include "qemu_domain.h"
|
||||
#include "qemu_domain_address.h"
|
||||
#include "qemu_namespace.h"
|
||||
#include "qemu_cgroup.h"
|
||||
#include "qemu_capabilities.h"
|
||||
#include "qemu_monitor.h"
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "qemu_domain.h"
|
||||
#include "qemu_namespace.h"
|
||||
#include "qemu_security.h"
|
||||
#include "virlog.h"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user