diff options
author | Chen Hanxiao <chenhx@certusnet.com.cn> | 2018-06-06 03:24:58 +0800 |
---|---|---|
committer | Lee Yarwood <lyarwood@redhat.com> | 2021-01-21 19:37:13 +0000 |
commit | e2caea6cae13304c314fdd10ba78b689bb5a90d0 (patch) | |
tree | 3921659b3920b3feb24bbccec00d4d2c5ddcca17 | |
parent | 2592ee950e9ef1ac36bbc7f01ce94a25fd76bb1f (diff) | |
download | nova-e2caea6cae13304c314fdd10ba78b689bb5a90d0.tar.gz |
sync_guest_time: use the proper errno
In qemuDomainSetTime, VIR_ERR_OPERATION_UNSUPPORTED
is used to report qemu doesn't support it.
[1]: https://github.com/libvirt/libvirt/blob/228ae70938d0cb85353e35f744fbc494de619481/src/qemu/qemu_driver.c#L19437
Change-Id: I84ddb9c434625fd4a57a4f54d0856044e1c56f3f
Signed-off-by: Chen Hanxiao <chenhx@certusnet.com.cn>
(cherry picked from commit a991471f3e14298a8b32d1b5d566c895cea1c8e4)
-rw-r--r-- | nova/tests/unit/virt/libvirt/fakelibvirt.py | 1 | ||||
-rw-r--r-- | nova/virt/libvirt/guest.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/nova/tests/unit/virt/libvirt/fakelibvirt.py b/nova/tests/unit/virt/libvirt/fakelibvirt.py index 9022bbcdc4..69b1f74885 100644 --- a/nova/tests/unit/virt/libvirt/fakelibvirt.py +++ b/nova/tests/unit/virt/libvirt/fakelibvirt.py @@ -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 diff --git a/nova/virt/libvirt/guest.py b/nova/virt/libvirt/guest.py index 40fc213ecf..86e9aa051b 100644 --- a/nova/virt/libvirt/guest.py +++ b/nova/virt/libvirt/guest.py @@ -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: |