mirror of https://gitee.com/openkylin/qemu.git
qmp-shell: add -N option to skip negotiate
qemu-ga doesn't have negotiate phase. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170504125432.21653-2-marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
aa3b167f21
commit
c5e397df9e
|
@ -277,8 +277,8 @@ class QMPShell(qmp.QEMUMonitorProtocol):
|
||||||
self._print(resp)
|
self._print(resp)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def connect(self):
|
def connect(self, negotiate):
|
||||||
self._greeting = qmp.QEMUMonitorProtocol.connect(self)
|
self._greeting = qmp.QEMUMonitorProtocol.connect(self, negotiate)
|
||||||
self.__completer_setup()
|
self.__completer_setup()
|
||||||
|
|
||||||
def show_banner(self, msg='Welcome to the QMP low-level shell!'):
|
def show_banner(self, msg='Welcome to the QMP low-level shell!'):
|
||||||
|
@ -390,7 +390,7 @@ def die(msg):
|
||||||
def fail_cmdline(option=None):
|
def fail_cmdline(option=None):
|
||||||
if option:
|
if option:
|
||||||
sys.stderr.write('ERROR: bad command-line option \'%s\'\n' % option)
|
sys.stderr.write('ERROR: bad command-line option \'%s\'\n' % option)
|
||||||
sys.stderr.write('qemu-shell [ -v ] [ -p ] [ -H ] < UNIX socket path> | < TCP address:port >\n')
|
sys.stderr.write('qemu-shell [ -v ] [ -p ] [ -H ] [ -N ] < UNIX socket path> | < TCP address:port >\n')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -399,6 +399,7 @@ def main():
|
||||||
hmp = False
|
hmp = False
|
||||||
pretty = False
|
pretty = False
|
||||||
verbose = False
|
verbose = False
|
||||||
|
negotiate = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for arg in sys.argv[1:]:
|
for arg in sys.argv[1:]:
|
||||||
|
@ -408,6 +409,8 @@ def main():
|
||||||
hmp = True
|
hmp = True
|
||||||
elif arg == "-p":
|
elif arg == "-p":
|
||||||
pretty = True
|
pretty = True
|
||||||
|
elif arg == "-N":
|
||||||
|
negotiate = False
|
||||||
elif arg == "-v":
|
elif arg == "-v":
|
||||||
verbose = True
|
verbose = True
|
||||||
else:
|
else:
|
||||||
|
@ -425,7 +428,7 @@ def main():
|
||||||
die('bad port number in command-line')
|
die('bad port number in command-line')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
qemu.connect()
|
qemu.connect(negotiate)
|
||||||
except qmp.QMPConnectError:
|
except qmp.QMPConnectError:
|
||||||
die('Didn\'t get QMP greeting message')
|
die('Didn\'t get QMP greeting message')
|
||||||
except qmp.QMPCapabilitiesError:
|
except qmp.QMPCapabilitiesError:
|
||||||
|
|
Loading…
Reference in New Issue