From nobody Sun May 5 04:51:13 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.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542741045593692.0142212720621; Tue, 20 Nov 2018 11:10:45 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 364ED3082B45; Tue, 20 Nov 2018 19:10:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E4C18600C3; Tue, 20 Nov 2018 19:10:42 +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 39CB8180613A; Tue, 20 Nov 2018 19:10:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAKJAeAU006632 for ; Tue, 20 Nov 2018 14:10:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4A59718E5E; Tue, 20 Nov 2018 19:10:40 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 420106A6A4 for ; Tue, 20 Nov 2018 19:10:37 +0000 (UTC) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6BB3B8830E for ; Tue, 20 Nov 2018 19:10:36 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id w7-v6so3192245wmc.1 for ; Tue, 20 Nov 2018 11:10:36 -0800 (PST) Received: from rst.wireless.abdn.ac.uk (oa-edu-155-75.wireless.abdn.ac.uk. [137.50.155.75]) by smtp.gmail.com with ESMTPSA id j33sm10287770wre.91.2018.11.20.11.10.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 11:10:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qjsn6JNmJ74tzrprVAN/UVaI8qvgkEcWoDO2E5RBO8U=; b=Hc03La49qzFO5QHrqrPO9nOshSrSEqdD6v9CRijEAkrpGDNBKkzhDefTQAym2VkxHu 2EYoAo/yFGlkBeElekcIWB+id4e1KHVCAAnUrPOIZrvIImN9++mRiRdIjGJiuaQLsLyd Oc/BGqVqMdFQmsh2L+0KM484Ytvl3K83rC4bQS0a6ankTIolKGg99Y64oTiynFPGQwtm 3+LP7nvFjbnDMU7e6lI1tj5fKIA0jiEcb4nigDol3da9igsdAYLp4k1czD236mKuh7Gg M0sCqTfY0zTFZUntS5unYvN2HFPFDQacQqNjKzY2mFvQul3Puoiep1sXWnhcfZRaoPmJ mJeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qjsn6JNmJ74tzrprVAN/UVaI8qvgkEcWoDO2E5RBO8U=; b=SH8HMET1+oaSY9O0P1dpZlr46P7ZdUfdoRf089IXO3KsQUZyepiGH+mgwY4rW2JN+6 So5druafHQleeOok4dUsrU3rFHr9veawzuYyohLVF1HIjdGf/aOmMHscuOanP4BbqXSb zI35pDWSY/T5D49bHYmwb45jy3+W+tbTvI1FWFS1H8S7oEAeEb5X7PV0gK99XrLP80Wn 4fBqrRjX1DcXEWwBwAMhCpq4Njti8lSFJlwr0ShQ13O73LBxaDcDDu72BB1deHxpDMv9 eFtF/Lf7NzNaOMNWzr+mcqRdVrs78lb7yKpVHjjDtFUJaf/clzgcCk0F+rtDNtxfxlyh ljkA== X-Gm-Message-State: AGRZ1gKGMPEQgqTsUNcX4M/hpv/fJ/ksld+EzR1pU5wxIO/q1A0DKdBo MOCU6eqdsbOtp3o53oPtAU3+dp+k X-Google-Smtp-Source: AJdET5dLzfq5GNSfDzHwhHX2w7u2TvKJUBuh2cOLlE+dCtL1tuRsG/GXYJHrRPs4oGwOgBDKZg+r6g== X-Received: by 2002:a7b:cb86:: with SMTP id m6mr3272361wmi.61.1542741034692; Tue, 20 Nov 2018 11:10:34 -0800 (PST) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Nov 2018 19:10:19 +0000 Message-Id: <20181120191020.13564-2-rstoyanov1@gmail.com> In-Reply-To: <20181120191020.13564-1-rstoyanov1@gmail.com> References: <20181120191020.13564-1-rstoyanov1@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 20 Nov 2018 19:10:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 20 Nov 2018 19:10:36 +0000 (UTC) for IP:'209.85.128.68' DOMAIN:'mail-wm1-f68.google.com' HELO:'mail-wm1-f68.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.68 mail-wm1-f68.google.com 209.85.128.68 mail-wm1-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [sandbox PATCH 1/2] builder: Use prefix '=> /' to identify lib 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: , MIME-Version: 1.0 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 20 Nov 2018 19:10:44 +0000 (UTC) X-ZohoMail-DKIM: fail (Computed bodyhash is different from the expected one) Content-Type: text/plain; charset="utf-8" The output of ldd might contain a fully qualified path on the left hand side of the '=3D>'. For example: (glibc 2.28) $ ldd /usr/libexec/libvirt-sandbox-init-common | grep ld /lib64/ld-linux-x86-64.so.2 =3D> /usr/lib64/ld-linux-x86-64.so.2 (0x000= 07fcdceb96000) (glibc 2.27) $ ldd /usr/libexec/libvirt-sandbox-init-common | grep ld /lib64/ld-linux-x86-64.so.2 (0x00007f18135eb000) Signed-off-by: Radostin Stoyanov Reviewed-by: Daniel P. Berrang=C3=A9 --- libvirt-sandbox/libvirt-sandbox-builder.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libvirt-sandbox/libvirt-sandbox-builder.c b/libvirt-sandbox/li= bvirt-sandbox-builder.c index 8cfc2f4..7058112 100644 --- a/libvirt-sandbox/libvirt-sandbox-builder.c +++ b/libvirt-sandbox/libvirt-sandbox-builder.c @@ -297,7 +297,7 @@ static gboolean gvir_sandbox_builder_copy_program(const= char *program, /* Loop over the output lines to get the path to the libraries to copy= */ line =3D out; while ((tmp =3D strchr(line, '\n'))) { - gchar *start, *end; + gchar *start, *end, *tmp2; *tmp =3D '\0'; =20 /* Search the line for the library path */ @@ -308,22 +308,20 @@ static gboolean gvir_sandbox_builder_copy_program(con= st char *program, const gchar *newname =3D NULL; *end =3D '\0'; =20 + if ((tmp2 =3D strstr(start, "=3D> "))) + start =3D tmp2 + 3; + /* There are countless different naming schemes for * the ld-linux.so library across architectures. Pretty * much the only thing in common is they start with - * the two letters 'ld'. The LDD program prints it - * out differently too - it doesn't include " =3D> " - * as this library is special - its actually a static - * linked executable not a library. + * the two letters 'ld'. * * To make life easier for libvirt-sandbox-init-{qemu,lxc} * we just call the file 'ld.so' when we copy it into our * scratch dir, no matter what it was called on the host. */ - if (!strstr(line, " =3D> ") && - strstr(start, "/ld")) { + if (strstr(start, "/ld")) newname =3D "ld.so"; - } =20 if (!gvir_sandbox_builder_copy_file(start, dest, newname, erro= r)) goto cleanup; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 04:51:13 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.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542741051085530.0060945886344; Tue, 20 Nov 2018 11:10:51 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D888D308FB99; Tue, 20 Nov 2018 19:10:48 +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 A483B601A6; Tue, 20 Nov 2018 19:10:48 +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 5A77B3F602; Tue, 20 Nov 2018 19:10:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAKJAhNR006662 for ; Tue, 20 Nov 2018 14:10:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8F28560151; Tue, 20 Nov 2018 19:10:43 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85145601A6 for ; Tue, 20 Nov 2018 19:10:38 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 036872D7F9 for ; Tue, 20 Nov 2018 19:10:38 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id q26so3373087wmf.5 for ; Tue, 20 Nov 2018 11:10:37 -0800 (PST) Received: from rst.wireless.abdn.ac.uk (oa-edu-155-75.wireless.abdn.ac.uk. [137.50.155.75]) by smtp.gmail.com with ESMTPSA id j33sm10287770wre.91.2018.11.20.11.10.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 11:10:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7OW3UT7UsRR9YyFwAxwPxENWR197TN8hoi5NrpfFj8o=; b=p/N6VqZ6Suk/CDg+N1D78xuzFCNRSY4eJtL2eTb+ioXUDal+43nfgbt6qlmyuL+Jpz 50sqS0FewsGBqrhZDkwUJyZ52bBFvEgD+RkA4dD05P/xa0bmyspDwKEiGg0brhrix870 5t1MMOI8LVc7fw7zgjx3U/3uYxjSQblpYDeGRaRASHTvOnXHHS4PlxIyxZGe2kZ3yjsv Kx0GuT1Qea8Qi8rvphnw5P0i7k59RcsTF0vNL68jH1lGOX8/J3qzwfEUS60vNfkImfvd TLg+mOjfyUhv7EnCg0TFaDpAoBwr9NFi4nWnmNKfNI4CWQmG+9nxOU/1TNxStz+5IATx vs7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7OW3UT7UsRR9YyFwAxwPxENWR197TN8hoi5NrpfFj8o=; b=Iu2dC64JbEO/Argqw0Yp7YN2z19VBd2ypf0JTS5FKpEm26N8UR/Sr0QExSi5GfPfOH qTJ7yzKRLQGFPUD3hnz3jcxuF30mLlHSqhn5Qhn+m5H9U4dAt+pCUqmoGi7REeT1/TDr +/WeSQLIbgOb4V9cSjRGRgYtr1EWdW2eD93NfdYf7y7zwZPVAADL1tIJpHvRpuQtNOlD 5O57c31oviCx0XO+I7VdOJiQ5UAPQg/QR5nuV2/VLNiPHOl784UMOViJFtfslmoXU8MS 0XroqG0U7QcGH8ldWd3WWTgyTw/jHL/WkogycNUMM+H7sEJvLsShxOIs75R0tV3UvI1U 8Lnw== X-Gm-Message-State: AA+aEWbNCA6YrTz2TNClQI/L+t8bDdpsfk3mhGJ5UqM+fiotBcPpF8mE VnblaY1CNI3w6B0nwqhpEBnEFVMT X-Google-Smtp-Source: AJdET5eNTesBaa+5rUUDYtriZtAhDryfKDPVTT+H6uQCOyNHiD2vGk53orjIlO4KTuiB9+1bHzyUvQ== X-Received: by 2002:a1c:a05:: with SMTP id 5mr3124392wmk.49.1542741036281; Tue, 20 Nov 2018 11:10:36 -0800 (PST) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Nov 2018 19:10:20 +0000 Message-Id: <20181120191020.13564-3-rstoyanov1@gmail.com> In-Reply-To: <20181120191020.13564-1-rstoyanov1@gmail.com> References: <20181120191020.13564-1-rstoyanov1@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 20 Nov 2018 19:10:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 20 Nov 2018 19:10:38 +0000 (UTC) for IP:'209.85.128.66' DOMAIN:'mail-wm1-f66.google.com' HELO:'mail-wm1-f66.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.66 mail-wm1-f66.google.com 209.85.128.66 mail-wm1-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [sandbox PATCH 2/2] Use "/boot/vmlinuz-linux" as default kernel 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: , MIME-Version: 1.0 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 20 Nov 2018 19:10:49 +0000 (UTC) X-ZohoMail-DKIM: fail (Computed bodyhash is different from the expected one) Content-Type: text/plain; charset="utf-8" On some linux distributions "/boot/vmlinuz-linux" is set as default kernel path. If this file does not exist we fallback to the value "/boot/vmlinuz-$KERNEL-VERSION" Signed-off-by: Radostin Stoyanov --- bin/virt-sandbox.c | 5 +++-- libvirt-sandbox/libvirt-sandbox-builder-machine.c | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/virt-sandbox.c b/bin/virt-sandbox.c index 6032562..930b85e 100644 --- a/bin/virt-sandbox.c +++ b/bin/virt-sandbox.c @@ -553,8 +553,9 @@ omitted, defaults to match the current running host ver= sion. =20 =3Ditem B<--kernpath=3DFILE-PATH> =20 -Specify the path to the kernel binary. If omitted, defaults -to C. +Specify the path to the kernel binary. If omitted, defaults to +C if exists, otherwise +C will be used. =20 =3Ditem B<--kmodpath=3DDIR-PATH> =20 diff --git a/libvirt-sandbox/libvirt-sandbox-builder-machine.c b/libvirt-sa= ndbox/libvirt-sandbox-builder-machine.c index a4a5dcd..2c305a7 100644 --- a/libvirt-sandbox/libvirt-sandbox-builder-machine.c +++ b/libvirt-sandbox/libvirt-sandbox-builder-machine.c @@ -133,11 +133,15 @@ static gchar *gvir_sandbox_builder_machine_get_kernre= lease(GVirSandboxConfig *co static gchar *gvir_sandbox_builder_machine_get_kernpath(GVirSandboxConfig = *config) { const gchar *kernpath =3D gvir_sandbox_config_get_kernpath(config); + const gchar *default_kernpath =3D "/boot/vmlinuz-linux"; gchar *kver; gchar *ret; if (kernpath) return g_strdup(kernpath); =20 + if (access(default_kernpath, F_OK ) !=3D -1) + return g_strdup(default_kernpath); + kver =3D gvir_sandbox_builder_machine_get_kernrelease(config); ret =3D g_strdup_printf("/boot/vmlinuz-%s", kver); g_free(kver); --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list