diff mbox

qmp: fix __accept() in qmp.py

Message ID 1350327468-11657-1-git-send-email-jcody@redhat.com
State New
Headers show

Commit Message

Jeff Cody Oct. 15, 2012, 6:57 p.m. UTC
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(+)

Comments

Jeff Cody Oct. 15, 2012, 8:54 p.m. UTC | #1
On 10/15/2012 02:57 PM, Jeff Cody wrote:
> 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(+)
> 
> diff --git a/QMP/qmp.py b/QMP/qmp.py
> index 33c7d36..32510a1 100644
> --- a/QMP/qmp.py
> +++ b/QMP/qmp.py
> @@ -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
diff mbox

Patch

diff --git a/QMP/qmp.py b/QMP/qmp.py
index 33c7d36..32510a1 100644
--- a/QMP/qmp.py
+++ b/QMP/qmp.py
@@ -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):