From nobody Sat Apr 27 19:39:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1495902597511336.1387122110483; Sat, 27 May 2017 09:29:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D1F5C04B31F; Sat, 27 May 2017 16:29:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A358B179C2; Sat, 27 May 2017 16:29:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B5E444BB7F; Sat, 27 May 2017 16:29:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v4RGTe2h000565 for ; Sat, 27 May 2017 12:29:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 76C147E68D; Sat, 27 May 2017 16:29:40 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 710671716A for ; Sat, 27 May 2017 16:29:38 +0000 (UTC) Received: from photon.sigxcpu.org (photon.sigxcpu.org [95.142.169.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B2934E4C4 for ; Sat, 27 May 2017 16:29:36 +0000 (UTC) Received: from honk.sigxcpu.org (localhost [127.0.0.1]) by photon.sigxcpu.org (Postfix) with ESMTPS id DA9975B4 for ; Sat, 27 May 2017 18:29:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 7D0B8FB03 for ; Sat, 27 May 2017 18:29:34 +0200 (CEST) Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id urQCESd25yww for ; Sat, 27 May 2017 18:29:33 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 7C19840C7B; Sat, 27 May 2017 18:29:32 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4D1F5C04B31F Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=sigxcpu.org Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4D1F5C04B31F DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7B2934E4C4 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=sigxcpu.org Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=agx@sigxcpu.org DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7B2934E4C4 X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Date: Sat, 27 May 2017 18:29:32 +0200 From: Guido =?iso-8859-1?Q?G=FCnther?= To: libvir-list@redhat.com Message-ID: <20170527162932.tduxhdxhd6loqp2t@bogon.m.sigxcpu.org> Mail-Followup-To: Guido =?iso-8859-1?Q?G=FCnther?= , libvir-list@redhat.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) X-Greylist: Delayed for 05:24:36 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 27 May 2017 16:29:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 27 May 2017 16:29:37 +0000 (UTC) for IP:'95.142.169.183' DOMAIN:'photon.sigxcpu.org' HELO:'photon.sigxcpu.org' FROM:'agx@sigxcpu.org' RCPT:'' X-RedHat-Spam-Score: 0.799 (BAYES_50, RP_MATCHES_RCVD) 95.142.169.183 photon.sigxcpu.org 95.142.169.183 photon.sigxcpu.org X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [libvirt-sandbox PATCH] Drop library/ from template name and image path X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 27 May 2017 16:29:55 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If one pastes from the output of virt-sansbox-image $ virt-sandbox-image list docker:/library/ubuntu?tag=3D17.04 docker:/library/debian?tag=3Dlatest verbatim $ virt-sandbox-image run -c qemu:///session docker:/library/debian?tag=3D= latest This fails like /home//.local/share/libvirt/images/library/debian:qbeilwxard.qcow2: = Could not create file: No such file or directory Unable to start sandbox: Failed to create domain: XML error: name library= /debian:qbeilwxard cannot contain '/' /usr/bin/virt-sandbox-image: [Errno 2] No such file or directory: '/home/= /.local/share/libvirt/images/library/debian:qbeilwxard.qcow2' so strip of any leading components. --- This might not be the correct fix but I hope you get the idea. libvirt-sandbox/image/cli.py | 2 +- libvirt-sandbox/image/sources/docker.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt-sandbox/image/cli.py b/libvirt-sandbox/image/cli.py index 3a5ccfa..0f27a16 100644 --- a/libvirt-sandbox/image/cli.py +++ b/libvirt-sandbox/image/cli.py @@ -96,7 +96,7 @@ def run(args): name =3D args.name if name is None: randomid =3D ''.join(random.choice(string.lowercase) for i in rang= e(10)) - name =3D tmpl.path[1:] + ":" + randomid + name =3D tmpl.path[1:].split('/')[-1] + ":" + randomid =20 diskfile =3D source.get_disk(template=3Dtmpl, templatedir=3Dtemplate_dir, diff --git a/libvirt-sandbox/image/sources/docker.py b/libvirt-sandbox/imag= e/sources/docker.py index aa5675e..6ca086c 100755 --- a/libvirt-sandbox/image/sources/docker.py +++ b/libvirt-sandbox/image/sources/docker.py @@ -655,7 +655,7 @@ class DockerSource(base.Source): def get_disk(self, template, templatedir, imagedir, sandboxname): image =3D DockerImage.from_template(template) configfile, diskfile =3D self._get_template_data(image, templatedi= r) - tempfile =3D imagedir + "/" + sandboxname + ".qcow2" + tempfile =3D imagedir + "/" + sandboxname.split('/')[-1] + ".qcow2" if not os.path.exists(imagedir): os.makedirs(imagedir) cmd =3D ["qemu-img","create","-q","-f","qcow2"] --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list