mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
ch: Rework virCHProcessConnectMonitor()
Firstly, let's switch from explicit virCHDriverGetConfig() + virObjectUnref() combo to g_autoptr(virCHDriverConfig). This leaves us with the @monitor variable which is initialized to NULL only to be then set to the retval of virCHMonitorNew() and returned instantly. Well, the variable is now useless and can be dropped. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
5ed2ed8708
commit
eb6c28408d
@ -53,13 +53,9 @@ virCHProcessConnectMonitor(virCHDriver *driver,
|
||||
virDomainObj *vm,
|
||||
int logfile)
|
||||
{
|
||||
virCHMonitor *monitor = NULL;
|
||||
virCHDriverConfig *cfg = virCHDriverGetConfig(driver);
|
||||
g_autoptr(virCHDriverConfig) cfg = virCHDriverGetConfig(driver);
|
||||
|
||||
monitor = virCHMonitorNew(vm, cfg, logfile);
|
||||
|
||||
virObjectUnref(cfg);
|
||||
return monitor;
|
||||
return virCHMonitorNew(vm, cfg, logfile);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user