2008-11-21 12:27:11 +00:00
|
|
|
/*
|
2014-03-07 13:38:51 +00:00
|
|
|
* node_device_driver.h: node device enumeration
|
2008-11-21 12:27:11 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Virtual Iron Software, Inc.
|
|
|
|
* Copyright (C) 2008 David F. Lively
|
|
|
|
*
|
|
|
|
* 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-21 12:27:11 +00:00
|
|
|
*/
|
|
|
|
|
2019-04-03 17:29:03 +00:00
|
|
|
#pragma once
|
2008-11-21 12:27:11 +00:00
|
|
|
|
2019-04-03 17:29:03 +00:00
|
|
|
#include "internal.h"
|
|
|
|
#include "driver.h"
|
|
|
|
#include "virnodedeviceobj.h"
|
2008-11-21 12:27:11 +00:00
|
|
|
|
2019-04-03 17:29:03 +00:00
|
|
|
#define LINUX_NEW_DEVICE_WAIT_TIME 60
|
2009-06-02 15:12:53 +00:00
|
|
|
|
2019-04-03 17:29:03 +00:00
|
|
|
#ifdef WITH_HAL
|
2017-05-12 15:49:18 +00:00
|
|
|
int
|
|
|
|
halNodeRegister(void);
|
2019-04-03 17:29:03 +00:00
|
|
|
#endif
|
2017-05-12 15:49:18 +00:00
|
|
|
|
2019-04-03 17:29:03 +00:00
|
|
|
#ifdef WITH_UDEV
|
2017-05-12 15:49:18 +00:00
|
|
|
int
|
|
|
|
udevNodeRegister(void);
|
2019-04-03 17:29:03 +00:00
|
|
|
#endif
|
2008-11-21 12:27:11 +00:00
|
|
|
|
2017-05-12 15:49:18 +00:00
|
|
|
void
|
|
|
|
nodeDeviceLock(void);
|
|
|
|
|
|
|
|
void
|
|
|
|
nodeDeviceUnlock(void);
|
2014-11-17 16:30:27 +00:00
|
|
|
|
|
|
|
extern virNodeDeviceDriverStatePtr driver;
|
2008-12-04 21:48:31 +00:00
|
|
|
|
2017-05-12 15:49:18 +00:00
|
|
|
int
|
|
|
|
nodedevRegister(void);
|
|
|
|
|
2018-01-26 11:16:00 +00:00
|
|
|
virDrvOpenStatus nodeConnectOpen(virConnectPtr conn,
|
|
|
|
virConnectAuthPtr auth,
|
|
|
|
virConfPtr conf,
|
|
|
|
unsigned int flags);
|
|
|
|
int nodeConnectClose(virConnectPtr conn);
|
|
|
|
int nodeConnectIsSecure(virConnectPtr conn);
|
|
|
|
int nodeConnectIsEncrypted(virConnectPtr conn);
|
|
|
|
int nodeConnectIsAlive(virConnectPtr conn);
|
|
|
|
|
2017-05-12 15:49:18 +00:00
|
|
|
int
|
|
|
|
nodeNumOfDevices(virConnectPtr conn,
|
|
|
|
const char *cap,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
int nodeListDevices(virConnectPtr conn,
|
|
|
|
const char *cap,
|
|
|
|
char **const names,
|
|
|
|
int maxnames,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
int
|
|
|
|
nodeConnectListAllNodeDevices(virConnectPtr conn,
|
|
|
|
virNodeDevicePtr **devices,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
virNodeDevicePtr
|
|
|
|
nodeDeviceLookupByName(virConnectPtr conn,
|
|
|
|
const char *name);
|
|
|
|
|
|
|
|
virNodeDevicePtr
|
|
|
|
nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn,
|
|
|
|
const char *wwnn,
|
|
|
|
const char *wwpn,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
char *
|
|
|
|
nodeDeviceGetXMLDesc(virNodeDevicePtr dev,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
char *
|
|
|
|
nodeDeviceGetParent(virNodeDevicePtr dev);
|
|
|
|
|
|
|
|
int
|
|
|
|
nodeDeviceNumOfCaps(virNodeDevicePtr dev);
|
|
|
|
|
|
|
|
int
|
|
|
|
nodeDeviceListCaps(virNodeDevicePtr dev,
|
|
|
|
char **const names,
|
|
|
|
int maxnames);
|
|
|
|
|
|
|
|
virNodeDevicePtr
|
|
|
|
nodeDeviceCreateXML(virConnectPtr conn,
|
|
|
|
const char *xmlDesc,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
int
|
|
|
|
nodeDeviceDestroy(virNodeDevicePtr dev);
|
2011-06-04 21:24:54 +00:00
|
|
|
|
2016-07-28 12:02:54 +00:00
|
|
|
int
|
|
|
|
nodeConnectNodeDeviceEventRegisterAny(virConnectPtr conn,
|
|
|
|
virNodeDevicePtr dev,
|
|
|
|
int eventID,
|
|
|
|
virConnectNodeDeviceEventGenericCallback callback,
|
|
|
|
void *opaque,
|
|
|
|
virFreeCallback freecb);
|
|
|
|
int
|
|
|
|
nodeConnectNodeDeviceEventDeregisterAny(virConnectPtr conn,
|
|
|
|
int callbackID);
|