[libvirt] [PATCH] Revert "qemu: monitor: do not report error on shutdown"

Michal Privoznik posted 1 patch 6 years, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/56a55e53f903100918df111e88e875d8d61b8f65.1516366844.git.mprivozn@redhat.com
src/qemu/qemu_monitor.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
[libvirt] [PATCH] Revert "qemu: monitor: do not report error on shutdown"
Posted by Michal Privoznik 6 years, 3 months ago
This reverts commit aeda1b8c56dc58b0a413acc61bbea938b40499e1.

Problem is that we need mon->lastError to be set because it's
used all over the place. Also, there's nothing wrong with
reporting error if one occurred. I mean, if there's a thread
executing an API and which currently is talking on monitor it
definitely wants the error reported.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_monitor.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 85c7d68a1..fc146bdbf 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -78,7 +78,6 @@ struct _qemuMonitor {
      * < 0: an error occurred during the registration of @fd */
     int watch;
     int hasSendFD;
-    int willhangup;
 
     virDomainObjPtr vm;
 
@@ -716,10 +715,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque)
         if (events & VIR_EVENT_HANDLE_HANGUP) {
             hangup = true;
             if (!error) {
-                if (!mon->willhangup) {
-                    virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                                   _("End of file from qemu monitor"));
-                }
+                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                               _("End of file from qemu monitor"));
                 eof = true;
                 events &= ~VIR_EVENT_HANDLE_HANGUP;
             }
@@ -758,7 +755,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque)
         if (mon->lastError.code != VIR_ERR_OK) {
             /* Already have an error, so clear any new error */
             virResetLastError();
-        } else if (!mon->willhangup) {
+        } else {
             virErrorPtr err = virGetLastError();
             if (!err)
                 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -1352,7 +1349,6 @@ qemuMonitorEmitShutdown(qemuMonitorPtr mon, virTristateBool guest)
 {
     int ret = -1;
     VIR_DEBUG("mon=%p guest=%u", mon, guest);
-    mon->willhangup = 1;
 
     QEMU_MONITOR_CALLBACK(mon, ret, domainShutdown, mon->vm, guest);
     return ret;
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Revert "qemu: monitor: do not report error on shutdown"
Posted by Ján Tomko 6 years, 3 months ago
On Fri, Jan 19, 2018 at 02:00:44PM +0100, Michal Privoznik wrote:
>This reverts commit aeda1b8c56dc58b0a413acc61bbea938b40499e1.
>
>Problem is that we need mon->lastError to be set because it's
>used all over the place. Also, there's nothing wrong with
>reporting error if one occurred. I mean, if there's a thread
>executing an API and which currently is talking on monitor it
>definitely wants the error reported.
>

Is there a public bugzilla link you could add here?

>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
> src/qemu/qemu_monitor.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>

ACK

Jan
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Revert "qemu: monitor: do not report error on shutdown"
Posted by Michal Privoznik 6 years, 3 months ago
On 01/19/2018 02:11 PM, Ján Tomko wrote:
> On Fri, Jan 19, 2018 at 02:00:44PM +0100, Michal Privoznik wrote:
>> This reverts commit aeda1b8c56dc58b0a413acc61bbea938b40499e1.
>>
>> Problem is that we need mon->lastError to be set because it's
>> used all over the place. Also, there's nothing wrong with
>> reporting error if one occurred. I mean, if there's a thread
>> executing an API and which currently is talking on monitor it
>> definitely wants the error reported.
>>
> 
> Is there a public bugzilla link you could add here?

Sure:

https://bugzilla.redhat.com/show_bug.cgi?id=1536461

> 
>> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>> ---
>> src/qemu/qemu_monitor.c | 10 +++-------
>> 1 file changed, 3 insertions(+), 7 deletions(-)
>>
> 
> ACK

Pushed, thanks.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list