+ def _qemu_qga_flush(self):
+ """Flush the QGA parser state
+ """
+ qga_cmd = 'printf "\xFF" | sudo -S nc ' \
+ '-q 1 -U ' + self.__QGA_SOCK
+ (ret_code, stdout, stderr) = self._ssh.exec_command(qga_cmd)
+ if 0 != int(ret_code):
+ logger.debug('QGA execute failed {0}'.format(stderr))
+ raise RuntimeError('QGA execute "{0}" failed on {1}'.format(cmd,
+ self._node['host']))
+ logger.trace(stdout)
+ if not stdout:
+ return {}
+ return json.loads(stdout.split('\n', 1)[0])
+