Skip to contentSkip to conversation

qmp: fix __accept() in qmp.py

PATCH Superseded Jeff Cody 1 participant 2 messages Oct 15, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jeff Cody

author
#0 lore raw

PATCH 1/1 qmp: fix __accept() in qmp.py

In QEMUMonitorProtocol, commit e9d17b6 removed the __sockfile creation from __negotiate_capabilities(), which breaks _accept(). This causes failures in qemu-io python based tests (i.e. tests 030 and 040).

This patch creates the sockfile in __accept() as well.

---
 QMP/qmp.py | 1 +
 1 file changed, 1 insertion(+)
QMP/qmp.py +1 -0
index 33c7d36..32510a1 100644
@@ -96,6 +96,7 @@ class QEMUMonitorProtocol:
         @raise QMPCapabilitiesError if fails to negotiate capabilities
         """
         self.__sock, _ = self.__sock.accept()
+        self.__sockfile = self.__sock.makefile()
         return self.__negotiate_capabilities()
 
     def cmd_obj(self, qmp_cmd):
Signature · 1 line
1.7.11.4
author
#1 lore raw
Quoted 15 lines · Jeff Cody

In QEMUMonitorProtocol, commit e9d17b6 removed the __sockfile creation from __negotiate_capabilities(), which breaks _accept(). This causes failures in qemu-io python based tests (i.e. tests 030 and 040).

This patch creates the sockfile in __accept() as well.

---
 QMP/qmp.py | 1 +
 1 file changed, 1 insertion(+)
QMP/qmp.py +0 -0
index 33c7d36..32510a1 100644

QMP/qmp.py class QEMUMonitorProtocol: · line 102

Quoted 7 lines
QMP/qmp.py +1 -0
@@ -96,6 +96,7 @@ class QEMUMonitorProtocol:
         @raise QMPCapabilitiesError if fails to negotiate capabilities
         """
         self.__sock, _ = self.__sock.accept()
+        self.__sockfile = self.__sock.makefile()
         return self.__negotiate_capabilities()
 
     def cmd_obj(self, qmp_cmd):

Forgot the Signed-off-by: on this one, resending