def _get_qemu_img(self):
        """
        Search the qemu-img binary in the same binary of the qemu binary
        for avoiding version incompatibily.

        :returns: qemu-img path or raise an error
        """
        qemu_img_path = ""
        qemu_path_dir = os.path.dirname(self.qemu_path)
        try:
            for f in os.listdir(qemu_path_dir):
                if f.startswith("qemu-img"):
                    qemu_img_path = os.path.join(qemu_path_dir, f)
        except OSError as e:
            raise QemuError("Error while looking for qemu-img in {}: {}".format(qemu_path_dir, e))

        if not qemu_img_path:
            raise QemuError("Could not find qemu-img in {}".format(qemu_path_dir))

        return qemu_img_path
def _get_qemu_img ( self ) : qemu_img_path = "" qemu_path_dir = os . path . dirname ( self . qemu_path ) try : for f in os . listdir ( qemu_path_dir ) : if f . startswith ( "qemu-img" ) : qemu_img_path = os . path . join ( qemu_path_dir , f ) except OSError as e : raise QemuError ( "Error while looking for qemu-img in {}: {}" . format ( qemu_path_dir , e ) ) if not qemu_img_path : raise QemuError ( "Could not find qemu-img in {}" . format ( qemu_path_dir ) ) return qemu_img_path
Search the qemu-img binary in the same binary of the qemu binary
        for avoiding version incompatibily.

        :returns: qemu-img path or raise an error