Browse Source

sync_guest_time: use the proper errno

In qemuDomainSetTime, VIR_ERR_OPERATION_UNSUPPORTED
is used to report qemu doesn't support it.

[1]: 228ae70938/src/qemu/qemu_driver.c (L19437)

Change-Id: I84ddb9c434625fd4a57a4f54d0856044e1c56f3f
Signed-off-by: Chen Hanxiao <chenhx@certusnet.com.cn>
(cherry picked from commit a991471f3e)
changes/23/742423/2
Chen Hanxiao 3 years ago
committed by Lee Yarwood
parent
commit
e2caea6cae
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      nova/tests/unit/virt/libvirt/fakelibvirt.py
  2. +1
    -1
      nova/virt/libvirt/guest.py

+ 1
- 0
nova/tests/unit/virt/libvirt/fakelibvirt.py View File

@ -128,6 +128,7 @@ VIR_ERR_NO_NODE_DEVICE = 667
VIR_ERR_NO_SECRET = 66
VIR_ERR_AGENT_UNRESPONSIVE = 86
VIR_ERR_ARGUMENT_UNSUPPORTED = 74
VIR_ERR_OPERATION_UNSUPPORTED = 84
# Readonly
VIR_CONNECT_RO = 1


+ 1
- 1
nova/virt/libvirt/guest.py View File

@ -168,7 +168,7 @@ class Guest(object):
if code == libvirt.VIR_ERR_AGENT_UNRESPONSIVE:
LOG.debug('Failed to set time: QEMU agent unresponsive',
instance_uuid=self.uuid)
elif code == libvirt.VIR_ERR_NO_SUPPORT:
elif code == libvirt.VIR_ERR_OPERATION_UNSUPPORTED:
LOG.debug('Failed to set time: not supported',
instance_uuid=self.uuid)
elif code == libvirt.VIR_ERR_ARGUMENT_UNSUPPORTED:


Loading…
Cancel
Save