[{"id":1759263,"web_url":"http://patchwork.ozlabs.org/comment/1759263/","msgid":"<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>","list_archive_url":null,"date":"2017-08-29T12:06:48","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"Hi Fam,\n\nOn 08/28/2017 02:47 PM, Fam Zheng wrote:\n> This is the common code to implement a \"VM test\" to\n> \n>    1) Download and initialize a pre-defined VM that has necessary\n>    dependencies to build QEMU and SSH access.\n> \n>    2) Archive $SRC_PATH to a .tar file.\n> \n>    3) Boot the VM, and pass the source tar file to the guest.\n> \n>    4) SSH into the VM, untar the source tarball, build from the source.\n> \n> Signed-off-by: Fam Zheng <famz@redhat.com>\n> ---\n>   tests/vm/basevm.py | 287 +++++++++++++++++++++++++++++++++++++++++++++++++++++\n>   1 file changed, 287 insertions(+)\n>   create mode 100755 tests/vm/basevm.py\n> \n> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py\n> new file mode 100755\n> index 0000000000..d0095c5332\n> --- /dev/null\n> +++ b/tests/vm/basevm.py\n> @@ -0,0 +1,287 @@\n> +#!/usr/bin/env python\n> +#\n> +# VM testing base class\n> +#\n> +# Copyright (C) 2017 Red Hat Inc.\n> +#\n> +# Authors:\n> +#  Fam Zheng <famz@redhat.com>\n> +#\n> +# This work is licensed under the terms of the GNU GPL, version 2.  See\n> +# the COPYING file in the top-level directory.\n> +#\n> +\n> +import os\n> +import sys\n> +import logging\n> +import time\n> +import datetime\n> +sys.path.append(os.path.join(os.path.dirname(__file__), \"..\", \"..\", \"scripts\"))\n> +from qemu import QEMUMachine\n> +import subprocess\n> +import hashlib\n> +import optparse\n> +import atexit\n> +import tempfile\n> +import shutil\n> +import multiprocessing\n> +import traceback\n> +\n> +SSH_KEY = \"\"\"\\\n> +-----BEGIN RSA PRIVATE KEY-----\n> +MIIEowIBAAKCAQEAopAuOlmLV6LVHdFBj8/eeOwI9CqguIJPp7eAQSZvOiB4Ag/R\n> +coEhl/RBbrV5Yc/SmSD4PTpJO/iM10RwliNjDb4a3I8q3sykRJu9c9PI/YsH8WN9\n> ++NH2NjKPtJIcKTu287IM5JYxyB6nDoOzILbTyJ1TDR/xH6qYEfBAyiblggdjcvhA\n> +RTf93QIn39F/xLypXvT1K2O9BJEsnJ8lEUvB2UXhKo/JTfSeZF8wPBeowaP9EONk\n> +7b+nuJOWHGg68Ji6wVi62tjwl2Szch6lxIhZBpnV7QNRKMfYHP6eIyF4pusazzZq\n> +Telsq6xI2ghecWLzb/MF5A+rklsGx2FNuJSAJwIDAQABAoIBAHHi4o/8VZNivz0x\n> +cWXn8erzKV6tUoWQvW85Lj/2RiwJvSlsnYZDkx5af1CpEE2HA/pFT8PNRqsd+MWC\n> +7AEy710cVsM4BYerBFYQaYxwzblaoojo88LSjVPw3h5Z0iLM8+IMVd36nwuc9dpE\n> +R8TecMZ1+U4Tl6BgqkK+9xToZRdPKdjS8L5MoFhGN+xY0vRbbJbGaV9Q0IHxLBkB\n> +rEBV7T1mUynneCHRUQlJQEwJmKpT8MH3IjsUXlG5YvnuuvcQJSNTaW2iDLxuOKp8\n> +cxW8+qL88zpb1D5dppoIu6rlrugN0azSq70ruFJQPc/A8GQrDKoGgRQiagxNY3u+\n> +vHZzXlECgYEA0dKO3gfkSxsDBb94sQwskMScqLhcKhztEa8kPxTx6Yqh+x8/scx3\n> +XhJyOt669P8U1v8a/2Al+s81oZzzfQSzO1Q7gEwSrgBcRMSIoRBUw9uYcy02ngb/\n> +j/ng3DGivfJztjjiSJwb46FHkJ2JR8mF2UisC6UMXk3NgFY/3vWQx78CgYEAxlcG\n> +T3hfSWSmTgKRczMJuHQOX9ULfTBIqwP5VqkkkiavzigGRirzb5lgnmuTSPTpF0LB\n> +XVPjR2M4q+7gzP0Dca3pocrvLEoxjwIKnCbYKnyyvnUoE9qHv4Kr+vDbgWpa2LXG\n> +JbLmE7tgTCIp20jOPPT4xuDvlbzQZBJ5qCQSoZkCgYEAgrotSSihlCnAOFSTXbu4\n> +CHp3IKe8xIBBNENq0eK61kcJpOxTQvOha3sSsJsU4JAM6+cFaxb8kseHIqonCj1j\n> +bhOM/uJmwQJ4el/4wGDsbxriYOBKpyq1D38gGhDS1IW6kk3erl6VAb36WJ/OaGum\n> +eTpN9vNeQWM4Jj2WjdNx4QECgYAwTdd6mU1TmZCrJRL5ZG+0nYc2rbMrnQvFoqUi\n> +BvWiJovggHzur90zy73tNzPaq9Ls2FQxf5G1vCN8NCRJqEEjeYCR59OSDMu/EXc2\n> +CnvQ9SevHOdS1oEDEjcCWZCMFzPi3XpRih1gptzQDe31uuiHjf3cqcGPzTlPdfRt\n> +D8P92QKBgC4UaBvIRwREVJsdZzpIzm224Bpe8LOmA7DeTnjlT0b3lkGiBJ36/Q0p\n> +VhYh/6cjX4/iuIs7gJbGon7B+YPB8scmOi3fj0+nkJAONue1mMfBNkba6qQTc6Y2\n> +5mEKw2/O7/JpND7ucU3OK9plcw/qnrWDgHxl0Iz95+OzUIIagxne\n> +-----END RSA PRIVATE KEY-----\n> +\"\"\"\n> +SSH_PUB_KEY = \"\"\"\\\n> +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCikC46WYtXotUd0UGPz9547Aj0KqC4gk+nt4BBJm86IHgCD9FygSGX9EFutXlhz9KZIPg9Okk7+IzXRHCWI2MNvhrcjyrezKREm71z08j9iwfxY3340fY2Mo+0khwpO7bzsgzkljHIHqcOg7MgttPInVMNH/EfqpgR8EDKJuWCB2Ny+EBFN/3dAiff0X/EvKle9PUrY70EkSycnyURS8HZReEqj8lN9J5kXzA8F6jBo/0Q42Ttv6e4k5YcaDrwmLrBWLra2PCXZLNyHqXEiFkGmdXtA1Eox9gc/p4jIXim6xrPNmpN6WyrrEjaCF5xYvNv8wXkD6uSWwbHYU24lIAn qemu-vm-key\n> +\"\"\"\n> +\n> +class BaseVM(object):\n> +    GUEST_USER = \"qemu\"\n> +    GUEST_PASS = \"qemupass\"\n> +    ROOT_PASS = \"qemupass\"\n> +\n> +    # The script to run in the guest that builds QEMU\n> +    BUILD_SCRIPT = \"\"\n> +    # The guest name, to be overridden by subclasses\n> +    name = \"#base\"\n> +    def __init__(self, debug=False, vcpus=None):\n> +        self._guest = None\n> +        self._tmpdir = tempfile.mkdtemp(prefix=\"qemu-vm-\")\n> +        atexit.register(shutil.rmtree, self._tmpdir)\n> +\n> +        self._ssh_key_file = os.path.join(self._tmpdir, \"id_rsa\")\n> +        open(self._ssh_key_file, \"w\").write(SSH_KEY)\n> +        subprocess.check_call([\"chmod\", \"600\", self._ssh_key_file])\n> +\n> +        self._ssh_pub_key_file = os.path.join(self._tmpdir, \"id_rsa.pub\")\n> +        open(self._ssh_pub_key_file, \"w\").write(SSH_PUB_KEY)\n> +\n> +        self.debug = debug\n> +        self._stderr = sys.stderr\n> +        self._devnull = open(\"/dev/null\", \"w\")\n> +        if self.debug:\n> +            self._stdout = sys.stdout\n> +        else:\n> +            self._stdout = self._devnull\n> +        self._args = [ \\\n> +            \"-nodefaults\", \"-m\", \"2G\",\n> +            \"-cpu\", \"host\",\n> +            \"-netdev\", \"user,id=vnet,hostfwd=:0.0.0.0:0-:22\",\n> +            \"-device\", \"virtio-net-pci,netdev=vnet\",\n> +            \"-vnc\", \":0,to=20\",\n> +            \"-serial\", \"file:%s\" % os.path.join(self._tmpdir, \"serial.out\")]\n> +        if vcpus:\n> +            self._args += [\"-smp\", str(vcpus)]\n> +        if os.access(\"/dev/kvm\", os.R_OK | os.W_OK):\n> +            self._args += [\"-enable-kvm\"]\n> +        else:\n> +            logging.info(\"KVM not available, not using -enable-kvm\")\n> +        self._data_args = []\n> +\n> +    def _download_with_cache(self, url, sha256sum=None):\n> +        def check_sha256sum(fname):\n> +            if not sha256sum:\n> +                return True\n> +            checksum = subprocess.check_output([\"sha256sum\", fname]).split()[0]\n> +            return sha256sum == checksum\n> +\n> +        cache_dir = os.path.expanduser(\"~/.cache/qemu-vm/download\")\n> +        if not os.path.exists(cache_dir):\n> +            os.makedirs(cache_dir)\n> +        fname = os.path.join(cache_dir, hashlib.sha1(url).hexdigest())\n> +        if os.path.exists(fname) and check_sha256sum(fname):\n> +            return fname\n> +        logging.debug(\"Downloading %s to %s...\", url, fname)\n> +        subprocess.check_call([\"wget\", \"-c\", url, \"-O\", fname + \".download\"],\n> +                              stdout=self._stdout, stderr=self._stderr)\n> +        os.rename(fname + \".download\", fname)\n> +        return fname\n> +\n> +    def _ssh_do(self, user, cmd, check, interactive=False):\n> +        ssh_cmd = [\"ssh\", \"-q\",\n> +                   \"-o\", \"StrictHostKeyChecking=no\",\n> +                   \"-o\", \"UserKnownHostsFile=/dev/null\",\n> +                   \"-o\", \"ConnectTimeout=1\",\n> +                   \"-p\", self.ssh_port, \"-i\", self._ssh_key_file]\n> +        if interactive:\n> +            ssh_cmd += ['-t']\n> +        assert not isinstance(cmd, str)\n> +        ssh_cmd += [\"%s@127.0.0.1\" % user] + list(cmd)\n> +        logging.debug(\"ssh_cmd: %s\", \" \".join(ssh_cmd))\n> +        r = subprocess.call(ssh_cmd,\n> +                            stdin=sys.stdin if interactive else self._devnull,\n> +                            stdout=sys.stdout if interactive else self._stdout,\n> +                            stderr=sys.stderr if interactive else self._stderr)\n> +        if check and r != 0:\n> +            raise Exception(\"SSH command failed: %s\" % cmd)\n> +        return r\n> +\n> +    def ssh(self, *cmd):\n> +        return self._ssh_do(self.GUEST_USER, cmd, False)\n> +\n> +    def ssh_interactive(self, *cmd):\n> +        return self._ssh_do(self.GUEST_USER, cmd, False, True)\n> +\n> +    def ssh_root(self, *cmd):\n> +        return self._ssh_do(\"root\", cmd, False)\n> +\n> +    def ssh_check(self, *cmd):\n> +        self._ssh_do(self.GUEST_USER, cmd, True)\n> +\n> +    def ssh_root_check(self, *cmd):\n> +        self._ssh_do(\"root\", cmd, True)\n> +\n> +    def build_image(self, img):\n> +        raise NotImplementedError\n> +\n> +    def add_source_dir(self, data_dir):\n> +        name = \"data-\" + hashlib.sha1(data_dir).hexdigest()[:5]\n> +        tarfile = os.path.join(self._tmpdir, name + \".tar\")\n> +        logging.debug(\"Creating archive %s for data dir: %s\", tarfile, data_dir)\n> +        if subprocess.call(\"type gtar\", stdout=self._devnull,\n> +                           stderr=self._devnull, shell=True) == 0:\n> +            tar_cmd = \"gtar\"\n> +        else:\n> +            tar_cmd = \"tar\"\n> +        subprocess.check_call([tar_cmd,\n> +                               \"--exclude-vcs\",\n> +                               \"--exclude=tests/vm/*.img\",\n> +                               \"--exclude=tests/vm/*.img.*\",\n> +                               \"--exclude=*.d\",\n> +                               \"--exclude=*.o\",\n> +                               \"--exclude=docker-src.*\",\n> +                               \"-cf\", tarfile, '.'], cwd=data_dir,\n\nI'm not happy with this command :/\nMy distrib uses tmpfs for /tmp and suddently the whole X window became \nirresponsive until this script failing after filling 8G of /tmp and swap:\n\n...\nDEBUG:root:Creating archive /tmp/qemu-vm-F7CY9O/data-3a52c.tar for data \ndir: .\ntar: /tmp/qemu-vm-F7CY9O/data-3a52c.tar: Wrote only 4096 of 10240 bytes\ntar: Error is not recoverable: exiting now\nFailed to prepare guest environment\n\nThen I figured out my workdir is full of testing stuff, debug images, \nfirmwares, coredumps, etc.\n\nI'll think of another way.\n\n> +                              stdin=self._devnull, stdout=self._stdout)\n> +        self._data_args += [\"-drive\",\n> +                            \"file=%s,if=none,id=%s,cache=writeback,format=raw\" % \\\n> +                                    (tarfile, name),\n> +                            \"-device\",\n> +                            \"virtio-blk,drive=%s,serial=%s,bootindex=1\" % (name, name)]\n> +\n> +    def boot(self, img, extra_args=[]):\n> +        args = self._args + [\n> +            \"-device\", \"VGA\",\n> +            \"-drive\", \"file=%s,if=none,id=drive0,cache=writeback\" % img,\n> +            \"-device\", \"virtio-blk,drive=drive0,bootindex=0\"]\n> +        args += self._data_args + extra_args\n> +        logging.debug(\"QEMU args: %s\", \" \".join(args))\n> +        guest = QEMUMachine(binary=os.environ.get(\"QEMU\", \"qemu-system-x86_64\"),\n> +                            args=args)\n> +        guest.launch()\n> +        atexit.register(self.shutdown)\n> +        self._guest = guest\n> +        usernet_info = guest.qmp(\"human-monitor-command\",\n> +                                 command_line=\"info usernet\")\n> +        self.ssh_port = None\n> +        for l in usernet_info[\"return\"].splitlines():\n> +            fields = l.split()\n> +            if \"TCP[HOST_FORWARD]\" in fields and \"22\" in fields:\n> +                self.ssh_port = l.split()[3]\n> +        if not self.ssh_port:\n> +            raise Exception(\"Cannot find ssh port from 'info usernet':\\n%s\" % \\\n> +                            usernet_info)\n> +\n> +    def wait_ssh(self, seconds=120):\n> +        starttime = datetime.datetime.now()\n> +        guest_up = False\n> +        while (datetime.datetime.now() - starttime).total_seconds() < seconds:\n> +            if self.ssh(\"exit 0\") == 0:\n> +                guest_up = True\n> +                break\n> +            time.sleep(1)\n> +        if not guest_up:\n> +            raise TimeoutError(\"Timeout while waiting for guest ssh\")\n> +\n> +    def shutdown(self):\n> +        self._guest.shutdown()\n> +\n> +    def wait(self):\n> +        self._guest.wait()\n> +\n> +    def qmp(self, *args, **kwargs):\n> +        return self._guest.qmp(*args, **kwargs)\n> +\n> +def parse_args(vm_name):\n> +    parser = optparse.OptionParser(description=\"\"\"\n> +    VM test utility.  Exit codes: 0 = success, 1 = command line error, 2 = environment initialization failed, 3 = test command failed\"\"\")\n> +    parser.add_option(\"--debug\", \"-D\", action=\"store_true\",\n> +                      help=\"enable debug output\")\n> +    parser.add_option(\"--image\", \"-i\", default=\"%s.img\" % vm_name,\n> +                      help=\"image file name\")\n> +    parser.add_option(\"--force\", \"-f\", action=\"store_true\",\n> +                      help=\"force build image even if image exists\")\n> +    parser.add_option(\"--jobs\", type=int, default=multiprocessing.cpu_count(),\n> +                      help=\"number of virtual CPUs\")\n> +    parser.add_option(\"--build-image\", \"-b\", action=\"store_true\",\n> +                      help=\"build image\")\n> +    parser.add_option(\"--build-qemu\",\n> +                      help=\"build QEMU from source in guest\")\n> +    parser.add_option(\"--interactive\", \"-I\", action=\"store_true\",\n> +                      help=\"Interactively run command\")\n> +    parser.disable_interspersed_args()\n> +    return parser.parse_args()\n> +\n> +def main(vmcls):\n> +    try:\n> +        args, argv = parse_args(vmcls.name)\n> +        if not argv and not args.build_qemu and not args.build_image:\n> +            print \"Nothing to do?\"\n> +            return 1\n> +        if args.debug:\n> +            logging.getLogger().setLevel(logging.DEBUG)\n> +        vm = vmcls(debug=args.debug, vcpus=args.jobs)\n> +        if args.build_image:\n> +            if os.path.exists(args.image) and not args.force:\n> +                sys.stderr.writelines([\"Image file exists: %s\\n\" % args.image,\n> +                                      \"Use --force option to overwrite\\n\"])\n> +                return 1\n> +            return vm.build_image(args.image)\n> +        if args.build_qemu:\n> +            vm.add_source_dir(args.build_qemu)\n> +            cmd = [vm.BUILD_SCRIPT.format(\n> +                   configure_opts = \" \".join(argv),\n> +                   jobs=args.jobs)]\n> +        else:\n> +            cmd = argv\n> +        vm.boot(args.image + \",snapshot=on\")\n> +        vm.wait_ssh()\n> +    except Exception as e:\n> +        if isinstance(e, SystemExit) and e.code == 0:\n> +            return 0\n> +        sys.stderr.write(\"Failed to prepare guest environment\\n\")\n> +        traceback.print_exc()\n> +        return 2\n> +\n> +    if args.interactive:\n> +        if vm.ssh_interactive(*cmd) == 0:\n> +            return 0\n> +        vm.ssh_interactive()\n> +        return 3\n> +    else:\n> +        if vm.ssh(*cmd) != 0:\n> +            return 3\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"IuoPhBN4\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhS7H59tDz9s4q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 22:07:23 +1000 (AEST)","from localhost ([::1]:44624 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmfIf-0007Ll-JS\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 08:07:21 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37981)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmfIJ-0007LT-Bk\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 08:07:03 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmfIG-0000hU-EE\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 08:06:59 -0400","from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:36087)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmfIG-0000gh-7w\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 08:06:56 -0400","by mail-qk0-x22f.google.com with SMTP id o63so13958139qkb.3\n\tfor <qemu-devel@nongnu.org>; Tue, 29 Aug 2017 05:06:54 -0700 (PDT)","from [192.168.1.10] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tt5sm1847780qkl.59.2017.08.29.05.06.49\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 29 Aug 2017 05:06:53 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=sp3CBsS+DjfDAcW/VnO8GcxVnAw/bzsvK8x6IhLgcc8=;\n\tb=IuoPhBN4hqVzrEBLc8klP223hR2azY12e0qCkG3hJ+SjxNQUrenyHJphMCFiRK8YCV\n\t+p43l9MC6y3dXHEvCcfAkDKeY9gFquHFdNow/Lt82b/4/FW4eZfkYzsBTagMeC8q1Pfb\n\t3h75wTtrgORkZQxfCDSnzPtdY7Sqywt35vMIfEENSAYobneMGIiNoTPb2IaRir4mPXYF\n\tIIRX/zl/PFvCCKiBFXqwuAb5ujhWlsjlQ5LSCSLc5/PfYGurxffOwv5P1dKWuXNwTWXl\n\te7qaDcqhDbMqHiuKynfysbD4yfGF/t/kF5B2UQYlHLRpig+xHgd83AJczBoAIoAHsG8I\n\tLOdg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=sp3CBsS+DjfDAcW/VnO8GcxVnAw/bzsvK8x6IhLgcc8=;\n\tb=URRQwS/JgAers9aBUH27pTUdBYZPzQtyK5rIkT2L+r5YZLzABVufVUZm0IBvm3qF+a\n\tWaCPFPEyW3pJyIWLijDfuTdWQVt/z5toYGPt1ar74NN8VN4Ej2rrVzJX4/fQibRT9FON\n\tEXzCOaAeSZecTFpd7+LzNk+kGlYl1jf+6mp85FgjI2RzpJLVSJa1E9Gge9g28XBwGpyb\n\t77jzQEawDZTBDso31cFC41lvjGefbc8edGRuHx0afHLSUL7hcYhT4qsRpwB6ehlDwtLY\n\tqPNhmdWeRZJ42Qo4g0ZZg8/6goqN118vUvYjQtfN6auhRkxNMbJaOvl4as4zxfngJbpj\n\tExoA==","X-Gm-Message-State":"AHYfb5hvEbTHXwdPPUSkw8qBb6Ftfdvx7DqJlah9Oqeia7tHsDiGVh+i\n\txkfbUB2GJ21f3w==","X-Received":"by 10.55.74.194 with SMTP id x185mr5118235qka.237.1504008414163; \n\tTue, 29 Aug 2017 05:06:54 -0700 (PDT)","To":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Message-ID":"<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>","Date":"Tue, 29 Aug 2017 09:06:48 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170828174707.20786-4-famz@redhat.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c09::22f","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, Kamil Rytarowski\n\t<kamil@netbsd.org>, stefanha@redhat.com, Cleber Rosa <crosa@redhat.com>,\n\tpbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759268,"web_url":"http://patchwork.ozlabs.org/comment/1759268/","msgid":"<20170829121100.GA25801@redhat.com>","list_archive_url":null,"date":"2017-08-29T12:11:00","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Tue, Aug 29, 2017 at 09:06:48AM -0300, Philippe Mathieu-Daudé wrote:\n> Hi Fam,\n> \n> On 08/28/2017 02:47 PM, Fam Zheng wrote:\n> > This is the common code to implement a \"VM test\" to\n> > \n> >    1) Download and initialize a pre-defined VM that has necessary\n> >    dependencies to build QEMU and SSH access.\n> > \n> >    2) Archive $SRC_PATH to a .tar file.\n> > \n> >    3) Boot the VM, and pass the source tar file to the guest.\n> > \n> >    4) SSH into the VM, untar the source tarball, build from the source.\n> > \n> > Signed-off-by: Fam Zheng <famz@redhat.com>\n> > ---\n> >   tests/vm/basevm.py | 287 +++++++++++++++++++++++++++++++++++++++++++++++++++++\n> >   1 file changed, 287 insertions(+)\n> >   create mode 100755 tests/vm/basevm.py\n> > \n> > diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py\n> > new file mode 100755\n> > index 0000000000..d0095c5332\n> > --- /dev/null\n> > +++ b/tests/vm/basevm.py\n\n> > +    def add_source_dir(self, data_dir):\n> > +        name = \"data-\" + hashlib.sha1(data_dir).hexdigest()[:5]\n> > +        tarfile = os.path.join(self._tmpdir, name + \".tar\")\n> > +        logging.debug(\"Creating archive %s for data dir: %s\", tarfile, data_dir)\n> > +        if subprocess.call(\"type gtar\", stdout=self._devnull,\n> > +                           stderr=self._devnull, shell=True) == 0:\n> > +            tar_cmd = \"gtar\"\n> > +        else:\n> > +            tar_cmd = \"tar\"\n> > +        subprocess.check_call([tar_cmd,\n> > +                               \"--exclude-vcs\",\n> > +                               \"--exclude=tests/vm/*.img\",\n> > +                               \"--exclude=tests/vm/*.img.*\",\n> > +                               \"--exclude=*.d\",\n> > +                               \"--exclude=*.o\",\n> > +                               \"--exclude=docker-src.*\",\n> > +                               \"-cf\", tarfile, '.'], cwd=data_dir,\n> \n> I'm not happy with this command :/\n> My distrib uses tmpfs for /tmp and suddently the whole X window became\n> irresponsive until this script failing after filling 8G of /tmp and swap:\n> \n> ...\n> DEBUG:root:Creating archive /tmp/qemu-vm-F7CY9O/data-3a52c.tar for data dir:\n> .\n> tar: /tmp/qemu-vm-F7CY9O/data-3a52c.tar: Wrote only 4096 of 10240 bytes\n> tar: Error is not recoverable: exiting now\n> Failed to prepare guest environment\n> \n> Then I figured out my workdir is full of testing stuff, debug images,\n> firmwares, coredumps, etc.\n> \n> I'll think of another way.\n\nYeah, /tmp should never be used for anything which has significant\nsize. Could go for /var/tmp instead, but IMHO just use the QEMU build\ndir, as is done for (almost) all other build & test artifacts and\nthus avoid any global dirs.\n\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhSDH2xccz9sR9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 22:11:43 +1000 (AEST)","from localhost ([::1]:44642 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmfMr-0001CJ-A7\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 08:11:41 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38996)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dmfMW-0001Bi-If\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 08:11:21 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dmfMT-0003SC-TZ\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 08:11:20 -0400","from mx1.redhat.com ([209.132.183.28]:46084)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dmfMT-0003R0-Jb\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 08:11:17 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 783F1800AF;\n\tTue, 29 Aug 2017 12:11:16 +0000 (UTC)","from redhat.com (unknown [10.33.36.95])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 950016FEE7;\n\tTue, 29 Aug 2017 12:11:03 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 783F1800AF","Date":"Tue, 29 Aug 2017 13:11:00 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Message-ID":"<20170829121100.GA25801@redhat.com>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tTue, 29 Aug 2017 12:11:16 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"Peter Maydell <peter.maydell@linaro.org>, Fam Zheng <famz@redhat.com>,\n\tqemu-devel@nongnu.org, Kamil Rytarowski <kamil@netbsd.org>, \n\tstefanha@redhat.com, Cleber Rosa <crosa@redhat.com>,\n\tpbonzini@redhat.com, Alex =?utf-8?q?Benn=C3=A9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759272,"web_url":"http://patchwork.ozlabs.org/comment/1759272/","msgid":"<9658452f-c89f-43d2-07ff-5d620fd471a9@amsat.org>","list_archive_url":null,"date":"2017-08-29T12:15:47","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"On 08/28/2017 02:47 PM, Fam Zheng wrote:\n> This is the common code to implement a \"VM test\" to\n> \n>    1) Download and initialize a pre-defined VM that has necessary\n>    dependencies to build QEMU and SSH access.\n> \n>    2) Archive $SRC_PATH to a .tar file.\n> \n>    3) Boot the VM, and pass the source tar file to the guest.\n> \n>    4) SSH into the VM, untar the source tarball, build from the source.\n> \n> Signed-off-by: Fam Zheng <famz@redhat.com>\n> ---\n>   tests/vm/basevm.py | 287 +++++++++++++++++++++++++++++++++++++++++++++++++++++\n>   1 file changed, 287 insertions(+)\n>   create mode 100755 tests/vm/basevm.py\n> \n> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py\n> new file mode 100755\n> index 0000000000..d0095c5332\n> --- /dev/null\n> +++ b/tests/vm/basevm.py\n> @@ -0,0 +1,287 @@\n> +#!/usr/bin/env python\n> +#\n> +# VM testing base class\n> +#\n> +# Copyright (C) 2017 Red Hat Inc.\n> +#\n> +# Authors:\n> +#  Fam Zheng <famz@redhat.com>\n> +#\n> +# This work is licensed under the terms of the GNU GPL, version 2.  See\n> +# the COPYING file in the top-level directory.\n> +#\n> +\n> +import os\n> +import sys\n> +import logging\n> +import time\n> +import datetime\n> +sys.path.append(os.path.join(os.path.dirname(__file__), \"..\", \"..\", \"scripts\"))\n> +from qemu import QEMUMachine\n> +import subprocess\n> +import hashlib\n> +import optparse\n> +import atexit\n> +import tempfile\n> +import shutil\n> +import multiprocessing\n> +import traceback\n> +\n> +SSH_KEY = \"\"\"\\\n> +-----BEGIN RSA PRIVATE KEY-----\n> +MIIEowIBAAKCAQEAopAuOlmLV6LVHdFBj8/eeOwI9CqguIJPp7eAQSZvOiB4Ag/R\n> +coEhl/RBbrV5Yc/SmSD4PTpJO/iM10RwliNjDb4a3I8q3sykRJu9c9PI/YsH8WN9\n> ++NH2NjKPtJIcKTu287IM5JYxyB6nDoOzILbTyJ1TDR/xH6qYEfBAyiblggdjcvhA\n> +RTf93QIn39F/xLypXvT1K2O9BJEsnJ8lEUvB2UXhKo/JTfSeZF8wPBeowaP9EONk\n> +7b+nuJOWHGg68Ji6wVi62tjwl2Szch6lxIhZBpnV7QNRKMfYHP6eIyF4pusazzZq\n> +Telsq6xI2ghecWLzb/MF5A+rklsGx2FNuJSAJwIDAQABAoIBAHHi4o/8VZNivz0x\n> +cWXn8erzKV6tUoWQvW85Lj/2RiwJvSlsnYZDkx5af1CpEE2HA/pFT8PNRqsd+MWC\n> +7AEy710cVsM4BYerBFYQaYxwzblaoojo88LSjVPw3h5Z0iLM8+IMVd36nwuc9dpE\n> +R8TecMZ1+U4Tl6BgqkK+9xToZRdPKdjS8L5MoFhGN+xY0vRbbJbGaV9Q0IHxLBkB\n> +rEBV7T1mUynneCHRUQlJQEwJmKpT8MH3IjsUXlG5YvnuuvcQJSNTaW2iDLxuOKp8\n> +cxW8+qL88zpb1D5dppoIu6rlrugN0azSq70ruFJQPc/A8GQrDKoGgRQiagxNY3u+\n> +vHZzXlECgYEA0dKO3gfkSxsDBb94sQwskMScqLhcKhztEa8kPxTx6Yqh+x8/scx3\n> +XhJyOt669P8U1v8a/2Al+s81oZzzfQSzO1Q7gEwSrgBcRMSIoRBUw9uYcy02ngb/\n> +j/ng3DGivfJztjjiSJwb46FHkJ2JR8mF2UisC6UMXk3NgFY/3vWQx78CgYEAxlcG\n> +T3hfSWSmTgKRczMJuHQOX9ULfTBIqwP5VqkkkiavzigGRirzb5lgnmuTSPTpF0LB\n> +XVPjR2M4q+7gzP0Dca3pocrvLEoxjwIKnCbYKnyyvnUoE9qHv4Kr+vDbgWpa2LXG\n> +JbLmE7tgTCIp20jOPPT4xuDvlbzQZBJ5qCQSoZkCgYEAgrotSSihlCnAOFSTXbu4\n> +CHp3IKe8xIBBNENq0eK61kcJpOxTQvOha3sSsJsU4JAM6+cFaxb8kseHIqonCj1j\n> +bhOM/uJmwQJ4el/4wGDsbxriYOBKpyq1D38gGhDS1IW6kk3erl6VAb36WJ/OaGum\n> +eTpN9vNeQWM4Jj2WjdNx4QECgYAwTdd6mU1TmZCrJRL5ZG+0nYc2rbMrnQvFoqUi\n> +BvWiJovggHzur90zy73tNzPaq9Ls2FQxf5G1vCN8NCRJqEEjeYCR59OSDMu/EXc2\n> +CnvQ9SevHOdS1oEDEjcCWZCMFzPi3XpRih1gptzQDe31uuiHjf3cqcGPzTlPdfRt\n> +D8P92QKBgC4UaBvIRwREVJsdZzpIzm224Bpe8LOmA7DeTnjlT0b3lkGiBJ36/Q0p\n> +VhYh/6cjX4/iuIs7gJbGon7B+YPB8scmOi3fj0+nkJAONue1mMfBNkba6qQTc6Y2\n> +5mEKw2/O7/JpND7ucU3OK9plcw/qnrWDgHxl0Iz95+OzUIIagxne\n> +-----END RSA PRIVATE KEY-----\n> +\"\"\"\n> +SSH_PUB_KEY = \"\"\"\\\n> +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCikC46WYtXotUd0UGPz9547Aj0KqC4gk+nt4BBJm86IHgCD9FygSGX9EFutXlhz9KZIPg9Okk7+IzXRHCWI2MNvhrcjyrezKREm71z08j9iwfxY3340fY2Mo+0khwpO7bzsgzkljHIHqcOg7MgttPInVMNH/EfqpgR8EDKJuWCB2Ny+EBFN/3dAiff0X/EvKle9PUrY70EkSycnyURS8HZReEqj8lN9J5kXzA8F6jBo/0Q42Ttv6e4k5YcaDrwmLrBWLra2PCXZLNyHqXEiFkGmdXtA1Eox9gc/p4jIXim6xrPNmpN6WyrrEjaCF5xYvNv8wXkD6uSWwbHYU24lIAn qemu-vm-key\n> +\"\"\"\n> +\n> +class BaseVM(object):\n> +    GUEST_USER = \"qemu\"\n> +    GUEST_PASS = \"qemupass\"\n> +    ROOT_PASS = \"qemupass\"\n> +\n> +    # The script to run in the guest that builds QEMU\n> +    BUILD_SCRIPT = \"\"\n> +    # The guest name, to be overridden by subclasses\n> +    name = \"#base\"\n> +    def __init__(self, debug=False, vcpus=None):\n> +        self._guest = None\n> +        self._tmpdir = tempfile.mkdtemp(prefix=\"qemu-vm-\")\n> +        atexit.register(shutil.rmtree, self._tmpdir)\n> +\n> +        self._ssh_key_file = os.path.join(self._tmpdir, \"id_rsa\")\n> +        open(self._ssh_key_file, \"w\").write(SSH_KEY)\n> +        subprocess.check_call([\"chmod\", \"600\", self._ssh_key_file])\n> +\n> +        self._ssh_pub_key_file = os.path.join(self._tmpdir, \"id_rsa.pub\")\n> +        open(self._ssh_pub_key_file, \"w\").write(SSH_PUB_KEY)\n> +\n> +        self.debug = debug\n> +        self._stderr = sys.stderr\n> +        self._devnull = open(\"/dev/null\", \"w\")\n> +        if self.debug:\n> +            self._stdout = sys.stdout\n> +        else:\n> +            self._stdout = self._devnull\n> +        self._args = [ \\\n> +            \"-nodefaults\", \"-m\", \"2G\",\n> +            \"-cpu\", \"host\",\n> +            \"-netdev\", \"user,id=vnet,hostfwd=:0.0.0.0:0-:22\",\n\nTesting with debian/unstable:\n\n$ make vm-build-netbsd V=1\n./tests/vm/netbsd  --debug   --image \"tests/vm/netbsd.img\" --build-qemu .\nDEBUG:root:Creating archive /tmp/qemu-vm-PxfXNv/data-3a52c.tar for data \ndir: .\nDEBUG:root:QEMU args: -nodefaults -m 2G -cpu host -netdev \nuser,id=vnet,hostfwd=:0.0.0.0:0-:22 -device virtio-net-pci,netdev=vnet \n-vnc :0,to=20 -serial file:/tmp/qemu-vm-PxfXNv/serial.out -smp 4 \n-enable-kvm -device VGA -drive \nfile=tests/vm/netbsd.img,snapshot=on,if=none,id=drive0,cache=writeback \n-device virtio-blk,drive=drive0,bootindex=0 -drive \nfile=/tmp/qemu-vm-PxfXNv/data-3a52c.tar,if=none,id=data-3a52c,cache=writeback,format=raw \n-device virtio-blk,drive=data-3a52c,serial=data-3a52c,bootindex=1\nFailed to prepare guest environment\nTraceback (most recent call last):\n   File \"/source/qemu/tests/vm/basevm.py\", line 274, in main\n     vm.boot(args.image + \",snapshot=on\")\n   File \"/source/qemu/tests/vm/basevm.py\", line 198, in boot\n     guest.launch()\n   File \"/source/qemu/tests/vm/../../scripts/qemu.py\", line 137, in launch\n     self._post_launch()\n   File \"/source/qemu/tests/vm/../../scripts/qemu.py\", line 121, in \n_post_launch\n     self._qmp.accept()\n   File \"/source/qemu/tests/vm/../../scripts/qmp/qmp.py\", line 147, in \naccept\n     return self.__negotiate_capabilities()\n   File \"/source/qemu/tests/vm/../../scripts/qmp/qmp.py\", line 60, in \n__negotiate_capabilities\n     raise QMPConnectError\nQMPConnectError\ntests/vm/Makefile.include:32: recipe for target 'vm-build-netbsd' failed\nmake: *** [vm-build-netbsd] Error 2\n\nHaving:\n\n$ qemu-system-x86_64 -version\nQEMU emulator version 2.8.1(Debian 1:2.8+dfsg-7)\n\nHopefully I could get it working with a /master build:\n\n$ QEMU=/source/qemu/build/x86_64-softmmu/qemu-system-x86_64 make \nvm-build-netbsd\n...\n\n> +            \"-device\", \"virtio-net-pci,netdev=vnet\",\n> +            \"-vnc\", \":0,to=20\",\n> +            \"-serial\", \"file:%s\" % os.path.join(self._tmpdir, \"serial.out\")]\n> +        if vcpus:\n> +            self._args += [\"-smp\", str(vcpus)]\n> +        if os.access(\"/dev/kvm\", os.R_OK | os.W_OK):\n> +            self._args += [\"-enable-kvm\"]\n> +        else:\n> +            logging.info(\"KVM not available, not using -enable-kvm\")\n> +        self._data_args = []\n> +\n> +    def _download_with_cache(self, url, sha256sum=None):\n> +        def check_sha256sum(fname):\n> +            if not sha256sum:\n> +                return True\n> +            checksum = subprocess.check_output([\"sha256sum\", fname]).split()[0]\n> +            return sha256sum == checksum\n> +\n> +        cache_dir = os.path.expanduser(\"~/.cache/qemu-vm/download\")\n> +        if not os.path.exists(cache_dir):\n> +            os.makedirs(cache_dir)\n> +        fname = os.path.join(cache_dir, hashlib.sha1(url).hexdigest())\n> +        if os.path.exists(fname) and check_sha256sum(fname):\n> +            return fname\n> +        logging.debug(\"Downloading %s to %s...\", url, fname)\n> +        subprocess.check_call([\"wget\", \"-c\", url, \"-O\", fname + \".download\"],\n> +                              stdout=self._stdout, stderr=self._stderr)\n> +        os.rename(fname + \".download\", fname)\n> +        return fname\n> +\n> +    def _ssh_do(self, user, cmd, check, interactive=False):\n> +        ssh_cmd = [\"ssh\", \"-q\",\n> +                   \"-o\", \"StrictHostKeyChecking=no\",\n> +                   \"-o\", \"UserKnownHostsFile=/dev/null\",\n> +                   \"-o\", \"ConnectTimeout=1\",\n> +                   \"-p\", self.ssh_port, \"-i\", self._ssh_key_file]\n> +        if interactive:\n> +            ssh_cmd += ['-t']\n> +        assert not isinstance(cmd, str)\n> +        ssh_cmd += [\"%s@127.0.0.1\" % user] + list(cmd)\n> +        logging.debug(\"ssh_cmd: %s\", \" \".join(ssh_cmd))\n> +        r = subprocess.call(ssh_cmd,\n> +                            stdin=sys.stdin if interactive else self._devnull,\n> +                            stdout=sys.stdout if interactive else self._stdout,\n> +                            stderr=sys.stderr if interactive else self._stderr)\n> +        if check and r != 0:\n> +            raise Exception(\"SSH command failed: %s\" % cmd)\n> +        return r\n> +\n> +    def ssh(self, *cmd):\n> +        return self._ssh_do(self.GUEST_USER, cmd, False)\n> +\n> +    def ssh_interactive(self, *cmd):\n> +        return self._ssh_do(self.GUEST_USER, cmd, False, True)\n> +\n> +    def ssh_root(self, *cmd):\n> +        return self._ssh_do(\"root\", cmd, False)\n> +\n> +    def ssh_check(self, *cmd):\n> +        self._ssh_do(self.GUEST_USER, cmd, True)\n> +\n> +    def ssh_root_check(self, *cmd):\n> +        self._ssh_do(\"root\", cmd, True)\n> +\n> +    def build_image(self, img):\n> +        raise NotImplementedError\n> +\n> +    def add_source_dir(self, data_dir):\n> +        name = \"data-\" + hashlib.sha1(data_dir).hexdigest()[:5]\n> +        tarfile = os.path.join(self._tmpdir, name + \".tar\")\n> +        logging.debug(\"Creating archive %s for data dir: %s\", tarfile, data_dir)\n> +        if subprocess.call(\"type gtar\", stdout=self._devnull,\n> +                           stderr=self._devnull, shell=True) == 0:\n> +            tar_cmd = \"gtar\"\n> +        else:\n> +            tar_cmd = \"tar\"\n> +        subprocess.check_call([tar_cmd,\n> +                               \"--exclude-vcs\",\n> +                               \"--exclude=tests/vm/*.img\",\n> +                               \"--exclude=tests/vm/*.img.*\",\n> +                               \"--exclude=*.d\",\n> +                               \"--exclude=*.o\",\n> +                               \"--exclude=docker-src.*\",\n> +                               \"-cf\", tarfile, '.'], cwd=data_dir,\n> +                              stdin=self._devnull, stdout=self._stdout)\n> +        self._data_args += [\"-drive\",\n> +                            \"file=%s,if=none,id=%s,cache=writeback,format=raw\" % \\\n> +                                    (tarfile, name),\n> +                            \"-device\",\n> +                            \"virtio-blk,drive=%s,serial=%s,bootindex=1\" % (name, name)]\n> +\n> +    def boot(self, img, extra_args=[]):\n> +        args = self._args + [\n> +            \"-device\", \"VGA\",\n> +            \"-drive\", \"file=%s,if=none,id=drive0,cache=writeback\" % img,\n> +            \"-device\", \"virtio-blk,drive=drive0,bootindex=0\"]\n> +        args += self._data_args + extra_args\n> +        logging.debug(\"QEMU args: %s\", \" \".join(args))\n> +        guest = QEMUMachine(binary=os.environ.get(\"QEMU\", \"qemu-system-x86_64\"),\n> +                            args=args)\n> +        guest.launch()\n> +        atexit.register(self.shutdown)\n> +        self._guest = guest\n> +        usernet_info = guest.qmp(\"human-monitor-command\",\n> +                                 command_line=\"info usernet\")\n> +        self.ssh_port = None\n> +        for l in usernet_info[\"return\"].splitlines():\n> +            fields = l.split()\n> +            if \"TCP[HOST_FORWARD]\" in fields and \"22\" in fields:\n> +                self.ssh_port = l.split()[3]\n> +        if not self.ssh_port:\n> +            raise Exception(\"Cannot find ssh port from 'info usernet':\\n%s\" % \\\n> +                            usernet_info)\n> +\n> +    def wait_ssh(self, seconds=120):\n> +        starttime = datetime.datetime.now()\n> +        guest_up = False\n> +        while (datetime.datetime.now() - starttime).total_seconds() < seconds:\n> +            if self.ssh(\"exit 0\") == 0:\n> +                guest_up = True\n> +                break\n> +            time.sleep(1)\n> +        if not guest_up:\n> +            raise TimeoutError(\"Timeout while waiting for guest ssh\")\n> +\n> +    def shutdown(self):\n> +        self._guest.shutdown()\n> +\n> +    def wait(self):\n> +        self._guest.wait()\n> +\n> +    def qmp(self, *args, **kwargs):\n> +        return self._guest.qmp(*args, **kwargs)\n> +\n> +def parse_args(vm_name):\n> +    parser = optparse.OptionParser(description=\"\"\"\n> +    VM test utility.  Exit codes: 0 = success, 1 = command line error, 2 = environment initialization failed, 3 = test command failed\"\"\")\n> +    parser.add_option(\"--debug\", \"-D\", action=\"store_true\",\n> +                      help=\"enable debug output\")\n> +    parser.add_option(\"--image\", \"-i\", default=\"%s.img\" % vm_name,\n> +                      help=\"image file name\")\n> +    parser.add_option(\"--force\", \"-f\", action=\"store_true\",\n> +                      help=\"force build image even if image exists\")\n> +    parser.add_option(\"--jobs\", type=int, default=multiprocessing.cpu_count(),\n> +                      help=\"number of virtual CPUs\")\n> +    parser.add_option(\"--build-image\", \"-b\", action=\"store_true\",\n> +                      help=\"build image\")\n> +    parser.add_option(\"--build-qemu\",\n> +                      help=\"build QEMU from source in guest\")\n> +    parser.add_option(\"--interactive\", \"-I\", action=\"store_true\",\n> +                      help=\"Interactively run command\")\n> +    parser.disable_interspersed_args()\n> +    return parser.parse_args()\n> +\n> +def main(vmcls):\n> +    try:\n> +        args, argv = parse_args(vmcls.name)\n> +        if not argv and not args.build_qemu and not args.build_image:\n> +            print \"Nothing to do?\"\n> +            return 1\n> +        if args.debug:\n> +            logging.getLogger().setLevel(logging.DEBUG)\n> +        vm = vmcls(debug=args.debug, vcpus=args.jobs)\n> +        if args.build_image:\n> +            if os.path.exists(args.image) and not args.force:\n> +                sys.stderr.writelines([\"Image file exists: %s\\n\" % args.image,\n> +                                      \"Use --force option to overwrite\\n\"])\n> +                return 1\n> +            return vm.build_image(args.image)\n> +        if args.build_qemu:\n> +            vm.add_source_dir(args.build_qemu)\n> +            cmd = [vm.BUILD_SCRIPT.format(\n> +                   configure_opts = \" \".join(argv),\n> +                   jobs=args.jobs)]\n> +        else:\n> +            cmd = argv\n> +        vm.boot(args.image + \",snapshot=on\")\n> +        vm.wait_ssh()\n> +    except Exception as e:\n> +        if isinstance(e, SystemExit) and e.code == 0:\n> +            return 0\n> +        sys.stderr.write(\"Failed to prepare guest environment\\n\")\n> +        traceback.print_exc()\n> +        return 2\n> +\n> +    if args.interactive:\n> +        if vm.ssh_interactive(*cmd) == 0:\n> +            return 0\n> +        vm.ssh_interactive()\n> +        return 3\n> +    else:\n> +        if vm.ssh(*cmd) != 0:\n> +            return 3\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"e0nBDkda\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhSKp2BCNz9sR9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 22:16:28 +1000 (AEST)","from localhost ([::1]:44655 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmfRR-0002Kb-Aa\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 08:16:25 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39695)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmfR0-0002KD-FQ\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 08:16:00 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmfQv-00069p-Ch\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 08:15:58 -0400","from mail-qt0-x22a.google.com ([2607:f8b0:400d:c0d::22a]:36897)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmfQv-00069E-5F\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 08:15:53 -0400","by mail-qt0-x22a.google.com with SMTP id t22so13714238qtg.4\n\tfor <qemu-devel@nongnu.org>; Tue, 29 Aug 2017 05:15:52 -0700 (PDT)","from [192.168.1.10] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tr130sm1861349qke.9.2017.08.29.05.15.48\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 29 Aug 2017 05:15:51 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=yBMyp237lbom6FkrRtjSQkADos1dvVswFR2icTjQR4s=;\n\tb=e0nBDkdaBjz93b/c6ElohDFsEJBsKSGn0UBWhRbb1WGNA1Q+HqmdboVuAaJTMOQVcs\n\t+l34uaybZAOtz2t/38niblu9stqCEZDiuoHj0y1JFVJpX1uBrNU1C5nAFtIAJvLCUph1\n\tzNq8iiOuMU6EWyFpG+HcnV7zRuG1xD0oD30yUZQJXcrNA3yyW9CA30WpY32E2UX6/0Nz\n\tiOUQbeg0bUnm61VMbbb9KrTlHodvOsxeBUzqZkkwurrnzh7+4m5dlicNrZzOxP8HWP+J\n\tzjZSuCrnx6bA6oXTXiuf2Vye+Z4iVSj/2wPOfobI0Aj0+jaLmoGIbs8dpHcw1eww89cL\n\tmdyA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=yBMyp237lbom6FkrRtjSQkADos1dvVswFR2icTjQR4s=;\n\tb=Udtk3nJgJfgZQJUDcv7llPJN5ue0P5X+xzNS9brS2YuwoancVRHLa1m+3v4js8L7ve\n\tzF9eHkadW4tTRB8jjcz0Im04L0UdFOZuoqdmddYt7GLM+I3p9HP1C6J7tPC7OfDwvtEv\n\txjyG8bZh94WlXopab50DdybJuwE5QeiQfEduNsUrzA8RQf1Cgb6hlIPbnM3cPiKNHXvd\n\tKDPhfLUQO6+vmPvOF4d75O6H9kQerMsHkADOI7KhXomzvkrSduSkYxKLcG84tVGLPtL0\n\t+ZYfbkASL27wFa0qnkoincjMzP4yg7rUrFn41TNxCI0vhJJBzznLh/O4t85wGTXH3F4O\n\te9Dg==","X-Gm-Message-State":"AHYfb5hyRTxLTLkGmVOwQ9bIGTJs3mSIuAeS8m0Z1JMK9tsSEmtDWNOt\n\to+udwQtUhejLmQ==","X-Received":"by 10.237.53.42 with SMTP id a39mr5474721qte.168.1504008951946; \n\tTue, 29 Aug 2017 05:15:51 -0700 (PDT)","To":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Message-ID":"<9658452f-c89f-43d2-07ff-5d620fd471a9@amsat.org>","Date":"Tue, 29 Aug 2017 09:15:47 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170828174707.20786-4-famz@redhat.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c0d::22a","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, Kamil Rytarowski\n\t<kamil@netbsd.org>, stefanha@redhat.com, Cleber Rosa <crosa@redhat.com>,\n\tpbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759316,"web_url":"http://patchwork.ozlabs.org/comment/1759316/","msgid":"<edd3bb01-dcb5-4741-3fe4-a20a5f64af88@amsat.org>","list_archive_url":null,"date":"2017-08-29T13:10:48","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"Hi Fam, Kamil,\n\n> On 08/28/2017 02:47 PM, Fam Zheng wrote:\n[...]\n>> +        subprocess.check_call([tar_cmd,\n>> +                               \"--exclude-vcs\",\n>> +                               \"--exclude=tests/vm/*.img\",\n>> +                               \"--exclude=tests/vm/*.img.*\",\n>> +                               \"--exclude=*.d\",\n>> +                               \"--exclude=*.o\",\n>> +                               \"--exclude=docker-src.*\",\n>> +                               \"-cf\", tarfile, '.'], cwd=data_dir,\n> \n> I'm not happy with this command :/\n> My distrib uses tmpfs for /tmp and suddently the whole X window became \n> irresponsive until this script failing after filling 8G of /tmp and swap:\n> \n> ...\n> DEBUG:root:Creating archive /tmp/qemu-vm-F7CY9O/data-3a52c.tar for data \n> dir: .\n> tar: /tmp/qemu-vm-F7CY9O/data-3a52c.tar: Wrote only 4096 of 10240 bytes\n> tar: Error is not recoverable: exiting now\n> Failed to prepare guest environment\n> \n> Then I figured out my workdir is full of testing stuff, debug images, \n> firmwares, coredumps, etc.\n> \n> I'll think of another way.\n\nUsing:\n\n(git ls-files; git submodule foreach --recursive \"git ls-files | sed \ns_^_\\$sm_path/_\" | sed /^Entering/d) > files.txt\n\nand:\n\n         subprocess.check_call([tar_cmd,\n                                \"-cf\", tarfile,\n                                \"-v\" if self.debug else \"\",\n                                \"-T\", \"files.txt\"], cwd=data_dir,\n                               stdin=self._devnull, stdout=self._stdout)\n\nCurrent /master and submodules generated tarball is ~305MB uncompressed.\n\nKamil do you mind testing this command on NetBSD?\n\n(obviously 'files.txt' goes in tmpdir).\n\nRegards,\n\nPhil.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"fZsDSICz\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhTYJ2wTsz9s3T\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 23:11:32 +1000 (AEST)","from localhost ([::1]:44864 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmgIk-000567-0f\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 09:11:30 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:53427)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmgIE-00054Q-DD\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 09:10:59 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmgIA-00081J-BT\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 09:10:58 -0400","from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:35791)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmgIA-00081C-7d\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 09:10:54 -0400","by mail-qt0-x235.google.com with SMTP id x36so14411092qtx.2\n\tfor <qemu-devel@nongnu.org>; Tue, 29 Aug 2017 06:10:54 -0700 (PDT)","from [192.168.1.10] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\t69sm1077444qte.95.2017.08.29.06.10.49\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 29 Aug 2017 06:10:53 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:from:to:cc:references:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=jz2Pe5DtLli0h/2iI54wHbqOhzBSqbdQSRSFvn0S4P4=;\n\tb=fZsDSICzKnsVHy9Xuz2ZpoN+Oue0Ecd/fUUsXE0/dhQjg1zuxvcYQpMIphRYFIWC0L\n\t0iyZfsNvmUAO7+w2ByjBrf2qxoiApDbsaRJkZAHlvXS77LgmE/So+W/o1WXCPHy6C2IN\n\t/uwPvohPah53zLnm5PsesdNC06ceX9AEXMyg4wVLnckblo4kzCWEhf9oNgguxxAxKyFN\n\t4VAiVQNHdwAFhVbr/xLZ8A5af4H56SRATEF1/CK3R61j/dwdrsi9QCDjNl1GPNnSEjNp\n\trd0PkSnXSpVIqsJ3g/rusFIZjvw2K8MgDXQyWirpU2TnGE2iVf74Rekcaty+p60xhzTb\n\t9Jrw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:from:to:cc:references:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=jz2Pe5DtLli0h/2iI54wHbqOhzBSqbdQSRSFvn0S4P4=;\n\tb=RG81Kch8YprSb3p/GnxKjoiGFTn/W9MOpzZt2mO1/3x8T+TkCewDrN5Z59GhV3q+sm\n\tcF2i0bUY/DnJM0Uko2EvLNKfQYf/tS77hSOtWdU4WfkNUm+VOMzuUw4umrR5xlHEMzPP\n\tLqPQ6j0Udx5DDgvHta8JRgUow1i3+kuhw8mvcFuD4ZRWjvIWCw969jYtfaVVIgLTWo51\n\taMxELudPTHvvVZ0UuOy541ixqXahndld5ifML02ARx9DDQHGDP4GAmXjTrV4NbZdOw3m\n\tYrKmLthcnbMkok9OnqWBWFULUU24MhA5JhtSp2Wyb2vuTgTBUQ2Yf5xUz2APw5bTd5y1\n\tb+5w==","X-Gm-Message-State":"AHYfb5ijuoOyrUhSagQjfvmithTFG/AaigMxRZsrlu+7wszWIR8lbJYg\n\tTEEW7HmB2giaHA==","X-Received":"by 10.200.2.147 with SMTP id p19mr6113332qtg.54.1504012253640;\n\tTue, 29 Aug 2017 06:10:53 -0700 (PDT)","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","To":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org,\n\tKamil Rytarowski <kamil@netbsd.org>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>","Message-ID":"<edd3bb01-dcb5-4741-3fe4-a20a5f64af88@amsat.org>","Date":"Tue, 29 Aug 2017 10:10:48 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c0d::235","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, stefanha@redhat.com, Cleber\n\tRosa <crosa@redhat.com>, pbonzini@redhat.com, =?utf-8?q?Alex_Benn?=\n\t=?utf-8?b?w6ll?= <alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759329,"web_url":"http://patchwork.ozlabs.org/comment/1759329/","msgid":"<f2a66875-06e8-9304-b20d-aa10e848a245@gmx.com>","list_archive_url":null,"date":"2017-08-29T13:22:46","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":11273,"url":"http://patchwork.ozlabs.org/api/people/11273/","name":"Kamil Rytarowski","email":"n54@gmx.com"},"content":"On 29.08.2017 15:10, Philippe Mathieu-Daudé wrote:\n> Hi Fam, Kamil,\n> \n>> On 08/28/2017 02:47 PM, Fam Zheng wrote:\n> [...]\n>>> +        subprocess.check_call([tar_cmd,\n>>> +                               \"--exclude-vcs\",\n>>> +                               \"--exclude=tests/vm/*.img\",\n>>> +                               \"--exclude=tests/vm/*.img.*\",\n>>> +                               \"--exclude=*.d\",\n>>> +                               \"--exclude=*.o\",\n>>> +                               \"--exclude=docker-src.*\",\n>>> +                               \"-cf\", tarfile, '.'], cwd=data_dir,\n>>\n>> I'm not happy with this command :/\n>> My distrib uses tmpfs for /tmp and suddently the whole X window became\n>> irresponsive until this script failing after filling 8G of /tmp and swap:\n>>\n>> ...\n>> DEBUG:root:Creating archive /tmp/qemu-vm-F7CY9O/data-3a52c.tar for\n>> data dir: .\n>> tar: /tmp/qemu-vm-F7CY9O/data-3a52c.tar: Wrote only 4096 of 10240 bytes\n>> tar: Error is not recoverable: exiting now\n>> Failed to prepare guest environment\n>>\n>> Then I figured out my workdir is full of testing stuff, debug images,\n>> firmwares, coredumps, etc.\n>>\n>> I'll think of another way.\n> \n> Using:\n> \n> (git ls-files; git submodule foreach --recursive \"git ls-files | sed\n> s_^_\\$sm_path/_\" | sed /^Entering/d) > files.txt\n> \n> and:\n> \n>         subprocess.check_call([tar_cmd,\n>                                \"-cf\", tarfile,\n>                                \"-v\" if self.debug else \"\",\n>                                \"-T\", \"files.txt\"], cwd=data_dir,\n>                               stdin=self._devnull, stdout=self._stdout)\n> \n> Current /master and submodules generated tarball is ~305MB uncompressed.\n> \n> Kamil do you mind testing this command on NetBSD?\n> \n> (obviously 'files.txt' goes in tmpdir).\n> \n\nResult:\n\nhttp://www.netbsd.org/~kamil/qemu/files.txt\n\nI've tested this command line on a checkout from Jul 17th rev. 77031ee1ce4c\n\n> Regards,\n> \n> Phil.\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhTmd2Zb4z9t2v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 23:21:19 +1000 (AEST)","from localhost ([::1]:44926 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmgSD-0001kA-CH\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 09:21:17 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56926)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from <n54@gmx.com>)\n\tid 1dmgRk-0001jx-Te\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 09:20:53 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <n54@gmx.com>) id 1dmgRf-0004QJ-Qv\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 09:20:48 -0400","from mout.gmx.net ([212.227.15.19]:54096)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <n54@gmx.com>) id 1dmgRf-0004Ow-Ak\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 09:20:43 -0400","from [192.168.1.3] ([185.58.161.191]) by mail.gmx.com (mrgmx002\n\t[212.227.17.184]) with ESMTPSA (Nemesis) id 0MfVU3-1eB60d3fid-00P2N2; \n\tTue, 29 Aug 2017 15:20:29 +0200"],"To":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\tFam Zheng <famz@redhat.com>, qemu-devel@nongnu.org, Kamil Rytarowski\n\t<kamil@netbsd.org>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>\n\t<edd3bb01-dcb5-4741-3fe4-a20a5f64af88@amsat.org>","From":"Kamil Rytarowski <n54@gmx.com>","Message-ID":"<f2a66875-06e8-9304-b20d-aa10e848a245@gmx.com>","Date":"Tue, 29 Aug 2017 15:22:46 +0200","User-Agent":"Mozilla/5.0 (X11; NetBSD amd64; rv:52.0) Gecko/20100101\n\tThunderbird/52.1.0","MIME-Version":"1.0","In-Reply-To":"<edd3bb01-dcb5-4741-3fe4-a20a5f64af88@amsat.org>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"lQ8ftCS1D5gwVs61KSoDfDTI1fsgvPwtH\"","X-Provags-ID":"V03:K0:Zu2mNg3L9WPGVYgFea2jOIZaM1k78gAoMke6UTrTXIlbxKer/VG\n\tbRVspCU3jd70W+SKKstGKZsG9ObIOrFsbURlj5n2QFjsHPgvmQTJNkmkNx8BZ0Nx0zJ+C6g\n\t7MFYf6jbYtZIhY16jOFcOPqbWYsqyeHzDH12g3yJymIsvtQqN4X5Y/KKLE4MXtSB/480Jmk\n\tMqecxGe+7CPcu0Svw0w7A==","X-UI-Out-Filterresults":"notjunk:1; V01:K0:+CTyaYE6+80=:8ppmZet5Lh+yHkri74BhGV\n\tmnVvqdOZXO+lbZJeIia6XWxOCt6h+PlDw6bkEwnrOzJJ6gGIsaJ7YdfbBcvgZpipvzJRSTL1R\n\t3zo9bx/kHOwP38bGuY1ZeyiOPbIW3xW9pMhLoyt4/muvmszK7dHHSM8eYH9nz0yziONuo+6V2\n\tZihGOBFscOpgUTzgmEDxQ6AJCv4/u7h9fQysrMgCdsV2u6BnVLxHqEnN+MYMlnZuEo1VbxYj3\n\tUKzKYACu6g3SdcTFy4sTc25Tcs6Fqs93pc0w+iVqI1No6DQm0FoBW2CxWSUoGnZaJ5T/dZA8c\n\tNRLf3CmTnuZUmP2tyViVZU14VAJ87unG8QrxNyezhvycSXalCY7bFe9BfLbkh/+QNdQP+o4hZ\n\txAyUyeJqeB8qJraa/ozlPBLFoZDmb3UslJqfVPNXNEaxSgUnMlMtjKB4YF+qRuqkmc6ScCbSN\n\tz+7MufqqXi3CwEarb1U1/VM+PL+FsxTs5mKjXEbLDRSUkNObdC8e2iDZCvIX9MpIA7vjlwpEt\n\tBG7txrZ9cP+IbaMQm+CiMmhPN5TiEJPRl9SYMHMH0BibIUTcdZh2g9aw0vDIZ8hK4KmNmaOkr\n\tky9EdF/JNCY4+NDq3YS8NS6JKoj/7O5RtTdzI7Abjp31prdHi5p1VlFEXN91TxlmWAh8XWycY\n\t3ldqu45D2neDUeAh+0jGwKWOfgo11eCQSFdhUO6zIl86cjqAQmlH3xtqfYluVP7YB5Q7AZcow\n\tLGRjI5sy7XgvRRLU5VUtBbKIH0rWz93YYFbyEHNbyYAEA2gv0G2Q7bGEz1uHrbSxrvXRRoFBk\n\t8POUPzkApaHcH4bL2j6lffpJrVGLg==","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"212.227.15.19","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, pbonzini@redhat.com,\n\t=?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n\tstefanha@redhat.com, Cleber Rosa <crosa@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759343,"web_url":"http://patchwork.ozlabs.org/comment/1759343/","msgid":"<c91157c7-6378-579c-b66e-19db518cd58a@amsat.org>","list_archive_url":null,"date":"2017-08-29T13:35:02","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"On 08/29/2017 10:22 AM, Kamil Rytarowski wrote:\n> On 29.08.2017 15:10, Philippe Mathieu-Daudé wrote:\n>> Hi Fam, Kamil,\n>>\n>>> On 08/28/2017 02:47 PM, Fam Zheng wrote:\n>> [...]\n>>>> +        subprocess.check_call([tar_cmd,\n>>>> +                               \"--exclude-vcs\",\n>>>> +                               \"--exclude=tests/vm/*.img\",\n>>>> +                               \"--exclude=tests/vm/*.img.*\",\n>>>> +                               \"--exclude=*.d\",\n>>>> +                               \"--exclude=*.o\",\n>>>> +                               \"--exclude=docker-src.*\",\n>>>> +                               \"-cf\", tarfile, '.'], cwd=data_dir,\n>>>\n>>> I'm not happy with this command :/\n>>> My distrib uses tmpfs for /tmp and suddently the whole X window became\n>>> irresponsive until this script failing after filling 8G of /tmp and swap:\n>>>\n>>> ...\n>>> DEBUG:root:Creating archive /tmp/qemu-vm-F7CY9O/data-3a52c.tar for\n>>> data dir: .\n>>> tar: /tmp/qemu-vm-F7CY9O/data-3a52c.tar: Wrote only 4096 of 10240 bytes\n>>> tar: Error is not recoverable: exiting now\n>>> Failed to prepare guest environment\n>>>\n>>> Then I figured out my workdir is full of testing stuff, debug images,\n>>> firmwares, coredumps, etc.\n>>>\n>>> I'll think of another way.\n>>\n>> Using:\n>>\n>> (git ls-files; git submodule foreach --recursive \"git ls-files | sed\n>> s_^_\\$sm_path/_\" | sed /^Entering/d) > files.txt\n>>\n>> and:\n>>\n>>          subprocess.check_call([tar_cmd,\n>>                                 \"-cf\", tarfile,\n>>                                 \"-v\" if self.debug else \"\",\n>>                                 \"-T\", \"files.txt\"], cwd=data_dir,\n>>                                stdin=self._devnull, stdout=self._stdout)\n>>\n>> Current /master and submodules generated tarball is ~305MB uncompressed.\n>>\n>> Kamil do you mind testing this command on NetBSD?\n>>\n>> (obviously 'files.txt' goes in tmpdir).\n>>\n> \n> Result:\n> \n> http://www.netbsd.org/~kamil/qemu/files.txt\n\n\\o/\n\n> I've tested this command line on a checkout from Jul 17th rev. 77031ee1ce4c\n\nThanks Kamil :)\n\nFam are you OK using this command instead?\n\nRegards,\n\nPhil.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"IXrugzAv\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhV6X0PhKz9t2v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 23:36:50 +1000 (AEST)","from localhost ([::1]:44987 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmghD-00074f-Na\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 09:36:47 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:33080)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmgfg-0006VE-TD\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 09:35:13 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmgfc-0003Rc-O6\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 09:35:12 -0400","from mail-qt0-x233.google.com ([2607:f8b0:400d:c0d::233]:36140)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmgfc-0003R8-JX\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 09:35:08 -0400","by mail-qt0-x233.google.com with SMTP id v29so14659327qtv.3\n\tfor <qemu-devel@nongnu.org>; Tue, 29 Aug 2017 06:35:08 -0700 (PDT)","from [192.168.1.10] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tz35sm1989714qtb.34.2017.08.29.06.35.03\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 29 Aug 2017 06:35:07 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=DVjjEUPzJcSmgE9ZUkckTBD78gzR8wePluJoF4lqsTQ=;\n\tb=IXrugzAvKipxdV4tIp6AQndAiZjDiBGiVNX662yCyOASRznb89hnV3+4rO3pSeAsEY\n\thDYICnjJScHxlZLX0lkToYItYQP/FlyVDm6unq5HNR9+8H3Kk4UwLY8rBEhvciUhh99A\n\tkbrrJopUYaAQVANGcrALqUAg6cyXFPdrkrGkCfOVZSJ3kFgR7uKN6kjZEIWIfJPglr4G\n\tJKX4EBiixN/BPw/bgUC9X7CRC8mJA4WNFyp0n6ueB7FR6msuqW4Rs/V/idiobfn5hN/M\n\toET3S6ePnsLWqyHl0TDZU827ux51pViBYVAW0o0S59SkYdcmVeg2kKy1sXp600vxSTkx\n\tYTdg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=DVjjEUPzJcSmgE9ZUkckTBD78gzR8wePluJoF4lqsTQ=;\n\tb=B3y/zsr5nl82Ai67T08RpbJa3ldQBQbTPP4zUlonYkqGbzXNKSJbWJpHsP08eYJEGr\n\tj6Zc9zLopsBRDIsRPi+ldynGuQ1OFbgdvjKCvwaOHEjS8BuzQGBXUX9A9GZ21qb0ac9a\n\tD/ILfNekqCieWmXUplRBCWT5bT1kPaOnQAp8N+M+kwxEsCO9p13hZWnoTrLQ/3/XKQ3E\n\tBwzso+QMye3gqjKOjdjbuB90cfq4FT89iJuAJESe8hdoxMjby6uze2v3S88KdZFuoeqJ\n\tj9XZ1biiFQlkQnRM0jaEthdlRgjubMsNn/Rpi9wDW6fLln40lcQypjcId6kdRxyWoZWF\n\tN/CQ==","X-Gm-Message-State":"AHYfb5j7iu9h/KY5+aoTOftd4ocER0QwT8PJnI/4TDXhpGcUQHCRYJxz\n\taJORVwPIeW115g==","X-Received":"by 10.200.8.234 with SMTP id y39mr5559564qth.275.1504013708030; \n\tTue, 29 Aug 2017 06:35:08 -0700 (PDT)","To":"Kamil Rytarowski <n54@gmx.com>, Fam Zheng <famz@redhat.com>,\n\tqemu-devel@nongnu.org, Kamil Rytarowski <kamil@netbsd.org>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>\n\t<edd3bb01-dcb5-4741-3fe4-a20a5f64af88@amsat.org>\n\t<f2a66875-06e8-9304-b20d-aa10e848a245@gmx.com>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Message-ID":"<c91157c7-6378-579c-b66e-19db518cd58a@amsat.org>","Date":"Tue, 29 Aug 2017 10:35:02 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<f2a66875-06e8-9304-b20d-aa10e848a245@gmx.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c0d::233","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, pbonzini@redhat.com,\n\t=?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n\tstefanha@redhat.com, Cleber Rosa <crosa@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759567,"web_url":"http://patchwork.ozlabs.org/comment/1759567/","msgid":"<c751fc1d-602a-25ed-edb9-84ccdaeb2ecb@amsat.org>","list_archive_url":null,"date":"2017-08-29T17:34:07","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"On 08/28/2017 02:47 PM, Fam Zheng wrote:\n[...]\n> +    def __init__(self, debug=False, vcpus=None):\n> +        self._guest = None\n> +        self._tmpdir = tempfile.mkdtemp(prefix=\"qemu-vm-\")\n> +        atexit.register(shutil.rmtree, self._tmpdir)\n> +\n> +        self._ssh_key_file = os.path.join(self._tmpdir, \"id_rsa\")\n> +        open(self._ssh_key_file, \"w\").write(SSH_KEY)\n> +        subprocess.check_call([\"chmod\", \"600\", self._ssh_key_file])\n> +\n> +        self._ssh_pub_key_file = os.path.join(self._tmpdir, \"id_rsa.pub\")\n> +        open(self._ssh_pub_key_file, \"w\").write(SSH_PUB_KEY)\n> +\n> +        self.debug = debug\n> +        self._stderr = sys.stderr\n> +        self._devnull = open(\"/dev/null\", \"w\")\n> +        if self.debug:\n> +            self._stdout = sys.stdout\n> +        else:\n> +            self._stdout = self._devnull\n> +        self._args = [ \\\n> +            \"-nodefaults\", \"-m\", \"2G\",\n> +            \"-cpu\", \"host\",\n> +            \"-netdev\", \"user,id=vnet,hostfwd=:0.0.0.0:0-:22\",\n> +            \"-device\", \"virtio-net-pci,netdev=vnet\",\n> +            \"-vnc\", \":0,to=20\",\n> +            \"-serial\", \"file:%s\" % os.path.join(self._tmpdir, \"serial.out\")]\n> +        if vcpus:\n> +            self._args += [\"-smp\", str(vcpus)]\n\nWhat about enabling mttcg which isn't default?\n\n             self._args += [\"--accel\", \"tcg,thread=multi\"]\n\n> +        if os.access(\"/dev/kvm\", os.R_OK | os.W_OK):\n> +            self._args += [\"-enable-kvm\"]\n> +        else:\n> +            logging.info(\"KVM not available, not using -enable-kvm\")\n> +        self._data_args = []\n[...]","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"D3kudXlG\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhbNv56cbz9ryr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 03:34:39 +1000 (AEST)","from localhost ([::1]:46298 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmkPN-00032p-Kz\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 13:34:37 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37651)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmkP3-000305-4U\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 13:34:18 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmkOz-00067N-3x\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 13:34:17 -0400","from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:33107)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dmkOy-00067H-Vh\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 13:34:13 -0400","by mail-qk0-x22b.google.com with SMTP id l65so18171197qkc.0\n\tfor <qemu-devel@nongnu.org>; Tue, 29 Aug 2017 10:34:12 -0700 (PDT)","from [192.168.1.10] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tj60sm2196461qtb.66.2017.08.29.10.34.08\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 29 Aug 2017 10:34:11 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=mckCRR+l2LA3sZKkRiJC385mZvxef0VoXBXl15F0UPE=;\n\tb=D3kudXlGQw7A7WACQTsZf5UQ+P4T0eLF+3lQ/6kM+P77dujp69gWHIYrUIYwidLi6R\n\tL4GVeqbRAWZGI6M0/Mrson1xB5tzlzz5nIC2m7f7B03sCIlZlZoi35FVb7r9PNtPGVer\n\tWGZOHJaOr/XT9h/r3cempW31/pP2NNqhzZX45rtLtHP2osNfdSL/qBoFPoX8r3YL+Jii\n\teQ1CJmYsXk4NDX77YXpMN7C1WqqBWXNdhcOiQoLWiCFM4DVe3dsdo2cVC/VAkGMqtw/V\n\tpYDybH+Hq5aYo0Aux2bvE7pyvGFcYbZmiM3mGrft7bujcne4IiUFTNv9UDkBeHC7hJTZ\n\tbkag==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=mckCRR+l2LA3sZKkRiJC385mZvxef0VoXBXl15F0UPE=;\n\tb=H5uACM/WUEVJMPd760zw1cCJyEfFlw13A6qteDhIksAKwnhiyo5qEU/y0edUCxrHp2\n\tlft9ITNiB5WadUCf5Biu1nc3d//nhHzD9GKAJdnHQ8Za26tin1zlOaVYgTTLV2gOFNMZ\n\tZDcpqmJDBm0Y0TUbDplFnc3tgQHeuy0AUygZuSbSjVfW0F6nM0c+/yfVarpJV3KPH00r\n\tZvB4QFQ4w3SxaIzhkF827ig0S3RdVYwmsHV64u3PDA8Tg4z8Xw9qT2FWyzPXwlcHfylH\n\tQZa3rcKRY+uO8NF1SvNeKOovryGUtBzxfKySY483ulIM/lv7NKL9nGNs8aVbXEfWQXxL\n\tXbZg==","X-Gm-Message-State":"AHYfb5h+1z8PnTag9UsH7CmAjooO1eiPhzvg7PcCnUwmrkhJqTcO1CON\n\tdGfnfdGBg47g4A==","X-Received":"by 10.55.130.130 with SMTP id e124mr6449626qkd.155.1504028052400;\n\tTue, 29 Aug 2017 10:34:12 -0700 (PDT)","To":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Message-ID":"<c751fc1d-602a-25ed-edb9-84ccdaeb2ecb@amsat.org>","Date":"Tue, 29 Aug 2017 14:34:07 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170828174707.20786-4-famz@redhat.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c09::22b","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, Kamil Rytarowski\n\t<kamil@netbsd.org>, stefanha@redhat.com, Cleber Rosa <crosa@redhat.com>,\n\tpbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759832,"web_url":"http://patchwork.ozlabs.org/comment/1759832/","msgid":"<20170830032704.GB4208@lemon.lan>","list_archive_url":null,"date":"2017-08-30T03:27:04","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Tue, 08/29 13:11, Daniel P. Berrange wrote:\n> On Tue, Aug 29, 2017 at 09:06:48AM -0300, Philippe Mathieu-Daudé wrote:\n> > Hi Fam,\n> > \n> > On 08/28/2017 02:47 PM, Fam Zheng wrote:\n> > > This is the common code to implement a \"VM test\" to\n> > > \n> > >    1) Download and initialize a pre-defined VM that has necessary\n> > >    dependencies to build QEMU and SSH access.\n> > > \n> > >    2) Archive $SRC_PATH to a .tar file.\n> > > \n> > >    3) Boot the VM, and pass the source tar file to the guest.\n> > > \n> > >    4) SSH into the VM, untar the source tarball, build from the source.\n> > > \n> > > Signed-off-by: Fam Zheng <famz@redhat.com>\n> > > ---\n> > >   tests/vm/basevm.py | 287 +++++++++++++++++++++++++++++++++++++++++++++++++++++\n> > >   1 file changed, 287 insertions(+)\n> > >   create mode 100755 tests/vm/basevm.py\n> > > \n> > > diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py\n> > > new file mode 100755\n> > > index 0000000000..d0095c5332\n> > > --- /dev/null\n> > > +++ b/tests/vm/basevm.py\n> \n> > > +    def add_source_dir(self, data_dir):\n> > > +        name = \"data-\" + hashlib.sha1(data_dir).hexdigest()[:5]\n> > > +        tarfile = os.path.join(self._tmpdir, name + \".tar\")\n> > > +        logging.debug(\"Creating archive %s for data dir: %s\", tarfile, data_dir)\n> > > +        if subprocess.call(\"type gtar\", stdout=self._devnull,\n> > > +                           stderr=self._devnull, shell=True) == 0:\n> > > +            tar_cmd = \"gtar\"\n> > > +        else:\n> > > +            tar_cmd = \"tar\"\n> > > +        subprocess.check_call([tar_cmd,\n> > > +                               \"--exclude-vcs\",\n> > > +                               \"--exclude=tests/vm/*.img\",\n> > > +                               \"--exclude=tests/vm/*.img.*\",\n> > > +                               \"--exclude=*.d\",\n> > > +                               \"--exclude=*.o\",\n> > > +                               \"--exclude=docker-src.*\",\n> > > +                               \"-cf\", tarfile, '.'], cwd=data_dir,\n> > \n> > I'm not happy with this command :/\n> > My distrib uses tmpfs for /tmp and suddently the whole X window became\n> > irresponsive until this script failing after filling 8G of /tmp and swap:\n> > \n> > ...\n> > DEBUG:root:Creating archive /tmp/qemu-vm-F7CY9O/data-3a52c.tar for data dir:\n> > .\n> > tar: /tmp/qemu-vm-F7CY9O/data-3a52c.tar: Wrote only 4096 of 10240 bytes\n> > tar: Error is not recoverable: exiting now\n> > Failed to prepare guest environment\n> > \n> > Then I figured out my workdir is full of testing stuff, debug images,\n> > firmwares, coredumps, etc.\n> > \n> > I'll think of another way.\n> \n> Yeah, /tmp should never be used for anything which has significant\n> size. Could go for /var/tmp instead, but IMHO just use the QEMU build\n> dir, as is done for (almost) all other build & test artifacts and\n> thus avoid any global dirs.\n\nThanks, I'll fix it. Using current dir would be fine.\n\nFam\n\n> \n> \n> Regards,\n> Daniel\n> -- \n> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|\n> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|\n> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhrYB4XHjz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 13:27:39 +1000 (AEST)","from localhost ([::1]:47909 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmtfE-0005Vl-RY\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 23:27:36 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37472)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dmteu-0005VO-NU\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 23:27:17 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dmter-0006aY-Jk\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 23:27:16 -0400","from mx1.redhat.com ([209.132.183.28]:54944)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dmter-0006aK-A0\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 23:27:13 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id CB79C356EA;\n\tWed, 30 Aug 2017 03:27:11 +0000 (UTC)","from localhost (ovpn-12-109.pek2.redhat.com [10.72.12.109])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 63C1E785EC;\n\tWed, 30 Aug 2017 03:27:06 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com CB79C356EA","Date":"Wed, 30 Aug 2017 11:27:04 +0800","From":"Fam Zheng <famz@redhat.com>","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Message-ID":"<20170830032704.GB4208@lemon.lan>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>\n\t<20170829121100.GA25801@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<20170829121100.GA25801@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tWed, 30 Aug 2017 03:27:12 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, Philippe =?iso-8859-1?q?Math?=\n\t=?iso-8859-1?q?ieu-Daud=E9?= <f4bug@amsat.org>, qemu-devel@nongnu.org,\n\tKamil Rytarowski <kamil@netbsd.org>, stefanha@redhat.com,\n\tCleber Rosa <crosa@redhat.com>, pbonzini@redhat.com, Alex\n\t=?iso-8859-1?q?Benn=E9e?= <alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759833,"web_url":"http://patchwork.ozlabs.org/comment/1759833/","msgid":"<20170830032949.GC4208@lemon.lan>","list_archive_url":null,"date":"2017-08-30T03:29:49","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Tue, 08/29 09:15, Philippe Mathieu-Daudé wrote:\n> > +        self._args = [ \\\n> > +            \"-nodefaults\", \"-m\", \"2G\",\n> > +            \"-cpu\", \"host\",\n> > +            \"-netdev\", \"user,id=vnet,hostfwd=:0.0.0.0:0-:22\",\n> \n> Testing with debian/unstable:\n> \n> $ make vm-build-netbsd V=1\n> ./tests/vm/netbsd  --debug   --image \"tests/vm/netbsd.img\" --build-qemu .\n> DEBUG:root:Creating archive /tmp/qemu-vm-PxfXNv/data-3a52c.tar for data dir:\n> .\n> DEBUG:root:QEMU args: -nodefaults -m 2G -cpu host -netdev\n> user,id=vnet,hostfwd=:0.0.0.0:0-:22 -device virtio-net-pci,netdev=vnet -vnc\n> :0,to=20 -serial file:/tmp/qemu-vm-PxfXNv/serial.out -smp 4 -enable-kvm\n> -device VGA -drive\n> file=tests/vm/netbsd.img,snapshot=on,if=none,id=drive0,cache=writeback\n> -device virtio-blk,drive=drive0,bootindex=0 -drive file=/tmp/qemu-vm-PxfXNv/data-3a52c.tar,if=none,id=data-3a52c,cache=writeback,format=raw\n> -device virtio-blk,drive=data-3a52c,serial=data-3a52c,bootindex=1\n> Failed to prepare guest environment\n\nCan you please look into the stderr of the QEMU command line to see what\narguments went wrong? (I hope the qemu.py improvement patches on the list can\ngive a better error message in such cases.)\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhrcB3qbVz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 13:30:18 +1000 (AEST)","from localhost ([::1]:47911 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmtho-0006To-FK\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 23:30:16 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37805)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dmthW-0006TX-5z\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 23:29:58 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dmthT-0007cj-2t\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 23:29:58 -0400","from mx1.redhat.com ([209.132.183.28]:46854)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dmthS-0007cC-Ru\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 23:29:54 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id CA9DEC047B6F;\n\tWed, 30 Aug 2017 03:29:53 +0000 (UTC)","from localhost (ovpn-12-109.pek2.redhat.com [10.72.12.109])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 3AA7366D61;\n\tWed, 30 Aug 2017 03:29:50 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com CA9DEC047B6F","Date":"Wed, 30 Aug 2017 11:29:49 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Philippe =?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>","Message-ID":"<20170830032949.GC4208@lemon.lan>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<9658452f-c89f-43d2-07ff-5d620fd471a9@amsat.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<9658452f-c89f-43d2-07ff-5d620fd471a9@amsat.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tWed, 30 Aug 2017 03:29:53 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Kamil\n\tRytarowski <kamil@netbsd.org>, stefanha@redhat.com, Cleber Rosa\n\t<crosa@redhat.com>, pbonzini@redhat.com, Alex =?iso-8859-1?q?Benn=E9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1759835,"web_url":"http://patchwork.ozlabs.org/comment/1759835/","msgid":"<20170830033445.GE4208@lemon.lan>","list_archive_url":null,"date":"2017-08-30T03:34:45","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Tue, 08/29 14:34, Philippe Mathieu-Daudé wrote:\n> > +        self._args = [ \\\n> > +            \"-nodefaults\", \"-m\", \"2G\",\n> > +            \"-cpu\", \"host\",\n> > +            \"-netdev\", \"user,id=vnet,hostfwd=:0.0.0.0:0-:22\",\n> > +            \"-device\", \"virtio-net-pci,netdev=vnet\",\n> > +            \"-vnc\", \":0,to=20\",\n> > +            \"-serial\", \"file:%s\" % os.path.join(self._tmpdir, \"serial.out\")]\n> > +        if vcpus:\n> > +            self._args += [\"-smp\", str(vcpus)]\n> \n> What about enabling mttcg which isn't default?\n> \n>             self._args += [\"--accel\", \"tcg,thread=multi\"]\n\nAny specific reason to enable it? I think it is not available on older QEMU.\n\n> \n> > +        if os.access(\"/dev/kvm\", os.R_OK | os.W_OK):\n> > +            self._args += [\"-enable-kvm\"]\n> > +        else:\n> > +            logging.info(\"KVM not available, not using -enable-kvm\")\n> > +        self._data_args = []\n> [...]\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhrkR5PNZz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 13:35:43 +1000 (AEST)","from localhost ([::1]:47947 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmtn3-000117-NJ\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 23:35:41 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38793)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dmtmK-0000iK-Q3\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 23:34:59 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dmtmE-0002ky-Ge\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 23:34:56 -0400","from mx1.redhat.com ([209.132.183.28]:33958)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dmtmE-0002kL-9j\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 23:34:50 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 3EE3F356F5;\n\tWed, 30 Aug 2017 03:34:49 +0000 (UTC)","from localhost (ovpn-12-109.pek2.redhat.com [10.72.12.109])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 8919A6972F;\n\tWed, 30 Aug 2017 03:34:46 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 3EE3F356F5","Date":"Wed, 30 Aug 2017 11:34:45 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Philippe =?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>","Message-ID":"<20170830033445.GE4208@lemon.lan>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<c751fc1d-602a-25ed-edb9-84ccdaeb2ecb@amsat.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<c751fc1d-602a-25ed-edb9-84ccdaeb2ecb@amsat.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tWed, 30 Aug 2017 03:34:49 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Kamil\n\tRytarowski <kamil@netbsd.org>, stefanha@redhat.com, Cleber Rosa\n\t<crosa@redhat.com>, pbonzini@redhat.com, Alex =?iso-8859-1?q?Benn=E9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1760023,"web_url":"http://patchwork.ozlabs.org/comment/1760023/","msgid":"<20170830101658.GN4208@lemon.lan>","list_archive_url":null,"date":"2017-08-30T10:16:58","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Tue, 08/29 10:35, Philippe Mathieu-Daudé wrote:\n> On 08/29/2017 10:22 AM, Kamil Rytarowski wrote:\n> > On 29.08.2017 15:10, Philippe Mathieu-Daudé wrote:\n> > > Hi Fam, Kamil,\n> > > \n> > > > On 08/28/2017 02:47 PM, Fam Zheng wrote:\n> > > [...]\n> > > > > +        subprocess.check_call([tar_cmd,\n> > > > > +                               \"--exclude-vcs\",\n> > > > > +                               \"--exclude=tests/vm/*.img\",\n> > > > > +                               \"--exclude=tests/vm/*.img.*\",\n> > > > > +                               \"--exclude=*.d\",\n> > > > > +                               \"--exclude=*.o\",\n> > > > > +                               \"--exclude=docker-src.*\",\n> > > > > +                               \"-cf\", tarfile, '.'], cwd=data_dir,\n> > > > \n> > > > I'm not happy with this command :/\n> > > > My distrib uses tmpfs for /tmp and suddently the whole X window became\n> > > > irresponsive until this script failing after filling 8G of /tmp and swap:\n> > > > \n> > > > ...\n> > > > DEBUG:root:Creating archive /tmp/qemu-vm-F7CY9O/data-3a52c.tar for\n> > > > data dir: .\n> > > > tar: /tmp/qemu-vm-F7CY9O/data-3a52c.tar: Wrote only 4096 of 10240 bytes\n> > > > tar: Error is not recoverable: exiting now\n> > > > Failed to prepare guest environment\n> > > > \n> > > > Then I figured out my workdir is full of testing stuff, debug images,\n> > > > firmwares, coredumps, etc.\n> > > > \n> > > > I'll think of another way.\n> > > \n> > > Using:\n> > > \n> > > (git ls-files; git submodule foreach --recursive \"git ls-files | sed\n> > > s_^_\\$sm_path/_\" | sed /^Entering/d) > files.txt\n> > > \n> > > and:\n> > > \n> > >          subprocess.check_call([tar_cmd,\n> > >                                 \"-cf\", tarfile,\n> > >                                 \"-v\" if self.debug else \"\",\n> > >                                 \"-T\", \"files.txt\"], cwd=data_dir,\n> > >                                stdin=self._devnull, stdout=self._stdout)\n> > > \n> > > Current /master and submodules generated tarball is ~305MB uncompressed.\n> > > \n> > > Kamil do you mind testing this command on NetBSD?\n> > > \n> > > (obviously 'files.txt' goes in tmpdir).\n> > > \n> > \n> > Result:\n> > \n> > http://www.netbsd.org/~kamil/qemu/files.txt\n> \n> \\o/\n> \n> > I've tested this command line on a checkout from Jul 17th rev. 77031ee1ce4c\n> \n> Thanks Kamil :)\n> \n> Fam are you OK using this command instead?\n\nLooks good, will use it! Thanks.\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xj1fW2mgpz9sQl\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 20:17:55 +1000 (AEST)","from localhost ([::1]:49473 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dn04E-0002bl-B7\n\tfor incoming@patchwork.ozlabs.org; Wed, 30 Aug 2017 06:17:50 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:33314)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dn03Z-0002Zp-88\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 06:17:11 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dn03U-00016D-Ai\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 06:17:09 -0400","from mx1.redhat.com ([209.132.183.28]:52508)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dn03U-00015o-1A\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 06:17:04 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 11BC87F7D0;\n\tWed, 30 Aug 2017 10:17:03 +0000 (UTC)","from localhost (ovpn-12-48.pek2.redhat.com [10.72.12.48])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 9173596532;\n\tWed, 30 Aug 2017 10:16:59 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 11BC87F7D0","Date":"Wed, 30 Aug 2017 18:16:58 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Philippe =?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>","Message-ID":"<20170830101658.GN4208@lemon.lan>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>\n\t<edd3bb01-dcb5-4741-3fe4-a20a5f64af88@amsat.org>\n\t<f2a66875-06e8-9304-b20d-aa10e848a245@gmx.com>\n\t<c91157c7-6378-579c-b66e-19db518cd58a@amsat.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<c91157c7-6378-579c-b66e-19db518cd58a@amsat.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tWed, 30 Aug 2017 10:17:03 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Kamil\n\tRytarowski <kamil@netbsd.org>, stefanha@redhat.com, Cleber Rosa\n\t<crosa@redhat.com>, pbonzini@redhat.com, Kamil Rytarowski <n54@gmx.com>,\n\tAlex =?iso-8859-1?q?Benn=E9e?= <alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1760025,"web_url":"http://patchwork.ozlabs.org/comment/1760025/","msgid":"<20170830101551.GM4208@lemon.lan>","list_archive_url":null,"date":"2017-08-30T10:15:52","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Wed, 08/30 11:29, Fam Zheng wrote:\n> On Tue, 08/29 09:15, Philippe Mathieu-Daudé wrote:\n> > > +        self._args = [ \\\n> > > +            \"-nodefaults\", \"-m\", \"2G\",\n> > > +            \"-cpu\", \"host\",\n> > > +            \"-netdev\", \"user,id=vnet,hostfwd=:0.0.0.0:0-:22\",\n> > \n> > Testing with debian/unstable:\n> > \n> > $ make vm-build-netbsd V=1\n> > ./tests/vm/netbsd  --debug   --image \"tests/vm/netbsd.img\" --build-qemu .\n> > DEBUG:root:Creating archive /tmp/qemu-vm-PxfXNv/data-3a52c.tar for data dir:\n> > .\n> > DEBUG:root:QEMU args: -nodefaults -m 2G -cpu host -netdev\n> > user,id=vnet,hostfwd=:0.0.0.0:0-:22 -device virtio-net-pci,netdev=vnet -vnc\n> > :0,to=20 -serial file:/tmp/qemu-vm-PxfXNv/serial.out -smp 4 -enable-kvm\n> > -device VGA -drive\n> > file=tests/vm/netbsd.img,snapshot=on,if=none,id=drive0,cache=writeback\n> > -device virtio-blk,drive=drive0,bootindex=0 -drive file=/tmp/qemu-vm-PxfXNv/data-3a52c.tar,if=none,id=data-3a52c,cache=writeback,format=raw\n> > -device virtio-blk,drive=data-3a52c,serial=data-3a52c,bootindex=1\n> > Failed to prepare guest environment\n> \n> Can you please look into the stderr of the QEMU command line to see what\n> arguments went wrong? (I hope the qemu.py improvement patches on the list can\n> give a better error message in such cases.)\n\nI've tested with Fedora 26's qemu-system-x86-2.9.0-5.fc26.x86_64 and got the\nfailure due to the hostfwd syntax:\n\nqemu-system-x86_64: -netdev user,id=vnet,hostfwd=:0.0.0.0:0-:22: invalid host forwarding rule ':0.0.0.0:0-:22'\nqemu-system-x86_64: -netdev user,id=vnet,hostfwd=:0.0.0.0:0-:22: Device 'user' could not be initialized\n\nBut it makes sense to use dynamic port allocation to avoid collision.\n\nSince it's about developing QEMU, using cutting edge QEMU features is not that\nbad. Let's keep this one.\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xj1g83vCgz9t0F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 20:18:28 +1000 (AEST)","from localhost ([::1]:49475 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dn04o-000343-82\n\tfor incoming@patchwork.ozlabs.org; Wed, 30 Aug 2017 06:18:26 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:32839)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dn02V-0001p5-6k\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 06:16:09 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dn02Q-0000bT-8l\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 06:16:03 -0400","from mx1.redhat.com ([209.132.183.28]:59216)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dn02Q-0000a7-1t\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 06:15:58 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 0EF8EC0587DB;\n\tWed, 30 Aug 2017 10:15:57 +0000 (UTC)","from localhost (ovpn-12-48.pek2.redhat.com [10.72.12.48])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id D0AC882A22;\n\tWed, 30 Aug 2017 10:15:53 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 0EF8EC0587DB","Date":"Wed, 30 Aug 2017 18:15:52 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Philippe =?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>","Message-ID":"<20170830101551.GM4208@lemon.lan>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<9658452f-c89f-43d2-07ff-5d620fd471a9@amsat.org>\n\t<20170830032949.GC4208@lemon.lan>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<20170830032949.GC4208@lemon.lan>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tWed, 30 Aug 2017 10:15:57 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Kamil\n\tRytarowski <kamil@netbsd.org>, stefanha@redhat.com, Cleber Rosa\n\t<crosa@redhat.com>, pbonzini@redhat.com, Alex =?iso-8859-1?q?Benn=E9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1760141,"web_url":"http://patchwork.ozlabs.org/comment/1760141/","msgid":"<20170830131441.GB8076@lemon.lan>","list_archive_url":null,"date":"2017-08-30T13:14:41","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Wed, 08/30 18:16, Fam Zheng wrote:\n> On Tue, 08/29 10:35, Philippe Mathieu-Daudé wrote:\n> > On 08/29/2017 10:22 AM, Kamil Rytarowski wrote:\n> > > On 29.08.2017 15:10, Philippe Mathieu-Daudé wrote:\n> > > > Hi Fam, Kamil,\n> > > > \n> > > > > On 08/28/2017 02:47 PM, Fam Zheng wrote:\n> > > > [...]\n> > > > > > +        subprocess.check_call([tar_cmd,\n> > > > > > +                               \"--exclude-vcs\",\n> > > > > > +                               \"--exclude=tests/vm/*.img\",\n> > > > > > +                               \"--exclude=tests/vm/*.img.*\",\n> > > > > > +                               \"--exclude=*.d\",\n> > > > > > +                               \"--exclude=*.o\",\n> > > > > > +                               \"--exclude=docker-src.*\",\n> > > > > > +                               \"-cf\", tarfile, '.'], cwd=data_dir,\n> > > > > \n> > > > > I'm not happy with this command :/\n> > > > > My distrib uses tmpfs for /tmp and suddently the whole X window became\n> > > > > irresponsive until this script failing after filling 8G of /tmp and swap:\n> > > > > \n> > > > > ...\n> > > > > DEBUG:root:Creating archive /tmp/qemu-vm-F7CY9O/data-3a52c.tar for\n> > > > > data dir: .\n> > > > > tar: /tmp/qemu-vm-F7CY9O/data-3a52c.tar: Wrote only 4096 of 10240 bytes\n> > > > > tar: Error is not recoverable: exiting now\n> > > > > Failed to prepare guest environment\n> > > > > \n> > > > > Then I figured out my workdir is full of testing stuff, debug images,\n> > > > > firmwares, coredumps, etc.\n> > > > > \n> > > > > I'll think of another way.\n> > > > \n> > > > Using:\n> > > > \n> > > > (git ls-files; git submodule foreach --recursive \"git ls-files | sed\n> > > > s_^_\\$sm_path/_\" | sed /^Entering/d) > files.txt\n> > > > \n> > > > and:\n> > > > \n> > > >          subprocess.check_call([tar_cmd,\n> > > >                                 \"-cf\", tarfile,\n> > > >                                 \"-v\" if self.debug else \"\",\n> > > >                                 \"-T\", \"files.txt\"], cwd=data_dir,\n> > > >                                stdin=self._devnull, stdout=self._stdout)\n> > > > \n> > > > Current /master and submodules generated tarball is ~305MB uncompressed.\n> > > > \n> > > > Kamil do you mind testing this command on NetBSD?\n> > > > \n> > > > (obviously 'files.txt' goes in tmpdir).\n> > > > \n> > > \n> > > Result:\n> > > \n> > > http://www.netbsd.org/~kamil/qemu/files.txt\n> > \n> > \\o/\n> > \n> > > I've tested this command line on a checkout from Jul 17th rev. 77031ee1ce4c\n> > \n> > Thanks Kamil :)\n> > \n> > Fam are you OK using this command instead?\n> \n> Looks good, will use it! Thanks.\n\nHmm, there is a complication. \"git ls-files\" output includes submodule names,\nwhich are directory names from the \"tar -T\" PoV, and the whole directory is\narchived.\n\nI'm going to stop fighting on this and refactor the docker tests's \"git archive\"\nrules, to reuse in this script.\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xj5bK2Y4nz9s8P\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 23:15:25 +1000 (AEST)","from localhost ([::1]:50510 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dn2q2-00042f-UC\n\tfor incoming@patchwork.ozlabs.org; Wed, 30 Aug 2017 09:15:23 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:48066)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dn2pZ-00041t-QM\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 09:14:54 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dn2pU-0007vb-OJ\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 09:14:53 -0400","from mx1.redhat.com ([209.132.183.28]:47932)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dn2pU-0007vM-Fb\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 09:14:48 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 6B02B81240;\n\tWed, 30 Aug 2017 13:14:47 +0000 (UTC)","from localhost (ovpn-12-48.pek2.redhat.com [10.72.12.48])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 1EED787F86;\n\tWed, 30 Aug 2017 13:14:43 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 6B02B81240","Date":"Wed, 30 Aug 2017 21:14:41 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Philippe =?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>","Message-ID":"<20170830131441.GB8076@lemon.lan>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<de606e2a-7f5e-0625-79dd-a828ea3d5fe9@amsat.org>\n\t<edd3bb01-dcb5-4741-3fe4-a20a5f64af88@amsat.org>\n\t<f2a66875-06e8-9304-b20d-aa10e848a245@gmx.com>\n\t<c91157c7-6378-579c-b66e-19db518cd58a@amsat.org>\n\t<20170830101658.GN4208@lemon.lan>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<20170830101658.GN4208@lemon.lan>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tWed, 30 Aug 2017 13:14:47 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Kamil\n\tRytarowski <kamil@netbsd.org>, stefanha@redhat.com, Cleber Rosa\n\t<crosa@redhat.com>, pbonzini@redhat.com, Kamil Rytarowski <n54@gmx.com>,\n\tAlex =?iso-8859-1?q?Benn=E9e?= <alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1761944,"web_url":"http://patchwork.ozlabs.org/comment/1761944/","msgid":"<02eb8166-d0a4-a0e9-ec82-bc45a3626fd1@amsat.org>","list_archive_url":null,"date":"2017-09-01T19:29:50","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"On 08/30/2017 12:34 AM, Fam Zheng wrote:\n> On Tue, 08/29 14:34, Philippe Mathieu-Daudé wrote:\n>>> +        self._args = [ \\\n>>> +            \"-nodefaults\", \"-m\", \"2G\",\n>>> +            \"-cpu\", \"host\",\n>>> +            \"-netdev\", \"user,id=vnet,hostfwd=:0.0.0.0:0-:22\",\n>>> +            \"-device\", \"virtio-net-pci,netdev=vnet\",\n>>> +            \"-vnc\", \":0,to=20\",\n>>> +            \"-serial\", \"file:%s\" % os.path.join(self._tmpdir, \"serial.out\")]\n>>> +        if vcpus:\n>>> +            self._args += [\"-smp\", str(vcpus)]\n>>\n>> What about enabling mttcg which isn't default?\n>>\n>>              self._args += [\"--accel\", \"tcg,thread=multi\"]\n> \n> Any specific reason to enable it? I think it is not available on older QEMU.\n\nNeither is dynamic portfwd :)\n\nI see 2 reasons:\n- faster test\n- cover mttcg\n\n> \n>>\n>>> +        if os.access(\"/dev/kvm\", os.R_OK | os.W_OK):\n>>> +            self._args += [\"-enable-kvm\"]\n>>> +        else:\n>>> +            logging.info(\"KVM not available, not using -enable-kvm\")\n>>> +        self._data_args = []\n>> [...]\n> \n> Fam\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"GLBm1Qko\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkTrP0TCnz9sPt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  2 Sep 2017 05:31:33 +1000 (AEST)","from localhost ([::1]:56773 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dnrf9-0001zg-6u\n\tfor incoming@patchwork.ozlabs.org; Fri, 01 Sep 2017 15:31:31 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:40907)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dnrdg-0000wi-Gt\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 15:30:05 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dnrdb-0007Zg-VL\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 15:30:00 -0400","from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:35895)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dnrdb-0007ZQ-Rn\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 15:29:55 -0400","by mail-qk0-x244.google.com with SMTP id l65so840687qkc.3\n\tfor <qemu-devel@nongnu.org>; Fri, 01 Sep 2017 12:29:55 -0700 (PDT)","from [192.168.1.10] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tj127sm7606532qkc.75.2017.09.01.12.29.51\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 01 Sep 2017 12:29:54 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=1NHzN11F9DDnk8c0WWrXjTHE7MbHYo8408zd107rdss=;\n\tb=GLBm1QkoDFaU5t98CP1A/1XSzQkApj4LFha+MUm5SnIafUqgOI94Xtv8AodFPfNwvW\n\taNj4XojWXtCtS7nvnLCqQTtkcQuuYK2jTyV/JcgFJFaAkx9nmyWashQYOM0XW/6m+Zip\n\tZ2Gp8DgwvELrlK8K61NL3aRWsZ5igH0AejSA2vTxCkznUUOiRERWXsTzZzu99k4xsnKE\n\tI8v5iGa7KAavS9zaaRRWFgm6NBSmYp2zVXGqCVkUzq0iz3IDad5lq35qZcrzRAD8CekZ\n\tbE+Axic2bd39EYVImBVybBJDwIagrv4QM0Xna+KX1bOfknKXSxDJVzgiOWUelBOrpR9+\n\t0LTg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=1NHzN11F9DDnk8c0WWrXjTHE7MbHYo8408zd107rdss=;\n\tb=mx/whGbpXVX0LFj9R4QLETylqSLEAR/SUlulWbDjrQTptGVic/1CTqgj80pwDUdh9i\n\tJXC0WnTf+e9vLDwFQ9S1lHVZE83Sm6SpdBx0MdkMAEYA/2F79yhyaujRqmzg/i6AqK+P\n\tFPi/QItUXfzHXt6aKstDoSJ/y8Kufect10J7G25wRQ/oIqpqg6lLQ7uTvqNvTpeWRr+P\n\t4B2B2pv2F1BZg9dTtBIvkpiS8eLmn0m3VGD2GbXHRiWzGmP2VgD4H4yutJQINq+dhVEc\n\ttfVNDsZ6W+wqHjq61CecZox/uAar+w+PyYf6SWxpyjJMaEmFouZaAwSPfxJxDU35T41w\n\tkZsQ==","X-Gm-Message-State":"AHPjjUgHnp0ELwGnk9azYtjhhvxMFQzsE7b/yJ3Qdj70XtMMglm/+NlQ\n\tMxPajDclfNasOw==","X-Google-Smtp-Source":"ADKCNb4CNffMaIURd4erodcXOllGcXqXXLOjsIbUjvJzqRl564HVxoIq9RdxTJtG/4OCZ9DAKMDB/Q==","X-Received":"by 10.55.93.67 with SMTP id r64mr3900288qkb.358.1504294195299;\n\tFri, 01 Sep 2017 12:29:55 -0700 (PDT)","To":"Fam Zheng <famz@redhat.com>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<c751fc1d-602a-25ed-edb9-84ccdaeb2ecb@amsat.org>\n\t<20170830033445.GE4208@lemon.lan>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Message-ID":"<02eb8166-d0a4-a0e9-ec82-bc45a3626fd1@amsat.org>","Date":"Fri, 1 Sep 2017 16:29:50 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170830033445.GE4208@lemon.lan>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c09::244","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Kamil\n\tRytarowski <kamil@netbsd.org>, stefanha@redhat.com, Cleber Rosa\n\t<crosa@redhat.com>, pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1762086,"web_url":"http://patchwork.ozlabs.org/comment/1762086/","msgid":"<20170902050542.GC5845@lemon.lan>","list_archive_url":null,"date":"2017-09-02T05:05:42","subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Fri, 09/01 16:29, Philippe Mathieu-Daudé wrote:\n> On 08/30/2017 12:34 AM, Fam Zheng wrote:\n> > On Tue, 08/29 14:34, Philippe Mathieu-Daudé wrote:\n> > > > +        self._args = [ \\\n> > > > +            \"-nodefaults\", \"-m\", \"2G\",\n> > > > +            \"-cpu\", \"host\",\n> > > > +            \"-netdev\", \"user,id=vnet,hostfwd=:0.0.0.0:0-:22\",\n> > > > +            \"-device\", \"virtio-net-pci,netdev=vnet\",\n> > > > +            \"-vnc\", \":0,to=20\",\n> > > > +            \"-serial\", \"file:%s\" % os.path.join(self._tmpdir, \"serial.out\")]\n> > > > +        if vcpus:\n> > > > +            self._args += [\"-smp\", str(vcpus)]\n> > > \n> > > What about enabling mttcg which isn't default?\n> > > \n> > >              self._args += [\"--accel\", \"tcg,thread=multi\"]\n> > \n> > Any specific reason to enable it? I think it is not available on older QEMU.\n> \n> Neither is dynamic portfwd :)\n\nI figured, but portfwd is strongly justified, whereas ...\n\n> \n> I see 2 reasons:\n> - faster test\n\nAny data? And if it is noticably faster, I doubt anyone is going to actually use\nit, because it probably take a whole day to run one build.\n\n> - cover mttcg\n\nTesting mttcg is good, but we don't want to test mttcg and building at the same\ntime. Again, it can take a whole day.\n\nBut anyway --accel and any other options should be possible to get passed as\ncommand line options.\n\nFam\n\n> \n> > \n> > > \n> > > > +        if os.access(\"/dev/kvm\", os.R_OK | os.W_OK):\n> > > > +            self._args += [\"-enable-kvm\"]\n> > > > +        else:\n> > > > +            logging.info(\"KVM not available, not using -enable-kvm\")\n> > > > +        self._data_args = []\n> > > [...]\n> > \n> > Fam\n> > \n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkkbf3rm2z9s4q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  2 Sep 2017 15:06:20 +1000 (AEST)","from localhost ([::1]:52205 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1do0dN-0000bN-KI\n\tfor incoming@patchwork.ozlabs.org; Sat, 02 Sep 2017 01:06:17 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39728)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1do0d0-0000Xp-19\n\tfor qemu-devel@nongnu.org; Sat, 02 Sep 2017 01:05:58 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1do0cv-0007pI-2K\n\tfor qemu-devel@nongnu.org; Sat, 02 Sep 2017 01:05:54 -0400","from mx1.redhat.com ([209.132.183.28]:51664)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1do0cu-0007oV-Ru\n\tfor qemu-devel@nongnu.org; Sat, 02 Sep 2017 01:05:48 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 7FEE7806BF;\n\tSat,  2 Sep 2017 05:05:47 +0000 (UTC)","from localhost (ovpn-12-25.pek2.redhat.com [10.72.12.25])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id ECA4769FBE;\n\tSat,  2 Sep 2017 05:05:43 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 7FEE7806BF","Date":"Sat, 2 Sep 2017 13:05:42 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Philippe =?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>","Message-ID":"<20170902050542.GC5845@lemon.lan>","References":"<20170828174707.20786-1-famz@redhat.com>\n\t<20170828174707.20786-4-famz@redhat.com>\n\t<c751fc1d-602a-25ed-edb9-84ccdaeb2ecb@amsat.org>\n\t<20170830033445.GE4208@lemon.lan>\n\t<02eb8166-d0a4-a0e9-ec82-bc45a3626fd1@amsat.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<02eb8166-d0a4-a0e9-ec82-bc45a3626fd1@amsat.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tSat, 02 Sep 2017 05:05:47 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v4 03/10] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Kamil\n\tRytarowski <kamil@netbsd.org>, stefanha@redhat.com, Cleber Rosa\n\t<crosa@redhat.com>, pbonzini@redhat.com, Alex =?iso-8859-1?q?Benn=E9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]