diff mbox

[v2] qmp: fix __accept() in qmp.py

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

Commit Message

Jeff Cody Oct. 15, 2012, 8:58 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.

Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 QMP/qmp.py | 1 +
 1 file changed, 1 insertion(+)

Comments

Kevin Wolf Oct. 16, 2012, 8:06 a.m. UTC | #1
Am 15.10.2012 22:58, schrieb 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.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>

Thanks, applied to the block branch.

Kevin
Stefan Hajnoczi Oct. 16, 2012, 8:23 a.m. UTC | #2
On Mon, Oct 15, 2012 at 04:58:02PM -0400, 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.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  QMP/qmp.py | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Luiz Capitulino Oct. 17, 2012, 1:54 a.m. UTC | #3
On Mon, 15 Oct 2012 16:58:02 -0400
Jeff Cody <jcody@redhat.com> 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.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>

Acked-by: Luiz Capitulino <lcapitulino@redhat.com>

> ---
>  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):
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):