2016-11-22 03:58:17 +00:00
|
|
|
/*
|
|
|
|
* virscsivhost.h: helper APIs for managing host scsi_host devices
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016 IBM Corporation
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2019-06-18 16:13:07 +00:00
|
|
|
#pragma once
|
2016-11-22 03:58:17 +00:00
|
|
|
|
2019-06-18 16:13:07 +00:00
|
|
|
#include "internal.h"
|
|
|
|
#include "virobject.h"
|
2016-11-22 03:58:17 +00:00
|
|
|
|
|
|
|
typedef struct _virSCSIVHostDevice virSCSIVHostDevice;
|
|
|
|
typedef struct _virSCSIVHostDeviceList virSCSIVHostDeviceList;
|
|
|
|
|
2019-10-04 16:14:10 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSCSIVHostDeviceList, virObjectUnref);
|
|
|
|
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
typedef int (*virSCSIVHostDeviceFileActor)(virSCSIVHostDevice *dev,
|
2016-11-22 03:58:17 +00:00
|
|
|
const char *name, void *opaque);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int virSCSIVHostDeviceFileIterate(virSCSIVHostDevice *dev,
|
2016-11-22 03:58:17 +00:00
|
|
|
virSCSIVHostDeviceFileActor actor,
|
|
|
|
void *opaque);
|
2021-03-11 07:16:13 +00:00
|
|
|
const char *virSCSIVHostDeviceGetName(virSCSIVHostDevice *dev);
|
|
|
|
const char *virSCSIVHostDeviceGetPath(virSCSIVHostDevice *dev);
|
|
|
|
virSCSIVHostDevice *virSCSIVHostDeviceListGet(virSCSIVHostDeviceList *list,
|
2016-11-22 03:58:17 +00:00
|
|
|
int idx);
|
2021-03-11 07:16:13 +00:00
|
|
|
size_t virSCSIVHostDeviceListCount(virSCSIVHostDeviceList *list);
|
|
|
|
virSCSIVHostDevice *virSCSIVHostDeviceListSteal(virSCSIVHostDeviceList *list,
|
|
|
|
virSCSIVHostDevice *dev);
|
|
|
|
virSCSIVHostDevice *virSCSIVHostDeviceListFind(virSCSIVHostDeviceList *list,
|
|
|
|
virSCSIVHostDevice *dev);
|
|
|
|
int virSCSIVHostDeviceListAdd(virSCSIVHostDeviceList *list,
|
|
|
|
virSCSIVHostDevice *dev);
|
|
|
|
void virSCSIVHostDeviceListDel(virSCSIVHostDeviceList *list,
|
|
|
|
virSCSIVHostDevice *dev);
|
|
|
|
virSCSIVHostDeviceList *virSCSIVHostDeviceListNew(void);
|
|
|
|
virSCSIVHostDevice *virSCSIVHostDeviceNew(const char *name);
|
|
|
|
int virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev,
|
2016-11-22 03:58:17 +00:00
|
|
|
const char *drvname,
|
|
|
|
const char *domname);
|
2021-03-11 07:16:13 +00:00
|
|
|
void virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevice *dev,
|
2016-11-22 03:58:17 +00:00
|
|
|
const char **drv_name,
|
|
|
|
const char **dom_name);
|
2021-03-11 07:16:13 +00:00
|
|
|
void virSCSIVHostDeviceFree(virSCSIVHostDevice *dev);
|
2019-10-15 11:24:34 +00:00
|
|
|
int virSCSIVHostOpenVhostSCSI(int *vhostfd) G_GNUC_NO_INLINE;
|
2016-11-22 03:58:17 +00:00
|
|
|
|
2019-10-15 12:47:50 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSCSIVHostDevice, virSCSIVHostDeviceFree);
|