mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 05:45:46 +00:00
build: nuke more uses of 'sync'
Commit d5c86278
was incomplete; other functions also triggered
compiler warnings about collisions in the use of 'sync'.
* src/qemu/qemu_driver.c (qemuDomainSetTime): Fix another client.
* tools/virsh-domain-monitor.c (cmdDomTime): Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
d5c86278a7
commit
88b5acb67f
@ -16598,7 +16598,7 @@ qemuDomainSetTime(virDomainPtr dom,
|
|||||||
virQEMUDriverPtr driver = dom->conn->privateData;
|
virQEMUDriverPtr driver = dom->conn->privateData;
|
||||||
qemuDomainObjPrivatePtr priv;
|
qemuDomainObjPrivatePtr priv;
|
||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
bool sync = flags & VIR_DOMAIN_TIME_SYNC;
|
bool rtcSync = flags & VIR_DOMAIN_TIME_SYNC;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
@ -16625,7 +16625,7 @@ qemuDomainSetTime(virDomainPtr dom,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
qemuDomainObjEnterAgent(vm);
|
qemuDomainObjEnterAgent(vm);
|
||||||
rv = qemuAgentSetTime(priv->agent, seconds, nseconds, sync);
|
rv = qemuAgentSetTime(priv->agent, seconds, nseconds, rtcSync);
|
||||||
qemuDomainObjExitAgent(vm);
|
qemuDomainObjExitAgent(vm);
|
||||||
|
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
|
@ -1400,7 +1400,7 @@ cmdDomTime(vshControl *ctl, const vshCmd *cmd)
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
bool now = vshCommandOptBool(cmd, "now");
|
bool now = vshCommandOptBool(cmd, "now");
|
||||||
bool pretty = vshCommandOptBool(cmd, "pretty");
|
bool pretty = vshCommandOptBool(cmd, "pretty");
|
||||||
bool sync = vshCommandOptBool(cmd, "sync");
|
bool rtcSync = vshCommandOptBool(cmd, "sync");
|
||||||
long long seconds = 0;
|
long long seconds = 0;
|
||||||
unsigned int nseconds = 0;
|
unsigned int nseconds = 0;
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
@ -1426,13 +1426,13 @@ cmdDomTime(vshControl *ctl, const vshCmd *cmd)
|
|||||||
doSet = true;
|
doSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doSet || now || sync) {
|
if (doSet || now || rtcSync) {
|
||||||
if (now && ((seconds = time(NULL)) == (time_t) -1)) {
|
if (now && ((seconds = time(NULL)) == (time_t) -1)) {
|
||||||
vshError(ctl, _("Unable to get current time"));
|
vshError(ctl, _("Unable to get current time"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sync)
|
if (rtcSync)
|
||||||
flags |= VIR_DOMAIN_TIME_SYNC;
|
flags |= VIR_DOMAIN_TIME_SYNC;
|
||||||
|
|
||||||
if (virDomainSetTime(dom, seconds, nseconds, flags) < 0)
|
if (virDomainSetTime(dom, seconds, nseconds, flags) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user