From nobody Thu Apr 25 05:35:48 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 1541444671629187.38085742934356; Mon, 5 Nov 2018 11:04:31 -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 2184F81DF0; Mon, 5 Nov 2018 19:04:29 +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 D2BF36012C; Mon, 5 Nov 2018 19:04:27 +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 EF1FF4BB79; Mon, 5 Nov 2018 19:04:23 +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 wA5Ivocr029711 for ; Mon, 5 Nov 2018 13:57:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9B5995D75C; Mon, 5 Nov 2018 18:57:50 +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 921F75D759 for ; Mon, 5 Nov 2018 18:57:46 +0000 (UTC) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (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 9F3682D7FB for ; Mon, 5 Nov 2018 18:57:44 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id u68so16658103qkg.9 for ; Mon, 05 Nov 2018 10:57:44 -0800 (PST) Received: from localhost.localdomain ([177.45.6.151]) by smtp.gmail.com with ESMTPSA id x141-v6sm18361564qka.9.2018.11.05.10.57.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 10:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=1qkdzMkCSXvft+GdzmqXf08JZk1SB+lwm6MzRVKc4cc=; b=SMG5VSG6GAlLZpIysVphlbbsEk+A4dk8QlV+d0tdjlVrQ0c7EELQWkkHHuS+vbOb0Y 2wLe/N9Nnx1abhUqe08UWZrULeTgfjlppV9j91vhUc1fKOGb9b5iuGczS7jngFkEADdm MbVp9mhijq8YJ49oudF5PQhHBZmkIW8Z6eMeaXvz7fxErhoptWRIrleljICuagp4PDK5 /HjpUg+mfevtI0TwDX54hEL4LJasBk2pHsElLYprjJG+0nM6dpJG3jMpuwWdn+T+kmxI ou1jhzNf99JASK/gOV9JU4DMik17hHuIWeDZcbxiOfQQVG7uNBlwfomNJg9yBdrSodRS sBvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=1qkdzMkCSXvft+GdzmqXf08JZk1SB+lwm6MzRVKc4cc=; b=uMagtKyjuSMwtpT5ikbQIrJPd5fkGBrVJ9S47tRt04189044XG/iGxSRGX9oYNMTKb 9EDBe1HnBCVMBKA0hrnwriRpdPtah8+e3dJa11VdDJY98aGZfYzxAu0Eoenusi0K77+q u+2ZVC0G36EcDToyDOmOK0PgtgaMXgbvQlGgRdMQMtynosyO99S4i1gmbIVMgUe0mhYc zDsq+2HO7BhN+fJDh8qYIcW5kuIrt+g5BKvAgrQ6ZOgFTfwczmsV3AzisABoxkZSAe8w jZbbI19wQvzGkD8SEUMZUtPTEstSb1o4lo1Hzu617/YND8LrrSgdGM95lJM7nGe+V++A m+wQ== X-Gm-Message-State: AGRZ1gJSAVmexQl5QMlJI+iKUkuS3Ueqo9vjuhz1JnbuqH/6gFwpY+50 XTk5QQucsYnTf/L82tC/8I0KEYzn X-Google-Smtp-Source: AJdET5eDjLvjvsRAmkiYbPA6fhWqPoERSeIbULqimrMVMXJZhX2DQw4gl86FY85q/EUubZT5sbo0qA== X-Received: by 2002:a37:2a48:: with SMTP id q69mr21060210qkh.287.1541444263359; Mon, 05 Nov 2018 10:57:43 -0800 (PST) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 5 Nov 2018 16:57:24 -0200 Message-Id: <20181105185724.31412-1-jcfaracco@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 05 Nov 2018 18:57:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 05 Nov 2018 18:57:44 +0000 (UTC) for IP:'209.85.222.193' DOMAIN:'mail-qk1-f193.google.com' HELO:'mail-qk1-f193.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.193 mail-qk1-f193.google.com 209.85.222.193 mail-qk1-f193.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2] lxc: Include support to lxc version 3.0 or higher. 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.25]); Mon, 05 Nov 2018 19:04:30 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This patch introduce the new settings for LXC 3.0 or higher. The older versions keep the compatibility to deprecated settings for LXC, but after release 3.0, the compatibility was removed. This commit adds the support to the refactored settings. Signed-off-by: Julio Faracco --- src/lxc/lxc_native.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index cbdec723dd..8604cbaf46 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -200,7 +200,9 @@ lxcSetRootfs(virDomainDefPtr def, int type =3D VIR_DOMAIN_FS_TYPE_MOUNT; VIR_AUTOFREE(char *) value =3D NULL; =20 - if (virConfGetValueString(properties, "lxc.rootfs", &value) <=3D 0) + if (virConfGetValueString(properties, "lxc.rootfs", &value) <=3D 0 && + /* Legacy config keys were removed after release 3.0. */ + virConfGetValueString(properties, "lxc.rootfs.path", &value) <=3D = 0) return -1; =20 if (STRPREFIX(value, "/dev/")) @@ -684,7 +686,9 @@ lxcCreateConsoles(virDomainDefPtr def, virConfPtr prope= rties) virDomainChrDefPtr console; size_t i; =20 - if (virConfGetValueString(properties, "lxc.tty", &value) <=3D 0) + if (virConfGetValueString(properties, "lxc.tty", &value) <=3D 0 && + /* Legacy config keys were removed after release 3.0. */ + virConfGetValueString(properties, "lxc.tty.max", &value) <=3D 0) return 0; =20 if (virStrToLong_i(value, NULL, 10, &nbttys) < 0) { @@ -724,7 +728,7 @@ lxcIdmapWalkCallback(const char *name, virConfValuePtr = value, void *data) char type; unsigned long start, target, count; =20 - if (STRNEQ(name, "lxc.id_map") || !value->str) + if (STRNEQ(name, "lxc.id_map") || STRNEQ(name, "lxc.idmap") || !value-= >str) return 0; =20 if (sscanf(value->str, "%c %lu %lu %lu", &type, @@ -1041,7 +1045,9 @@ lxcParseConfigString(const char *config, if (VIR_STRDUP(vmdef->os.init, "/sbin/init") < 0) goto error; =20 - if (virConfGetValueString(properties, "lxc.utsname", &value) <=3D 0 || + if ((virConfGetValueString(properties, "lxc.utsname", &value) <=3D 0 && + /* Legacy config keys were removed after release 3.0. */ + virConfGetValueString(properties, "lxc.uts.name", &value) <=3D 0)= || VIR_STRDUP(vmdef->name, value) < 0) goto error; if (!vmdef->name && (VIR_STRDUP(vmdef->name, "unnamed") < 0)) @@ -1051,7 +1057,9 @@ lxcParseConfigString(const char *config, goto error; =20 /* Look for fstab: we shouldn't have it */ - if (virConfGetValue(properties, "lxc.mount")) { + if (virConfGetValue(properties, "lxc.mount") || + /* Legacy config keys were removed after release 3.0. */ + virConfGetValue(properties, "lxc.mount.fstab")) { virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", _("lxc.mount found, use lxc.mount.entry lines inste= ad")); goto error; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list