mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
daemon: Get server name from the server itself
Since servers know their name, there is no need to supply such information twice. Also defeats inconsistencies. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
dad3b07814
commit
fd4f278e1a
@ -1400,7 +1400,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (!(dmn = virNetDaemonNew()) ||
|
||||
virNetDaemonAddServer(dmn, "libvirtd", srv) < 0) {
|
||||
virNetDaemonAddServer(dmn, srv) < 0) {
|
||||
ret = VIR_DAEMON_ERR_INIT;
|
||||
goto cleanup;
|
||||
}
|
||||
@ -1474,7 +1474,7 @@ int main(int argc, char **argv) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virNetDaemonAddServer(dmn, "admin", srvAdm) < 0) {
|
||||
if (virNetDaemonAddServer(dmn, srvAdm) < 0) {
|
||||
ret = VIR_DAEMON_ERR_INIT;
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ virLockDaemonNew(virLockDaemonConfigPtr config, bool privileged)
|
||||
goto error;
|
||||
|
||||
if (!(lockd->dmn = virNetDaemonNew()) ||
|
||||
virNetDaemonAddServer(lockd->dmn, "virtlockd", srv) < 0)
|
||||
virNetDaemonAddServer(lockd->dmn, srv) < 0)
|
||||
goto error;
|
||||
|
||||
if (!(lockd->lockspaces = virHashCreate(VIR_LOCK_DAEMON_NUM_LOCKSPACES,
|
||||
|
@ -161,7 +161,7 @@ virLogDaemonNew(virLogDaemonConfigPtr config, bool privileged)
|
||||
goto error;
|
||||
|
||||
if (!(logd->dmn = virNetDaemonNew()) ||
|
||||
virNetDaemonAddServer(logd->dmn, "virtlogd", logd->srv) < 0)
|
||||
virNetDaemonAddServer(logd->dmn, logd->srv) < 0)
|
||||
goto error;
|
||||
|
||||
if (!(logd->handler = virLogHandlerNew(privileged,
|
||||
|
@ -968,7 +968,7 @@ static int virLXCControllerSetupServer(virLXCControllerPtr ctrl)
|
||||
goto error;
|
||||
|
||||
if (!(ctrl->daemon = virNetDaemonNew()) ||
|
||||
virNetDaemonAddServer(ctrl->daemon, "LXC", srv) < 0)
|
||||
virNetDaemonAddServer(ctrl->daemon, srv) < 0)
|
||||
goto error;
|
||||
|
||||
virNetDaemonUpdateServices(ctrl->daemon, true);
|
||||
|
@ -158,10 +158,10 @@ virNetDaemonNew(void)
|
||||
|
||||
int
|
||||
virNetDaemonAddServer(virNetDaemonPtr dmn,
|
||||
const char *serverName,
|
||||
virNetServerPtr srv)
|
||||
{
|
||||
int ret = -1;
|
||||
const char *serverName = virNetServerGetName(srv);
|
||||
|
||||
virObjectLock(dmn);
|
||||
|
||||
|
@ -38,7 +38,6 @@
|
||||
virNetDaemonPtr virNetDaemonNew(void);
|
||||
|
||||
int virNetDaemonAddServer(virNetDaemonPtr dmn,
|
||||
const char *serverName,
|
||||
virNetServerPtr srv);
|
||||
|
||||
virNetServerPtr virNetDaemonAddServerPostExec(virNetDaemonPtr dmn,
|
||||
|
@ -164,7 +164,7 @@ static char *testGenerateJSON(const char *server_name)
|
||||
if (!(dmn = virNetDaemonNew()))
|
||||
goto cleanup;
|
||||
|
||||
if (virNetDaemonAddServer(dmn, server_name, srv) < 0)
|
||||
if (virNetDaemonAddServer(dmn, srv) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(json = virNetDaemonPreExecRestart(dmn)))
|
||||
|
Loading…
Reference in New Issue
Block a user