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.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Jeff Cody 2012-10-15 16:58:02 -04:00 committed by Kevin Wolf
parent ee17f9d5fd
commit b3d0380ec2
1 changed files with 1 additions and 0 deletions

View File

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