2008-11-04 23:22:06 +00:00
|
|
|
/*
|
|
|
|
* datatypes.h: management of structs for public data types
|
|
|
|
*
|
2019-01-03 01:55:25 +00:00
|
|
|
* Copyright (C) 2006-2019 Red Hat, Inc.
|
2008-11-04 23:22:06 +00:00
|
|
|
*
|
|
|
|
* 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
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2008-11-04 23:22:06 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#pragma once
|
2008-11-04 23:22:06 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#include "internal.h"
|
2008-11-04 23:22:06 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#include "driver.h"
|
|
|
|
#include "virthread.h"
|
|
|
|
#include "virobject.h"
|
|
|
|
#include "viruuid.h"
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
extern virClass *virConnectClass;
|
|
|
|
extern virClass *virDomainClass;
|
|
|
|
extern virClass *virDomainCheckpointClass;
|
|
|
|
extern virClass *virDomainSnapshotClass;
|
|
|
|
extern virClass *virInterfaceClass;
|
|
|
|
extern virClass *virNetworkClass;
|
|
|
|
extern virClass *virNetworkPortClass;
|
|
|
|
extern virClass *virNodeDeviceClass;
|
|
|
|
extern virClass *virNWFilterClass;
|
|
|
|
extern virClass *virNWFilterBindingClass;
|
|
|
|
extern virClass *virSecretClass;
|
|
|
|
extern virClass *virStreamClass;
|
|
|
|
extern virClass *virStorageVolClass;
|
|
|
|
extern virClass *virStoragePoolClass;
|
|
|
|
|
|
|
|
extern virClass *virAdmConnectClass;
|
|
|
|
extern virClass *virAdmServerClass;
|
|
|
|
extern virClass *virAdmClientClass;
|
2015-04-15 14:16:24 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckConnectReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
if (!virObjectIsClass(obj, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2013-12-28 03:31:17 +00:00
|
|
|
} while (0)
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckConnectGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
if (!virObjectIsClass(obj, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2013-12-28 03:31:17 +00:00
|
|
|
} while (0)
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckDomainReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virDomainPtr _dom = (obj); \
|
|
|
|
if (!virObjectIsClass(_dom, virDomainClass) || \
|
|
|
|
!virObjectIsClass(_dom->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_DOM, VIR_ERR_INVALID_DOMAIN, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2014-01-07 21:38:12 +00:00
|
|
|
} while (0)
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckDomainGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virDomainPtr _dom = (obj); \
|
|
|
|
if (!virObjectIsClass(_dom, virDomainClass) || \
|
|
|
|
!virObjectIsClass(_dom->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_DOM, VIR_ERR_INVALID_DOMAIN, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2014-01-07 21:38:12 +00:00
|
|
|
} while (0)
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckNetworkReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virNetworkPtr _net = (obj); \
|
|
|
|
if (!virObjectIsClass(_net, virNetworkClass) || \
|
|
|
|
!virObjectIsClass(_net->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_NETWORK, \
|
|
|
|
VIR_ERR_INVALID_NETWORK, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2013-12-27 23:52:40 +00:00
|
|
|
} while (0)
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckNetworkGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virNetworkPtr _net = (obj); \
|
|
|
|
if (!virObjectIsClass(_net, virNetworkClass) || \
|
|
|
|
!virObjectIsClass(_net->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_NETWORK, \
|
|
|
|
VIR_ERR_INVALID_NETWORK, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2013-12-27 23:52:40 +00:00
|
|
|
} while (0)
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2018-11-30 14:55:56 +00:00
|
|
|
#define virCheckNetworkPortReturn(obj, retval) \
|
|
|
|
do { \
|
|
|
|
virNetworkPortPtr _port = (obj); \
|
|
|
|
if (!virObjectIsClass(_port, virNetworkPortClass) || \
|
|
|
|
!virObjectIsClass(_port->net, virNetworkClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_NETWORK, \
|
|
|
|
VIR_ERR_INVALID_NETWORK_PORT, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define virCheckNetworkPortGoto(obj, label) \
|
|
|
|
do { \
|
|
|
|
virNetworkPortPtr _port = (obj); \
|
|
|
|
if (!virObjectIsClass(_port, virNetworkPortClass) || \
|
|
|
|
!virObjectIsClass(_port->net, virNetworkClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_NETWORK, \
|
|
|
|
VIR_ERR_INVALID_NETWORK_PORT, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckInterfaceReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virInterfacePtr _iface = (obj); \
|
|
|
|
if (!virObjectIsClass(_iface, virInterfaceClass) || \
|
|
|
|
!virObjectIsClass(_iface->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_INTERFACE, \
|
|
|
|
VIR_ERR_INVALID_INTERFACE, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2013-12-28 01:08:16 +00:00
|
|
|
} while (0)
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckStoragePoolReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virStoragePoolPtr _pool = (obj); \
|
|
|
|
if (!virObjectIsClass(_pool, virStoragePoolClass) || \
|
|
|
|
!virObjectIsClass(_pool->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_STORAGE, \
|
|
|
|
VIR_ERR_INVALID_STORAGE_POOL, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2013-12-28 01:12:05 +00:00
|
|
|
} while (0)
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckStoragePoolGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virStoragePoolPtr _pool= (obj); \
|
|
|
|
if (!virObjectIsClass(_pool, virStoragePoolClass) || \
|
|
|
|
!virObjectIsClass(_pool->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_STORAGE, \
|
|
|
|
VIR_ERR_INVALID_STORAGE_POOL, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2016-06-15 17:57:06 +00:00
|
|
|
} while (0)
|
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckStorageVolReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virStorageVolPtr _vol = (obj); \
|
|
|
|
if (!virObjectIsClass(_vol, virStorageVolClass) || \
|
|
|
|
!virObjectIsClass(_vol->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_STORAGE, \
|
|
|
|
VIR_ERR_INVALID_STORAGE_VOL, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2013-12-28 01:12:05 +00:00
|
|
|
} while (0)
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckStorageVolGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virStorageVolPtr _vol = (obj); \
|
|
|
|
if (!virObjectIsClass(_vol, virStorageVolClass) || \
|
|
|
|
!virObjectIsClass(_vol->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_STORAGE, \
|
|
|
|
VIR_ERR_INVALID_STORAGE_VOL, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2013-12-28 01:12:05 +00:00
|
|
|
} while (0)
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckNodeDeviceReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virNodeDevicePtr _node = (obj); \
|
|
|
|
if (!virObjectIsClass(_node, virNodeDeviceClass) || \
|
|
|
|
!virObjectIsClass(_node->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_NODEDEV, \
|
|
|
|
VIR_ERR_INVALID_NODE_DEVICE, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2013-12-28 01:12:05 +00:00
|
|
|
} while (0)
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckNodeDeviceGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virNodeDevicePtr _dev= (obj); \
|
|
|
|
if (!virObjectIsClass(_dev, virNodeDeviceClass) || \
|
|
|
|
!virObjectIsClass(_dev->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_NODEDEV, \
|
|
|
|
VIR_ERR_INVALID_NODE_DEVICE, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2016-07-28 12:02:50 +00:00
|
|
|
} while (0)
|
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckSecretReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virSecretPtr _secret = (obj); \
|
|
|
|
if (!virObjectIsClass(_secret, virSecretClass) || \
|
|
|
|
!virObjectIsClass(_secret->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_SECRET, \
|
|
|
|
VIR_ERR_INVALID_SECRET, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2013-12-28 01:12:05 +00:00
|
|
|
} while (0)
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckSecretGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virSecretPtr _secret = (obj); \
|
|
|
|
if (!virObjectIsClass(_secret, virSecretClass) || \
|
|
|
|
!virObjectIsClass(_secret->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_SECRET, \
|
|
|
|
VIR_ERR_INVALID_SECRET, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2016-12-22 15:09:55 +00:00
|
|
|
} while (0)
|
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckStreamReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virStreamPtr _st = (obj); \
|
|
|
|
if (!virObjectIsClass(_st, virStreamClass) || \
|
|
|
|
!virObjectIsClass(_st->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_STREAMS, \
|
|
|
|
VIR_ERR_INVALID_STREAM, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2013-12-28 01:12:05 +00:00
|
|
|
} while (0)
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckStreamGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virStreamPtr _st = (obj); \
|
|
|
|
if (!virObjectIsClass(_st, virStreamClass) || \
|
|
|
|
!virObjectIsClass(_st->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_STREAMS, \
|
|
|
|
VIR_ERR_INVALID_STREAM, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2013-12-28 01:12:05 +00:00
|
|
|
} while (0)
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckNWFilterReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virNWFilterPtr _nw = (obj); \
|
|
|
|
if (!virObjectIsClass(_nw, virNWFilterClass) || \
|
|
|
|
!virObjectIsClass(_nw->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_NWFILTER, \
|
|
|
|
VIR_ERR_INVALID_NWFILTER, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2013-12-28 01:12:05 +00:00
|
|
|
} while (0)
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckNWFilterBindingReturn(obj, retval) \
|
2018-05-09 11:21:25 +00:00
|
|
|
do { \
|
|
|
|
virNWFilterBindingPtr _nw = (obj); \
|
|
|
|
if (!virObjectIsClass(_nw, virNWFilterBindingClass) || \
|
|
|
|
!virObjectIsClass(_nw->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_NWFILTER, \
|
|
|
|
VIR_ERR_INVALID_NWFILTER_BINDING, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckDomainCheckpointReturn(obj, retval) \
|
2019-01-03 01:55:25 +00:00
|
|
|
do { \
|
|
|
|
virDomainCheckpointPtr _check = (obj); \
|
|
|
|
if (!virObjectIsClass(_check, virDomainCheckpointClass) || \
|
|
|
|
!virObjectIsClass(_check->domain, virDomainClass) || \
|
|
|
|
!virObjectIsClass(_check->domain->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_DOMAIN_CHECKPOINT, \
|
|
|
|
VIR_ERR_INVALID_DOMAIN_CHECKPOINT, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckDomainSnapshotReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virDomainSnapshotPtr _snap = (obj); \
|
|
|
|
if (!virObjectIsClass(_snap, virDomainSnapshotClass) || \
|
|
|
|
!virObjectIsClass(_snap->domain, virDomainClass) || \
|
|
|
|
!virObjectIsClass(_snap->domain->conn, virConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_DOMAIN_SNAPSHOT, \
|
|
|
|
VIR_ERR_INVALID_DOMAIN_SNAPSHOT, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2013-12-28 01:12:05 +00:00
|
|
|
} while (0)
|
2010-03-25 17:46:02 +00:00
|
|
|
|
2013-03-29 17:21:19 +00:00
|
|
|
|
2013-12-19 22:43:46 +00:00
|
|
|
/* Helper macros to implement VIR_DOMAIN_DEBUG using just C99. This
|
|
|
|
* assumes you pass fewer than 15 arguments to VIR_DOMAIN_DEBUG, but
|
|
|
|
* can easily be expanded if needed.
|
|
|
|
*
|
|
|
|
* Note that gcc provides extensions of "define a(b...) b" or
|
|
|
|
* "define a(b,...) b,##__VA_ARGS__" as a means of eliding a comma
|
|
|
|
* when no var-args are present, but we don't want to require gcc.
|
|
|
|
*/
|
2019-06-07 20:20:23 +00:00
|
|
|
#define VIR_ARG15(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \
|
|
|
|
_11, _12, _13, _14, _15, ...) _15
|
|
|
|
#define VIR_HAS_COMMA(...) VIR_ARG15(__VA_ARGS__, \
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0)
|
2013-12-19 22:43:46 +00:00
|
|
|
|
|
|
|
/* Form the name VIR_DOMAIN_DEBUG_[01], then call that macro,
|
|
|
|
* according to how many arguments are present. Two-phase due to
|
|
|
|
* macro expansion rules. */
|
2019-06-07 20:20:23 +00:00
|
|
|
#define VIR_DOMAIN_DEBUG_EXPAND(a, b, ...) \
|
2013-12-19 22:43:46 +00:00
|
|
|
VIR_DOMAIN_DEBUG_PASTE(a, b, __VA_ARGS__)
|
2019-06-07 20:20:23 +00:00
|
|
|
#define VIR_DOMAIN_DEBUG_PASTE(a, b, ...) \
|
2013-12-19 22:43:46 +00:00
|
|
|
a##b(__VA_ARGS__)
|
|
|
|
|
|
|
|
/* Internal use only, when VIR_DOMAIN_DEBUG has one argument. */
|
2019-06-07 20:20:23 +00:00
|
|
|
#define VIR_DOMAIN_DEBUG_0(dom) \
|
2013-12-19 22:43:46 +00:00
|
|
|
VIR_DOMAIN_DEBUG_2(dom, "%s", "")
|
|
|
|
|
|
|
|
/* Internal use only, when VIR_DOMAIN_DEBUG has three or more arguments. */
|
2019-06-07 20:20:23 +00:00
|
|
|
#define VIR_DOMAIN_DEBUG_1(dom, fmt, ...) \
|
2013-12-19 22:43:46 +00:00
|
|
|
VIR_DOMAIN_DEBUG_2(dom, ", " fmt, __VA_ARGS__)
|
|
|
|
|
|
|
|
/* Internal use only, with final format. */
|
2019-06-07 20:20:23 +00:00
|
|
|
#define VIR_DOMAIN_DEBUG_2(dom, fmt, ...) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
char _uuidstr[VIR_UUID_STRING_BUFLEN]; \
|
|
|
|
const char *_domname = NULL; \
|
|
|
|
\
|
|
|
|
if (!virObjectIsClass(dom, virDomainClass)) { \
|
|
|
|
memset(_uuidstr, 0, sizeof(_uuidstr)); \
|
|
|
|
} else { \
|
|
|
|
virUUIDFormat((dom)->uuid, _uuidstr); \
|
|
|
|
_domname = (dom)->name; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
VIR_DEBUG("dom=%p, (VM: name=%s, uuid=%s)" fmt, \
|
|
|
|
dom, NULLSTR(_domname), _uuidstr, __VA_ARGS__); \
|
2013-12-19 22:43:46 +00:00
|
|
|
} while (0)
|
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckAdmConnectReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
if (!virObjectIsClass(obj, virAdmConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2015-04-15 14:16:24 +00:00
|
|
|
} while (0)
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckAdmConnectGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
if (!virObjectIsClass(obj, virAdmConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2015-04-15 14:16:24 +00:00
|
|
|
} while (0)
|
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckAdmServerReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virAdmServerPtr _srv = (obj); \
|
|
|
|
if (!virObjectIsClass(_srv, virAdmServerClass) || \
|
|
|
|
!virObjectIsClass(_srv->conn, virAdmConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2015-08-13 14:20:27 +00:00
|
|
|
} while (0)
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckAdmServerGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virAdmServerPtr _srv = (obj); \
|
|
|
|
if (!virObjectIsClass(_srv, virAdmServerClass) || \
|
|
|
|
!virObjectIsClass(_srv->conn, virAdmConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2015-08-13 14:20:27 +00:00
|
|
|
} while (0);
|
|
|
|
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckAdmClientReturn(obj, retval) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virAdmClientPtr _clt = (obj); \
|
|
|
|
if (!virObjectIsClass(_clt, virAdmClientClass) || \
|
|
|
|
!virObjectIsClass(_clt->srv, virAdmServerClass) || \
|
|
|
|
!virObjectIsClass(_clt->srv->conn, virAdmConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
virDispatchError(NULL); \
|
|
|
|
return retval; \
|
|
|
|
} \
|
2016-04-13 08:35:26 +00:00
|
|
|
} while (0)
|
2019-06-07 20:20:23 +00:00
|
|
|
#define virCheckAdmClientGoto(obj, label) \
|
2017-11-03 12:09:47 +00:00
|
|
|
do { \
|
|
|
|
virAdmClientPtr _clt = (obj); \
|
|
|
|
if (!virObjectIsClass(_clt, virAdmClientClass) || \
|
|
|
|
!virObjectIsClass(_clt->srv, virAdmServerClass) || \
|
|
|
|
!virObjectIsClass(_clt->srv->conn, virAdmConnectClass)) { \
|
|
|
|
virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \
|
|
|
|
__FILE__, __FUNCTION__, __LINE__, \
|
|
|
|
__FUNCTION__); \
|
|
|
|
goto label; \
|
|
|
|
} \
|
2016-04-13 08:35:26 +00:00
|
|
|
} while (0);
|
|
|
|
|
2013-12-19 22:43:46 +00:00
|
|
|
/**
|
|
|
|
* VIR_DOMAIN_DEBUG:
|
|
|
|
* @dom: domain
|
|
|
|
* @fmt: optional format for additional information
|
|
|
|
* @...: optional arguments corresponding to @fmt.
|
|
|
|
*/
|
2019-06-07 20:20:23 +00:00
|
|
|
#define VIR_DOMAIN_DEBUG(...) \
|
2017-11-03 12:09:47 +00:00
|
|
|
VIR_DOMAIN_DEBUG_EXPAND(VIR_DOMAIN_DEBUG_, \
|
2013-12-19 22:43:46 +00:00
|
|
|
VIR_HAS_COMMA(__VA_ARGS__), \
|
|
|
|
__VA_ARGS__)
|
|
|
|
|
|
|
|
|
2013-03-29 17:21:19 +00:00
|
|
|
typedef struct _virConnectCloseCallbackData virConnectCloseCallbackData;
|
2015-12-10 12:46:45 +00:00
|
|
|
typedef struct _virAdmConnectCloseCallbackData virAdmConnectCloseCallbackData;
|
2013-03-29 17:21:19 +00:00
|
|
|
|
|
|
|
/**
|
2015-10-12 15:10:57 +00:00
|
|
|
* Internal structures holding data related to connection close callbacks.
|
2013-03-29 17:21:19 +00:00
|
|
|
*/
|
|
|
|
struct _virConnectCloseCallbackData {
|
|
|
|
virObjectLockable parent;
|
|
|
|
|
|
|
|
virConnectPtr conn;
|
|
|
|
virConnectCloseFunc callback;
|
|
|
|
void *opaque;
|
|
|
|
virFreeCallback freeCallback;
|
|
|
|
};
|
|
|
|
|
2015-12-10 12:46:45 +00:00
|
|
|
struct _virAdmConnectCloseCallbackData {
|
2015-10-12 15:10:57 +00:00
|
|
|
virObjectLockable parent;
|
|
|
|
|
2015-12-10 12:46:45 +00:00
|
|
|
virAdmConnectPtr conn;
|
|
|
|
virAdmConnectCloseFunc callback;
|
2015-10-12 15:10:57 +00:00
|
|
|
void *opaque;
|
|
|
|
virFreeCallback freeCallback;
|
|
|
|
};
|
|
|
|
|
2008-11-04 23:22:06 +00:00
|
|
|
/**
|
|
|
|
* _virConnect:
|
|
|
|
*
|
|
|
|
* Internal structure associated to a connection
|
|
|
|
*/
|
|
|
|
struct _virConnect {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObjectLockable parent;
|
2015-04-09 07:43:53 +00:00
|
|
|
|
|
|
|
/* All the variables from here, until declared otherwise in one of
|
|
|
|
* the following comments, are setup at time of connection open
|
|
|
|
* and never changed since. Thus no need to lock when accessing
|
|
|
|
* them.
|
2009-01-20 12:01:45 +00:00
|
|
|
*/
|
2011-07-07 23:29:42 +00:00
|
|
|
unsigned int flags; /* a set of connection flags */
|
2021-03-11 07:16:13 +00:00
|
|
|
virURI *uri; /* connection URI */
|
2008-11-04 23:22:06 +00:00
|
|
|
|
|
|
|
/* The underlying hypervisor driver and network driver. */
|
2021-03-11 07:16:13 +00:00
|
|
|
virHypervisorDriver *driver;
|
|
|
|
virNetworkDriver *networkDriver;
|
|
|
|
virInterfaceDriver *interfaceDriver;
|
|
|
|
virStorageDriver *storageDriver;
|
|
|
|
virNodeDeviceDriver *nodeDeviceDriver;
|
|
|
|
virSecretDriver *secretDriver;
|
|
|
|
virNWFilterDriver *nwfilterDriver;
|
2008-11-04 23:22:06 +00:00
|
|
|
|
2017-07-27 06:43:40 +00:00
|
|
|
/* Private data pointer which can be used by domain driver as
|
|
|
|
* it pleases.
|
2008-11-04 23:22:06 +00:00
|
|
|
* NB: 'private' is a reserved word in C++.
|
|
|
|
*/
|
|
|
|
void * privateData;
|
|
|
|
|
|
|
|
/*
|
2015-04-09 07:43:53 +00:00
|
|
|
* Object lock must be acquired before accessing/changing any of
|
|
|
|
* members following this point, or changing the ref count of any
|
|
|
|
* virDomain/virNetwork object associated with this connection.
|
2008-11-04 23:22:06 +00:00
|
|
|
*/
|
2009-01-20 12:01:45 +00:00
|
|
|
|
|
|
|
/* Per-connection error. */
|
|
|
|
virError err; /* the last error */
|
2015-08-10 07:31:45 +00:00
|
|
|
virErrorFunc handler; /* associated handler */
|
2009-01-20 12:01:45 +00:00
|
|
|
void *userData; /* the user data */
|
2008-11-04 23:22:06 +00:00
|
|
|
};
|
|
|
|
|
2019-10-04 16:14:10 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virConnect, virObjectUnref);
|
|
|
|
|
|
|
|
|
2015-04-15 14:16:24 +00:00
|
|
|
/**
|
2015-12-10 12:46:45 +00:00
|
|
|
* _virAdmConnect:
|
2015-04-15 14:16:24 +00:00
|
|
|
*
|
|
|
|
* Internal structure associated to an admin connection
|
|
|
|
*/
|
2015-12-10 12:46:45 +00:00
|
|
|
struct _virAdmConnect {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObjectLockable parent;
|
2021-03-11 07:16:13 +00:00
|
|
|
virURI *uri;
|
2015-04-15 14:16:24 +00:00
|
|
|
|
|
|
|
void *privateData;
|
|
|
|
virFreeCallback privateDataFreeFunc;
|
2015-10-12 15:10:57 +00:00
|
|
|
|
|
|
|
/* Per-connection close callback */
|
2021-03-11 07:16:13 +00:00
|
|
|
virAdmConnectCloseCallbackData *closeCallback;
|
2015-04-15 14:16:24 +00:00
|
|
|
};
|
|
|
|
|
2015-08-13 14:20:27 +00:00
|
|
|
/**
|
|
|
|
* _virAdmServer:
|
|
|
|
*
|
|
|
|
* Internal structure associated to a daemon server
|
|
|
|
*/
|
|
|
|
struct _virAdmServer {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2015-08-13 14:20:27 +00:00
|
|
|
virAdmConnectPtr conn; /* pointer back to the admin connection */
|
|
|
|
char *name; /* the server external name */
|
|
|
|
};
|
|
|
|
|
2016-04-13 08:35:26 +00:00
|
|
|
/**
|
|
|
|
* _virAdmClient:
|
|
|
|
*
|
|
|
|
* Internal structure associated to a client connected to daemon
|
|
|
|
*/
|
|
|
|
struct _virAdmClient {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2016-04-13 08:35:26 +00:00
|
|
|
virAdmServerPtr srv; /* pointer to the server client is
|
|
|
|
* connected to, which also holds a
|
|
|
|
* reference back to the admin connection
|
|
|
|
*/
|
|
|
|
unsigned long long id; /* client's ID */
|
|
|
|
long long timestamp; /* connection timestamp */
|
|
|
|
unsigned int transport; /* connection type as virClientTransport */
|
|
|
|
};
|
2015-04-15 14:16:24 +00:00
|
|
|
|
2008-11-04 23:22:06 +00:00
|
|
|
/**
|
|
|
|
* _virDomain:
|
|
|
|
*
|
|
|
|
* Internal structure associated to a domain
|
|
|
|
*/
|
|
|
|
struct _virDomain {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2008-11-04 23:22:06 +00:00
|
|
|
virConnectPtr conn; /* pointer back to the connection */
|
|
|
|
char *name; /* the domain external name */
|
|
|
|
int id; /* the domain ID */
|
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN]; /* the domain unique identifier */
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* _virNetwork:
|
|
|
|
*
|
2019-10-31 10:35:17 +00:00
|
|
|
* Internal structure associated to a network
|
2008-11-04 23:22:06 +00:00
|
|
|
*/
|
|
|
|
struct _virNetwork {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2008-11-04 23:22:06 +00:00
|
|
|
virConnectPtr conn; /* pointer back to the connection */
|
|
|
|
char *name; /* the network external name */
|
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN]; /* the network unique identifier */
|
|
|
|
};
|
|
|
|
|
2019-10-04 16:14:10 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetwork, virObjectUnref);
|
|
|
|
|
|
|
|
|
2018-11-30 14:55:56 +00:00
|
|
|
/**
|
|
|
|
* _virNetworkPort:
|
|
|
|
*
|
|
|
|
* Internal structure associated to a network port
|
|
|
|
*/
|
|
|
|
struct _virNetworkPort {
|
|
|
|
virObject parent;
|
|
|
|
virNetworkPtr net; /* pointer back to the connection */
|
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN]; /* the network unique identifier */
|
|
|
|
};
|
|
|
|
|
2019-10-04 16:14:10 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkPort, virObjectUnref);
|
|
|
|
|
2020-06-24 17:04:25 +00:00
|
|
|
/* virNetworkDHCPLease is defined in the public API - libvirt-network.h */
|
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkDHCPLease, virNetworkDHCPLeaseFree);
|
2019-10-04 16:14:10 +00:00
|
|
|
|
2009-05-20 14:26:49 +00:00
|
|
|
/**
|
|
|
|
* _virInterface:
|
|
|
|
*
|
|
|
|
* Internal structure associated to a physical host interface
|
|
|
|
*/
|
|
|
|
struct _virInterface {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2009-05-20 14:26:49 +00:00
|
|
|
virConnectPtr conn; /* pointer back to the connection */
|
|
|
|
char *name; /* the network external name */
|
|
|
|
char *mac; /* the interface MAC address */
|
|
|
|
};
|
|
|
|
|
2008-11-04 23:22:06 +00:00
|
|
|
/**
|
|
|
|
* _virStoragePool:
|
|
|
|
*
|
|
|
|
* Internal structure associated to a storage pool
|
|
|
|
*/
|
|
|
|
struct _virStoragePool {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2008-11-04 23:22:06 +00:00
|
|
|
virConnectPtr conn; /* pointer back to the connection */
|
|
|
|
char *name; /* the storage pool external name */
|
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN]; /* the storage pool unique identifier */
|
2012-11-10 07:18:07 +00:00
|
|
|
|
|
|
|
/* Private data pointer which can be used by driver as they wish.
|
|
|
|
* Cleanup function pointer can be hooked to provide custom cleanup
|
|
|
|
* operation.
|
|
|
|
*/
|
|
|
|
void *privateData;
|
|
|
|
virFreeCallback privateDataFreeFunc;
|
2008-11-04 23:22:06 +00:00
|
|
|
};
|
|
|
|
|
2019-10-04 16:14:10 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStoragePool, virObjectUnref);
|
|
|
|
|
|
|
|
|
2008-11-04 23:22:06 +00:00
|
|
|
/**
|
|
|
|
* _virStorageVol:
|
|
|
|
*
|
|
|
|
* Internal structure associated to a storage volume
|
|
|
|
*/
|
|
|
|
struct _virStorageVol {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2008-11-04 23:22:06 +00:00
|
|
|
virConnectPtr conn; /* pointer back to the connection */
|
|
|
|
char *pool; /* Pool name of owner */
|
|
|
|
char *name; /* the storage vol external name */
|
2011-06-22 19:51:32 +00:00
|
|
|
char *key; /* unique key for storage vol */
|
2012-11-10 07:18:07 +00:00
|
|
|
|
|
|
|
/* Private data pointer which can be used by driver as they wish.
|
|
|
|
* Cleanup function pointer can be hooked to provide custom cleanup
|
|
|
|
* operation.
|
|
|
|
*/
|
|
|
|
void *privateData;
|
|
|
|
virFreeCallback privateDataFreeFunc;
|
2008-11-04 23:22:06 +00:00
|
|
|
};
|
|
|
|
|
2019-10-04 16:14:10 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageVol, virObjectUnref);
|
|
|
|
|
|
|
|
|
2008-11-21 12:19:22 +00:00
|
|
|
/**
|
|
|
|
* _virNodeDevice:
|
|
|
|
*
|
|
|
|
* Internal structure associated with a node device
|
|
|
|
*/
|
|
|
|
struct _virNodeDevice {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2008-11-21 12:19:22 +00:00
|
|
|
virConnectPtr conn; /* pointer back to the connection */
|
|
|
|
char *name; /* device name (unique on node) */
|
2018-04-13 11:42:16 +00:00
|
|
|
char *parentName; /* parent device name */
|
2008-11-21 12:19:22 +00:00
|
|
|
};
|
|
|
|
|
2021-01-30 16:26:02 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNodeDevice, virObjectUnref);
|
|
|
|
|
2009-08-14 19:42:19 +00:00
|
|
|
/**
|
|
|
|
* _virSecret:
|
|
|
|
*
|
|
|
|
* Internal structure associated with a secret
|
|
|
|
*/
|
|
|
|
struct _virSecret {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2009-08-14 19:42:19 +00:00
|
|
|
virConnectPtr conn; /* pointer back to the connection */
|
2014-04-29 02:10:19 +00:00
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN]; /* the secret unique identifier */
|
Add usage type/id as a public API property of virSecret
* include/libvirt/libvirt.h, include/libvirt/libvirt.h.in: Add
virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage
* python/generator.py: Mark virSecretGetUsageType, virSecretGetUsageID
as not throwing exceptions
* qemud/remote.c: Implement dispatch for virLookupSecretByUsage
* qemud/remote_protocol.x: Add usage type & ID as attributes of
remote_nonnull_secret. Add RPC calls for new public APIs
* qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
* src/datatypes.c, src/datatypes.h: Add usageType and usageID as
properties of virSecretPtr
* src/driver.h: Add virLookupSecretByUsage driver entry point
* src/libvirt.c: Implement virSecretGetUsageType, virSecretGetUsageID
and virLookupSecretByUsage
* src/libvirt_public.syms: Export virSecretGetUsageType, virSecretGetUsageID
and virLookupSecretByUsage
* src/remote_internal.c: Implement virLookupSecretByUsage entry
* src/secret_conf.c, src/secret_conf.h: Remove the
virSecretUsageType enum, now in public API. Make volume
path mandatory when parsing XML
* src/secret_driver.c: Enforce usage uniqueness when defining secrets.
Implement virSecretLookupByUsage api method
* src/virsh.c: Include usage for secret-list command
2009-09-11 13:06:15 +00:00
|
|
|
int usageType; /* the type of usage */
|
|
|
|
char *usageID; /* the usage's unique identifier */
|
2009-08-14 19:42:19 +00:00
|
|
|
};
|
|
|
|
|
2008-11-21 12:19:22 +00:00
|
|
|
|
2009-07-10 11:18:12 +00:00
|
|
|
typedef int (*virStreamAbortFunc)(virStreamPtr, void *opaque);
|
|
|
|
typedef int (*virStreamFinishFunc)(virStreamPtr, void *opaque);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* _virStream:
|
|
|
|
*
|
|
|
|
* Internal structure associated with an input stream
|
|
|
|
*/
|
|
|
|
struct _virStream {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2009-07-10 11:18:12 +00:00
|
|
|
virConnectPtr conn;
|
2011-07-07 23:29:42 +00:00
|
|
|
unsigned int flags;
|
2009-07-10 11:18:12 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virStreamDriver *driver;
|
2009-07-10 11:18:12 +00:00
|
|
|
void *privateData;
|
2019-02-07 12:58:46 +00:00
|
|
|
virFreeCallback ff;
|
2009-07-10 11:18:12 +00:00
|
|
|
};
|
|
|
|
|
2019-01-03 01:55:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* _virDomainCheckpoint
|
|
|
|
*
|
|
|
|
* Internal structure associated with a domain checkpoint
|
|
|
|
*/
|
|
|
|
struct _virDomainCheckpoint {
|
|
|
|
virObject parent;
|
|
|
|
char *name;
|
|
|
|
virDomainPtr domain;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-03-31 20:33:13 +00:00
|
|
|
/**
|
|
|
|
* _virDomainSnapshot
|
|
|
|
*
|
|
|
|
* Internal structure associated with a domain snapshot
|
|
|
|
*/
|
|
|
|
struct _virDomainSnapshot {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
2010-03-31 20:33:13 +00:00
|
|
|
char *name;
|
|
|
|
virDomainPtr domain;
|
|
|
|
};
|
2009-07-10 11:18:12 +00:00
|
|
|
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
/**
|
|
|
|
* _virNWFilter:
|
|
|
|
*
|
|
|
|
* Internal structure associated to a network filter
|
|
|
|
*/
|
|
|
|
struct _virNWFilter {
|
2018-04-13 11:51:23 +00:00
|
|
|
virObject parent;
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
virConnectPtr conn; /* pointer back to the connection */
|
|
|
|
char *name; /* the network filter external name */
|
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN]; /* the network filter unique identifier */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-05-09 11:21:25 +00:00
|
|
|
/**
|
|
|
|
* _virNWFilterBinding:
|
|
|
|
*
|
|
|
|
* Internal structure associated to a network filter port binding
|
|
|
|
*/
|
|
|
|
struct _virNWFilterBinding {
|
|
|
|
virObject parent;
|
|
|
|
virConnectPtr conn; /* pointer back to the connection */
|
|
|
|
char *portdev; /* the network filter port device name */
|
|
|
|
char *filtername; /* the network filter name */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-07-31 16:55:36 +00:00
|
|
|
/*
|
|
|
|
* Helper APIs for allocating new object instances
|
|
|
|
*/
|
2008-11-04 23:22:06 +00:00
|
|
|
|
|
|
|
virConnectPtr virGetConnect(void);
|
2008-11-17 11:03:25 +00:00
|
|
|
virDomainPtr virGetDomain(virConnectPtr conn,
|
2012-07-20 14:24:51 +00:00
|
|
|
const char *name,
|
2017-03-28 15:08:03 +00:00
|
|
|
const unsigned char *uuid,
|
|
|
|
int id);
|
2008-11-17 11:03:25 +00:00
|
|
|
virNetworkPtr virGetNetwork(virConnectPtr conn,
|
2012-07-20 14:24:51 +00:00
|
|
|
const char *name,
|
|
|
|
const unsigned char *uuid);
|
2018-11-30 14:55:56 +00:00
|
|
|
virNetworkPortPtr virGetNetworkPort(virNetworkPtr net,
|
|
|
|
const unsigned char *uuid);
|
2009-05-20 14:26:49 +00:00
|
|
|
virInterfacePtr virGetInterface(virConnectPtr conn,
|
|
|
|
const char *name,
|
|
|
|
const char *mac);
|
2008-11-17 11:03:25 +00:00
|
|
|
virStoragePoolPtr virGetStoragePool(virConnectPtr conn,
|
2012-11-10 07:18:07 +00:00
|
|
|
const char *name,
|
|
|
|
const unsigned char *uuid,
|
|
|
|
void *privateData,
|
|
|
|
virFreeCallback freeFunc);
|
2008-11-17 11:03:25 +00:00
|
|
|
virStorageVolPtr virGetStorageVol(virConnectPtr conn,
|
2017-02-02 09:20:08 +00:00
|
|
|
const char *pool,
|
|
|
|
const char *name,
|
|
|
|
const char *key,
|
|
|
|
void *privateData,
|
|
|
|
virFreeCallback freeFunc);
|
2008-11-21 12:19:22 +00:00
|
|
|
virNodeDevicePtr virGetNodeDevice(virConnectPtr conn,
|
|
|
|
const char *name);
|
2009-08-14 19:42:19 +00:00
|
|
|
virSecretPtr virGetSecret(virConnectPtr conn,
|
Add usage type/id as a public API property of virSecret
* include/libvirt/libvirt.h, include/libvirt/libvirt.h.in: Add
virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage
* python/generator.py: Mark virSecretGetUsageType, virSecretGetUsageID
as not throwing exceptions
* qemud/remote.c: Implement dispatch for virLookupSecretByUsage
* qemud/remote_protocol.x: Add usage type & ID as attributes of
remote_nonnull_secret. Add RPC calls for new public APIs
* qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
* src/datatypes.c, src/datatypes.h: Add usageType and usageID as
properties of virSecretPtr
* src/driver.h: Add virLookupSecretByUsage driver entry point
* src/libvirt.c: Implement virSecretGetUsageType, virSecretGetUsageID
and virLookupSecretByUsage
* src/libvirt_public.syms: Export virSecretGetUsageType, virSecretGetUsageID
and virLookupSecretByUsage
* src/remote_internal.c: Implement virLookupSecretByUsage entry
* src/secret_conf.c, src/secret_conf.h: Remove the
virSecretUsageType enum, now in public API. Make volume
path mandatory when parsing XML
* src/secret_driver.c: Enforce usage uniqueness when defining secrets.
Implement virSecretLookupByUsage api method
* src/virsh.c: Include usage for secret-list command
2009-09-11 13:06:15 +00:00
|
|
|
const unsigned char *uuid,
|
|
|
|
int usageType,
|
|
|
|
const char *usageID);
|
2009-07-10 11:18:12 +00:00
|
|
|
virStreamPtr virGetStream(virConnectPtr conn);
|
2010-03-25 17:46:02 +00:00
|
|
|
virNWFilterPtr virGetNWFilter(virConnectPtr conn,
|
2012-07-20 14:24:51 +00:00
|
|
|
const char *name,
|
|
|
|
const unsigned char *uuid);
|
2018-05-09 11:21:25 +00:00
|
|
|
virNWFilterBindingPtr virGetNWFilterBinding(virConnectPtr conn,
|
|
|
|
const char *portdev,
|
|
|
|
const char *filtername);
|
2019-01-03 01:55:25 +00:00
|
|
|
virDomainCheckpointPtr virGetDomainCheckpoint(virDomainPtr domain,
|
|
|
|
const char *name);
|
2010-03-31 20:33:13 +00:00
|
|
|
virDomainSnapshotPtr virGetDomainSnapshot(virDomainPtr domain,
|
|
|
|
const char *name);
|
|
|
|
|
2015-12-10 12:46:45 +00:00
|
|
|
virAdmConnectPtr virAdmConnectNew(void);
|
2015-04-15 14:16:24 +00:00
|
|
|
|
2015-08-13 14:20:27 +00:00
|
|
|
virAdmServerPtr virAdmGetServer(virAdmConnectPtr conn,
|
|
|
|
const char *name);
|
2016-02-17 12:14:54 +00:00
|
|
|
|
2016-04-13 08:35:26 +00:00
|
|
|
virAdmClientPtr virAdmGetClient(virAdmServerPtr srv,
|
|
|
|
unsigned long long id,
|
|
|
|
unsigned long long timestamp,
|
|
|
|
unsigned int transport);
|
|
|
|
|
2020-05-15 15:36:00 +00:00
|
|
|
/* Thread local to watch if an ObjectUnref causes a Dispoe */
|
|
|
|
void virConnectWatchDispose(void);
|
|
|
|
bool virConnectWasDisposed(void);
|
|
|
|
void virAdmConnectWatchDispose(void);
|
|
|
|
bool virAdmConnectWasDisposed(void);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virConnectCloseCallbackData *virNewConnectCloseCallbackData(void);
|
|
|
|
void virConnectCloseCallbackDataRegister(virConnectCloseCallbackData *close,
|
2016-02-17 12:14:54 +00:00
|
|
|
virConnectPtr conn,
|
|
|
|
virConnectCloseFunc cb,
|
|
|
|
void *opaque,
|
|
|
|
virFreeCallback freecb);
|
2021-03-11 07:16:13 +00:00
|
|
|
void virConnectCloseCallbackDataUnregister(virConnectCloseCallbackData *close,
|
2016-02-17 12:14:54 +00:00
|
|
|
virConnectCloseFunc cb);
|
2021-03-11 07:16:13 +00:00
|
|
|
void virConnectCloseCallbackDataCall(virConnectCloseCallbackData *close,
|
2016-02-17 12:14:54 +00:00
|
|
|
int reason);
|
|
|
|
virConnectCloseFunc
|
2021-03-11 07:16:13 +00:00
|
|
|
virConnectCloseCallbackDataGetCallback(virConnectCloseCallbackData *close);
|
|
|
|
void virAdmConnectCloseCallbackDataReset(virAdmConnectCloseCallbackData *cbdata);
|
|
|
|
int virAdmConnectCloseCallbackDataRegister(virAdmConnectCloseCallbackData *cbdata,
|
2016-11-10 12:20:26 +00:00
|
|
|
virAdmConnectPtr conn,
|
|
|
|
virAdmConnectCloseFunc cb,
|
|
|
|
void *opaque,
|
|
|
|
virFreeCallback freecb);
|
2021-03-11 07:16:13 +00:00
|
|
|
int virAdmConnectCloseCallbackDataUnregister(virAdmConnectCloseCallbackData *cbdata,
|
2016-11-10 12:20:26 +00:00
|
|
|
virAdmConnectCloseFunc cb);
|