mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
ch: add host device manager to driver
Co-authored-by: Wei Liu <liuwe@microsoft.com> Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
89ef0c0f2b
commit
5d4f9e1bdd
@ -21,6 +21,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "virdomainobjlist.h"
|
#include "virdomainobjlist.h"
|
||||||
|
#include "virhostdev.h"
|
||||||
#include "virthread.h"
|
#include "virthread.h"
|
||||||
#include "ch_capabilities.h"
|
#include "ch_capabilities.h"
|
||||||
#include "virebtables.h"
|
#include "virebtables.h"
|
||||||
@ -80,6 +81,9 @@ struct _virCHDriver
|
|||||||
|
|
||||||
/* Immutable pointer, lockless APIs. Pointless abstraction */
|
/* Immutable pointer, lockless APIs. Pointless abstraction */
|
||||||
ebtablesContext *ebtables;
|
ebtablesContext *ebtables;
|
||||||
|
|
||||||
|
/* Immutable pointer to host device manager */
|
||||||
|
virHostdevManager *hostdevMgr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CH_SAVE_MAGIC "libvirt-xml\n \0 \r"
|
#define CH_SAVE_MAGIC "libvirt-xml\n \0 \r"
|
||||||
|
@ -1365,6 +1365,7 @@ static int chStateCleanup(void)
|
|||||||
virObjectUnref(ch_driver->xmlopt);
|
virObjectUnref(ch_driver->xmlopt);
|
||||||
virObjectUnref(ch_driver->caps);
|
virObjectUnref(ch_driver->caps);
|
||||||
virObjectUnref(ch_driver->domains);
|
virObjectUnref(ch_driver->domains);
|
||||||
|
virObjectUnref(ch_driver->hostdevMgr);
|
||||||
virMutexDestroy(&ch_driver->lock);
|
virMutexDestroy(&ch_driver->lock);
|
||||||
g_clear_pointer(&ch_driver, g_free);
|
g_clear_pointer(&ch_driver, g_free);
|
||||||
|
|
||||||
@ -1414,6 +1415,9 @@ chStateInitialize(bool privileged,
|
|||||||
if (!(ch_driver->config = virCHDriverConfigNew(privileged)))
|
if (!(ch_driver->config = virCHDriverConfigNew(privileged)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (!(ch_driver->hostdevMgr = virHostdevManagerGetDefault()))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
if ((rv = chExtractVersion(ch_driver)) < 0) {
|
if ((rv = chExtractVersion(ch_driver)) < 0) {
|
||||||
if (rv == -2)
|
if (rv == -2)
|
||||||
ret = VIR_DRV_STATE_INIT_SKIPPED;
|
ret = VIR_DRV_STATE_INIT_SKIPPED;
|
||||||
|
Loading…
Reference in New Issue
Block a user