Skip to content

Commit f15e426

Browse files
liuwbryteise
authored andcommitted
ch: add host device manager to driver
Signed-off-by: Wei Liu <[email protected]>
1 parent 32b7d54 commit f15e426

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/ch/ch_conf.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#pragma once
2222

2323
#include "virdomainobjlist.h"
24+
#include "virhostdev.h"
2425
#include "virthread.h"
2526
#include "virebtables.h"
2627

@@ -80,6 +81,9 @@ struct _virCHDriver
8081

8182
/* pid file FD, ensures two copies of the driver can't use the same root */
8283
int lockFD;
84+
85+
/* Immutable pointer to host device manager */
86+
virHostdevManagerPtr hostdevMgr;
8387
};
8488

8589
virCapsPtr virCHDriverCapsInit(void);

src/ch/ch_driver.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ static int chStateCleanup(void)
906906
virObjectUnref(ch_driver->xmlopt);
907907
virObjectUnref(ch_driver->caps);
908908
virObjectUnref(ch_driver->config);
909+
virObjectUnref(ch_driver->hostdevMgr);
909910
virMutexDestroy(&ch_driver->lock);
910911
VIR_FREE(ch_driver);
911912

@@ -949,6 +950,9 @@ static int chStateInitialize(bool privileged,
949950
if (!(ch_driver->config = virCHDriverConfigNew()))
950951
goto cleanup;
951952

953+
if (!(ch_driver->hostdevMgr = virHostdevManagerGetDefault()))
954+
goto cleanup;
955+
952956
if (chExtractVersion(ch_driver) < 0)
953957
goto cleanup;
954958

0 commit comments

Comments
 (0)