mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-28 00:25:23 +00:00
de3289e2b5
There was one attempt a year ago done by me to drop HAL [1] but it was never resolved. There was another time when Dan suggested to drop HAL driver [2] but it was decided to keep it around in case device assignment will be implemented for FreeBSD and the fact that virt-manager uses node device driver [3]. I checked git history and code and it doesn't look like bhyve supports device assignment so from that POV it should not block removing HAL. The argument about virt-manager is not strong as well because libvirt installed from FreeBSD packages doesn't have HAL support so it will not affect these users as well [4]. The only users affected by this change would be the ones compiling libvirt from GIT on FreeBSD. I looked into alternatives and there is libudev-devd package on FreeBSD but unfortunately it doesn't work as it doesn't list any devices when used with libvirt. It provides libudev APIs using devd. I also looked into devd directly and it provides some APIs but there are no APIs for device monitoring and events so that would have to be somehow done by libvirt. Main motivation for dropping HAL support is to replace libdbus with GLib dbus implementation and it cannot be done with HAL driver present in libvirt because HAL APIs heavily depends on symbols provided by libdbus. [1] <https://www.redhat.com/archives/libvir-list/2019-May/msg00203.html> [2] <https://www.redhat.com/archives/libvir-list/2016-April/msg00992.html> [3] <https://www.redhat.com/archives/libvir-list/2016-April/msg00994.html> [4] <https://svnweb.freebsd.org/ports/head/devel/libvirt/Makefile?view=markup> Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
121 lines
3.4 KiB
C
121 lines
3.4 KiB
C
/*
|
|
* node_device_driver.h: node device enumeration
|
|
*
|
|
* 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
|
|
* License along with this library. If not, see
|
|
* <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "internal.h"
|
|
#include "driver.h"
|
|
#include "virnodedeviceobj.h"
|
|
#include "vircommand.h"
|
|
|
|
#define LINUX_NEW_DEVICE_WAIT_TIME 60
|
|
|
|
#ifdef WITH_UDEV
|
|
int
|
|
udevNodeRegister(void);
|
|
#endif
|
|
|
|
void
|
|
nodeDeviceLock(void);
|
|
|
|
void
|
|
nodeDeviceUnlock(void);
|
|
|
|
extern virNodeDeviceDriverStatePtr driver;
|
|
|
|
int
|
|
nodedevRegister(void);
|
|
|
|
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);
|
|
|
|
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);
|
|
|
|
int
|
|
nodeConnectNodeDeviceEventRegisterAny(virConnectPtr conn,
|
|
virNodeDevicePtr dev,
|
|
int eventID,
|
|
virConnectNodeDeviceEventGenericCallback callback,
|
|
void *opaque,
|
|
virFreeCallback freecb);
|
|
int
|
|
nodeConnectNodeDeviceEventDeregisterAny(virConnectPtr conn,
|
|
int callbackID);
|
|
|
|
virCommandPtr
|
|
nodeDeviceGetMdevctlStartCommand(virNodeDeviceDefPtr def,
|
|
char **uuid_out);
|
|
virCommandPtr
|
|
nodeDeviceGetMdevctlStopCommand(const char *uuid);
|