ch_driver: Pass virCHDriverConfig to virCHMonitorNew

Pass virCHDriverConfig to VirCHMonitorNew instead of just stateDir so
that the cfg can be used for any additional purposes.

Signed-off-by: Purna Pavan Chandra Aekkaladevi <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Purna Pavan Chandra Aekkaladevi 2024-03-11 09:43:58 +00:00 committed by Michal Privoznik
parent 6ea6208f35
commit 13f964a2ef
3 changed files with 4 additions and 3 deletions

View File

@ -529,10 +529,11 @@ chMonitorCreateSocket(const char *socket_path)
}
virCHMonitor *
virCHMonitorNew(virDomainObj *vm, const char *socketdir)
virCHMonitorNew(virDomainObj *vm, virCHDriverConfig *cfg)
{
g_autoptr(virCHMonitor) mon = NULL;
g_autoptr(virCommand) cmd = NULL;
const char *socketdir = cfg->stateDir;
int socket_fd = 0;
if (virCHMonitorInitialize() < 0)

View File

@ -101,7 +101,7 @@ struct _virCHMonitor {
virCHMonitorThreadInfo *threads;
};
virCHMonitor *virCHMonitorNew(virDomainObj *vm, const char *socketdir);
virCHMonitor *virCHMonitorNew(virDomainObj *vm, virCHDriverConfig *cfg);
void virCHMonitorClose(virCHMonitor *mon);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCHMonitor, virCHMonitorClose);

View File

@ -52,7 +52,7 @@ virCHProcessConnectMonitor(virCHDriver *driver,
virCHMonitor *monitor = NULL;
virCHDriverConfig *cfg = virCHDriverGetConfig(driver);
monitor = virCHMonitorNew(vm, cfg->stateDir);
monitor = virCHMonitorNew(vm, cfg);
virObjectUnref(cfg);
return monitor;