2017-03-10 12:32:46 +00:00
|
|
|
/*
|
|
|
|
* storage_adapter_conf.h: helpers to handle storage pool adapter manipulation
|
|
|
|
* (derived from storage_conf.h)
|
|
|
|
*
|
|
|
|
* 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-07 20:20:20 +00:00
|
|
|
#pragma once
|
2017-03-10 12:32:46 +00:00
|
|
|
|
2019-06-07 20:20:20 +00:00
|
|
|
#include "virpci.h"
|
|
|
|
#include "virxml.h"
|
|
|
|
#include "virenum.h"
|
2017-03-10 12:32:46 +00:00
|
|
|
|
2017-02-28 12:38:12 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
VIR_STORAGE_ADAPTER_TYPE_DEFAULT = 0,
|
|
|
|
VIR_STORAGE_ADAPTER_TYPE_SCSI_HOST,
|
|
|
|
VIR_STORAGE_ADAPTER_TYPE_FC_HOST,
|
|
|
|
|
|
|
|
VIR_STORAGE_ADAPTER_TYPE_LAST,
|
|
|
|
} virStorageAdapterType;
|
2019-01-20 16:04:56 +00:00
|
|
|
VIR_ENUM_DECL(virStorageAdapter);
|
2017-02-28 12:38:12 +00:00
|
|
|
|
|
|
|
typedef struct _virStorageAdapterSCSIHost virStorageAdapterSCSIHost;
|
|
|
|
typedef virStorageAdapterSCSIHost *virStorageAdapterSCSIHostPtr;
|
|
|
|
struct _virStorageAdapterSCSIHost {
|
|
|
|
char *name;
|
|
|
|
virPCIDeviceAddress parentaddr; /* host address */
|
|
|
|
int unique_id;
|
|
|
|
bool has_parent;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virStorageAdapterFCHost virStorageAdapterFCHost;
|
|
|
|
typedef virStorageAdapterFCHost *virStorageAdapterFCHostPtr;
|
|
|
|
struct _virStorageAdapterFCHost {
|
|
|
|
char *parent;
|
|
|
|
char *parent_wwnn;
|
|
|
|
char *parent_wwpn;
|
|
|
|
char *parent_fabric_wwn;
|
|
|
|
char *wwnn;
|
|
|
|
char *wwpn;
|
|
|
|
int managed; /* enum virTristateSwitch */
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virStorageAdapter virStorageAdapter;
|
|
|
|
typedef virStorageAdapter *virStorageAdapterPtr;
|
|
|
|
struct _virStorageAdapter {
|
|
|
|
int type; /* virStorageAdapterType */
|
|
|
|
|
|
|
|
union {
|
|
|
|
virStorageAdapterSCSIHost scsi_host;
|
|
|
|
virStorageAdapterFCHost fchost;
|
|
|
|
} data;
|
|
|
|
};
|
|
|
|
|
2017-03-10 12:32:46 +00:00
|
|
|
|
|
|
|
void
|
2017-02-28 12:38:12 +00:00
|
|
|
virStorageAdapterClear(virStorageAdapterPtr adapter);
|
2017-03-10 12:32:46 +00:00
|
|
|
|
|
|
|
int
|
2017-02-28 12:38:12 +00:00
|
|
|
virStorageAdapterParseXML(virStorageAdapterPtr adapter,
|
2017-03-10 18:24:56 +00:00
|
|
|
xmlNodePtr node,
|
|
|
|
xmlXPathContextPtr ctxt);
|
2017-03-10 12:32:46 +00:00
|
|
|
|
|
|
|
int
|
2017-02-28 12:38:12 +00:00
|
|
|
virStorageAdapterValidate(virStorageAdapterPtr adapter);
|
2017-03-10 12:32:46 +00:00
|
|
|
|
|
|
|
void
|
2017-03-10 18:24:56 +00:00
|
|
|
virStorageAdapterFormat(virBufferPtr buf,
|
2017-02-28 12:38:12 +00:00
|
|
|
virStorageAdapterPtr adapter);
|