From nobody Sat Apr 20 08:38:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1572407008; cv=none; d=zoho.com; s=zohoarc; b=f8Y+jG7C/yGXSuZ9nXjrUPxKSy6bhv03SwERWKCb6qyK6xg8Ru9Vb4JgG5iQ43TFhQNkzoTsAB7OPaCy5H+fF/NKqke39pl3is7UiHSRtJWgaDlY8aNJrdv/eXvkSd+fu/f7dKlU63TcH1DNjlEgRX4nTRXZAX+tu3im8GjjAfI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572407008; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=D6M7CxCtY7xMj7onWimG+dkutn4ygSNGTS3mAf80Aow=; b=Q9JkulId2LeHDgvkyAWwiKMGycjsCPysdWe7uIO7S3FP1d/73rrV0+D87UCyaYZOXyuBKG902Kasb9YlP72QfopgyN7zaY+dyFgU/ZI8/FKeUuAqs0IXeG7M8JLahak+N8b+vl1l9kAGMoWXGDq3QIZ5QQu96E9TPPPH4k7Ycc0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1572407008117150.701954766511; Tue, 29 Oct 2019 20:43:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-127-LwhibuXnP-un5rVVh3SLJg-1; Tue, 29 Oct 2019 23:43:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B3A391005509; Wed, 30 Oct 2019 03:43:19 +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 7C8355D6D2; Wed, 30 Oct 2019 03:43:19 +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 4226218089C8; Wed, 30 Oct 2019 03:43:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9U3hDRO031005 for ; Tue, 29 Oct 2019 23:43:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id A99C5196B2; Wed, 30 Oct 2019 03:43:13 +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 A3B6519D70 for ; Wed, 30 Oct 2019 03:43:11 +0000 (UTC) Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by mx1.redhat.com (Postfix) with ESMTP id 49F714E8B8 for ; Wed, 30 Oct 2019 03:42:47 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app02-12002 (RichMail) with SMTP id 2ee25db906a14e8-baa76; Wed, 30 Oct 2019 11:42:26 +0800 (CST) Received: from localhost.localdomain (unknown[112.25.154.149]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95db9069cb4a-0e0ce; Wed, 30 Oct 2019 11:42:26 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572407006; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=D6M7CxCtY7xMj7onWimG+dkutn4ygSNGTS3mAf80Aow=; b=gDtmCPIbyKNx+/nDH61kgse7VRBWwY8ZvwKq5+7sGaC18WOYsltrgBlUvurfCIm81mHlem NLKhf27empSGixmGC0h6u4rprKFdMD+SzuSgT3fkdcSessqYD26utCeiMTumRKUgiKGPZH pHfGV1LmD7QbIJXnrZ8T0TB30g8f05o= X-RM-TRANSID: 2ee25db906a14e8-baa76 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee95db9069cb4a-0e0ce From: Mao Zhongyi To: libvir-list@redhat.com Date: Wed, 30 Oct 2019 11:42:10 +0800 Message-Id: <20191030034213.2888382-2-maozhongyi@cmss.chinamobile.com> In-Reply-To: <20191030034213.2888382-1-maozhongyi@cmss.chinamobile.com> References: <20191030034213.2888382-1-maozhongyi@cmss.chinamobile.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 30 Oct 2019 03:42:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 30 Oct 2019 03:42:58 +0000 (UTC) for IP:'221.176.66.79' DOMAIN:'cmccmta1.chinamobile.com' HELO:'cmccmta1.chinamobile.com' FROM:'maozhongyi@cmss.chinamobile.com' RCPT:'' X-RedHat-Spam-Score: -0.698 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE) 221.176.66.79 cmccmta1.chinamobile.com 221.176.66.79 cmccmta1.chinamobile.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Zhang Shengju , Mao Zhongyi Subject: [libvirt] [PATCH 1/4] lxc: remove duplicate header files 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: LwhibuXnP-un5rVVh3SLJg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" "#include vircgroup.h" appears in both lxc_cgroup.h and lxc_cgroup.c, and lxc_cgroup.c contains lxc_cgroup.h, so remove the duplicate declarations. Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: J=C3=A1n Tomko --- src/lxc/lxc_cgroup.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index 5efb495b56..0a019dc813 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -27,7 +27,6 @@ #include "virerror.h" #include "virlog.h" #include "viralloc.h" -#include "vircgroup.h" #include "virstring.h" #include "virsystemd.h" =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 08:38:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1572407008; cv=none; d=zoho.com; s=zohoarc; b=Apdw4XF2KZ5PrSRw/NgCtQMrJUaAvvX0+DQm6f440hioc+4TT38dAoFoSdss8tnvVINN2cwSqfQKOOxIBTiEYsLJMiKqwLuyfXL7ky9YgAsAqcTa96ngdBkaQJFjIOQz82F1w7xamMPwXZsoxo72zMvgAXnksmhCLd0O9vPztV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572407008; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fp0YAASXjgFnwEPGVsQdCmhqAv1RYqe9FtIV+KENDOU=; b=bmK1rNSmyVn7y/XGrOoVGU/hrW/z5DEnvJG2fdiHsYSW8Ojg3DB4c1b0tQQHcdZgULTGnnCRh+Jqrf9fzTCzML8E/tSlHthnLKx7IoenTCkl07+bJKxuCYy0LqENJacIB231CsQnOVkUL5LFh9snwq5VV1sMgmqflkJ2An6T1Nk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1572407008052399.8003210975086; Tue, 29 Oct 2019 20:43:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-29-lvf__0fXNVqW7hA3iU567w-1; Tue, 29 Oct 2019 23:43:24 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F63980183D; Wed, 30 Oct 2019 03:43:19 +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 46A531001B07; Wed, 30 Oct 2019 03:43:19 +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 DBF654A486; Wed, 30 Oct 2019 03:43:18 +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 x9U3hCiU030999 for ; Tue, 29 Oct 2019 23:43:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id CEBD15D6D2; Wed, 30 Oct 2019 03:43:12 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9CCB5D6D0 for ; Wed, 30 Oct 2019 03:43:10 +0000 (UTC) Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by mx1.redhat.com (Postfix) with ESMTP id 53EB4307D88C for ; Wed, 30 Oct 2019 03:42:47 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app02-12002 (RichMail) with SMTP id 2ee25db906a34ea-baa78; Wed, 30 Oct 2019 11:42:27 +0800 (CST) Received: from localhost.localdomain (unknown[112.25.154.149]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95db9069cb4a-0e0cf; Wed, 30 Oct 2019 11:42:27 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572407007; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fp0YAASXjgFnwEPGVsQdCmhqAv1RYqe9FtIV+KENDOU=; b=N2z6Tlm7olyB/PWhEkv3EYK0IHNJjIv+L3SLn00xXYeN1Nlqysr/hNFKGl6bAI51K9XVD3 D+0XuSycAluxlirX0nAqRkZCuhaHoP5hhoW5CwzaA2tVTJ6uPAxB5rtFR6rWBo3qUX+/xi 20ZyOeL6xAtzXo6b79peul5hZStGOSg= X-RM-TRANSID: 2ee25db906a34ea-baa78 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee95db9069cb4a-0e0cf From: Mao Zhongyi To: libvir-list@redhat.com Date: Wed, 30 Oct 2019 11:42:11 +0800 Message-Id: <20191030034213.2888382-3-maozhongyi@cmss.chinamobile.com> In-Reply-To: <20191030034213.2888382-1-maozhongyi@cmss.chinamobile.com> References: <20191030034213.2888382-1-maozhongyi@cmss.chinamobile.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 30 Oct 2019 03:43:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 30 Oct 2019 03:43:01 +0000 (UTC) for IP:'221.176.66.79' DOMAIN:'cmccmta1.chinamobile.com' HELO:'cmccmta1.chinamobile.com' FROM:'maozhongyi@cmss.chinamobile.com' RCPT:'' X-RedHat-Spam-Score: -0.699 (RCVD_IN_DNSWL_LOW, SPF_NONE) 221.176.66.79 cmccmta1.chinamobile.com 221.176.66.79 cmccmta1.chinamobile.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Zhang Shengju , Mao Zhongyi Subject: [libvirt] [PATCH 2/4] qemu: remove duplicate header files 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: lvf__0fXNVqW7hA3iU567w-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" "#include vircgroup.h" appears in both qemu_cgroup.h and qemu_cgroup.c, and qemu_cgroup.c contains qemu_cgroup.h, so remove the duplicate declarations. Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_cgroup.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index f8bb270117..131cdd1134 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -25,7 +25,6 @@ #include "qemu_domain.h" #include "qemu_process.h" #include "qemu_extdevice.h" -#include "vircgroup.h" #include "virlog.h" #include "viralloc.h" #include "virerror.h" --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 08:38:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1572407024; cv=none; d=zoho.com; s=zohoarc; b=ApEu7d8lg106Lp0h2ZKzDirKzI496YbBXtcGKqJkpNU38aGhDC+UiEJfVTTnD7b4jwPxUb0zLvuAQfcM1hRmKjXUBPlM31XB1G9k7O9L/fFRTZutmvmsgVNFOXLsZKNsMlApGJVIL+1h0gMJBYxAg60TRiHraDaQ6dEds3+BMPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572407024; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VM0kusMbnOebSBM53QTZgQmG/2lCbsQceI9UZWuAcsc=; b=H7t6WHnAx+3qGrSQrsDO4Vt3qqQequmKXhCvpJV1xaNvjresDHkKEUiccWmlHVzmTV0h8o+OtwAwOzKHqFw7ymSxBBEG+cdIHStKskL8XNyiFQiAw8FXRYiYU1J0gPR306IGzDNyNv52EednmvJgUScc2IcU3j5PXnMAPFPvNsM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1572407024860732.1229252394819; Tue, 29 Oct 2019 20:43:44 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-60-CL92o1wgMJqmmxnLty7LBg-1; Tue, 29 Oct 2019 23:43:40 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E731A5F0; Wed, 30 Oct 2019 03:43:32 +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 BF3755D9C3; Wed, 30 Oct 2019 03:43:32 +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 7F81518089D6; Wed, 30 Oct 2019 03:43:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9U3hBeY030991 for ; Tue, 29 Oct 2019 23:43:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 240121001901; Wed, 30 Oct 2019 03:43:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx25.extmail.prod.ext.phx2.redhat.com [10.5.110.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F2961001B07 for ; Wed, 30 Oct 2019 03:43:08 +0000 (UTC) Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by mx1.redhat.com (Postfix) with ESMTP id EB76410C0922 for ; Wed, 30 Oct 2019 03:43:01 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app01-12001 (RichMail) with SMTP id 2ee15db906a5260-ba46c; Wed, 30 Oct 2019 11:42:29 +0800 (CST) Received: from localhost.localdomain (unknown[112.25.154.149]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95db9069cb4a-0e0d9; Wed, 30 Oct 2019 11:42:28 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572407023; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=VM0kusMbnOebSBM53QTZgQmG/2lCbsQceI9UZWuAcsc=; b=U3NwmS1v9d97TycNuUza2fLSCSAd2Tj1KMLEfGpeUOorZb/bRN6N4isM9qIZVw8SgEELhx a2uWL9yJWXKz0fRZZQPtrZJS9l6yOo5A8JWf7AmdVQ4eEfujdiK4xoeOWxTYz2efjF+Yzl JFpfiK/VYD80ZbkvvtEjiVmb6BgPRjc= X-RM-TRANSID: 2ee15db906a5260-ba46c X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee95db9069cb4a-0e0d9 From: Mao Zhongyi To: libvir-list@redhat.com Date: Wed, 30 Oct 2019 11:42:12 +0800 Message-Id: <20191030034213.2888382-4-maozhongyi@cmss.chinamobile.com> In-Reply-To: <20191030034213.2888382-1-maozhongyi@cmss.chinamobile.com> References: <20191030034213.2888382-1-maozhongyi@cmss.chinamobile.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Wed, 30 Oct 2019 03:43:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Wed, 30 Oct 2019 03:43:02 +0000 (UTC) for IP:'221.176.66.79' DOMAIN:'cmccmta1.chinamobile.com' HELO:'cmccmta1.chinamobile.com' FROM:'maozhongyi@cmss.chinamobile.com' RCPT:'' X-RedHat-Spam-Score: -0.699 (RCVD_IN_DNSWL_LOW, SPF_NONE) 221.176.66.79 cmccmta1.chinamobile.com 221.176.66.79 cmccmta1.chinamobile.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.66 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Zhang Shengju , Mao Zhongyi Subject: [libvirt] [PATCH 3/4] util: consolidate QEMU and LXC block io related duplicate code 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 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-MC-Unique: CL92o1wgMJqmmxnLty7LBg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Both qemu and lxc drivers have some duplicate code when dealing with cgroups, such as virLXCCgroupSetupBlkioTune() and qemuSetupBlkioCgroup(), duplicate code over 80, so consolidate the same chunk into a separate routine. Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- src/libvirt_private.syms | 1 + src/lxc/lxc_cgroup.c | 56 +----------------------------------- src/qemu/qemu_cgroup.c | 47 +------------------------------ src/util/vircgroup.c | 61 ++++++++++++++++++++++++++++++++++++++++ src/util/vircgroup.h | 3 ++ 5 files changed, 67 insertions(+), 101 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 94509d6f43..3df2af55bd 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1685,6 +1685,7 @@ virCgroupSetMemoryHardLimit; virCgroupSetMemorySoftLimit; virCgroupSetMemSwapHardLimit; virCgroupSetOwner; +virCgroupSetupBlkio; virCgroupSupportsCpuBW; virCgroupTerminateMachine; =20 diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index 0a019dc813..fdf8df79aa 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -102,60 +102,6 @@ static int virLXCCgroupSetupCpusetTune(virDomainDefPtr= def, } =20 =20 -static int virLXCCgroupSetupBlkioTune(virDomainDefPtr def, - virCgroupPtr cgroup) -{ - size_t i; - - if (def->blkio.weight && - virCgroupSetBlkioWeight(cgroup, def->blkio.weight) < 0) - return -1; - - if (def->blkio.ndevices) { - for (i =3D 0; i < def->blkio.ndevices; i++) { - virBlkioDevicePtr dev =3D &def->blkio.devices[i]; - - if (dev->weight && - (virCgroupSetBlkioDeviceWeight(cgroup, dev->path, - dev->weight) < 0 || - virCgroupGetBlkioDeviceWeight(cgroup, dev->path, - &dev->weight) < 0)) - return -1; - - if (dev->riops && - (virCgroupSetBlkioDeviceReadIops(cgroup, dev->path, - dev->riops) < 0 || - virCgroupGetBlkioDeviceReadIops(cgroup, dev->path, - &dev->riops) < 0)) - return -1; - - if (dev->wiops && - (virCgroupSetBlkioDeviceWriteIops(cgroup, dev->path, - dev->wiops) < 0 || - virCgroupGetBlkioDeviceWriteIops(cgroup, dev->path, - &dev->wiops) < 0)) - return -1; - - if (dev->rbps && - (virCgroupSetBlkioDeviceReadBps(cgroup, dev->path, - dev->rbps) < 0 || - virCgroupGetBlkioDeviceReadBps(cgroup, dev->path, - &dev->rbps) < 0)) - return -1; - - if (dev->wbps && - (virCgroupSetBlkioDeviceWriteBps(cgroup, dev->path, - dev->wbps) < 0 || - virCgroupGetBlkioDeviceWriteBps(cgroup, dev->path, - &dev->wbps) < 0)) - return -1; - } - } - - return 0; -} - - static int virLXCCgroupSetupMemTune(virDomainDefPtr def, virCgroupPtr cgroup) { @@ -489,7 +435,7 @@ int virLXCCgroupSetup(virDomainDefPtr def, if (virLXCCgroupSetupCpusetTune(def, cgroup, nodemask) < 0) goto cleanup; =20 - if (virLXCCgroupSetupBlkioTune(def, cgroup) < 0) + if (virCgroupSetupBlkio(cgroup, def) < 0) goto cleanup; =20 if (virLXCCgroupSetupMemTune(def, cgroup) < 0) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 131cdd1134..c9925ee5ca 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -521,7 +521,6 @@ static int qemuSetupBlkioCgroup(virDomainObjPtr vm) { qemuDomainObjPrivatePtr priv =3D vm->privateData; - size_t i; =20 if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_BLKIO)) { @@ -534,51 +533,7 @@ qemuSetupBlkioCgroup(virDomainObjPtr vm) } } =20 - if (vm->def->blkio.weight !=3D 0 && - virCgroupSetBlkioWeight(priv->cgroup, vm->def->blkio.weight) < 0) - return -1; - - if (vm->def->blkio.ndevices) { - for (i =3D 0; i < vm->def->blkio.ndevices; i++) { - virBlkioDevicePtr dev =3D &vm->def->blkio.devices[i]; - if (dev->weight && - (virCgroupSetBlkioDeviceWeight(priv->cgroup, dev->path, - dev->weight) < 0 || - virCgroupGetBlkioDeviceWeight(priv->cgroup, dev->path, - &dev->weight) < 0)) - return -1; - - if (dev->riops && - (virCgroupSetBlkioDeviceReadIops(priv->cgroup, dev->path, - dev->riops) < 0 || - virCgroupGetBlkioDeviceReadIops(priv->cgroup, dev->path, - &dev->riops) < 0)) - return -1; - - if (dev->wiops && - (virCgroupSetBlkioDeviceWriteIops(priv->cgroup, dev->path, - dev->wiops) < 0 || - virCgroupGetBlkioDeviceWriteIops(priv->cgroup, dev->path, - &dev->wiops) < 0)) - return -1; - - if (dev->rbps && - (virCgroupSetBlkioDeviceReadBps(priv->cgroup, dev->path, - dev->rbps) < 0 || - virCgroupGetBlkioDeviceReadBps(priv->cgroup, dev->path, - &dev->rbps) < 0)) - return -1; - - if (dev->wbps && - (virCgroupSetBlkioDeviceWriteBps(priv->cgroup, dev->path, - dev->wbps) < 0 || - virCgroupGetBlkioDeviceWriteBps(priv->cgroup, dev->path, - &dev->wbps) < 0)) - return -1; - } - } - - return 0; + return virCgroupSetupBlkio(priv->cgroup, vm->def); } =20 =20 diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index b46f20abfd..165e5f4854 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -1419,6 +1419,67 @@ virCgroupGetBlkioWeight(virCgroupPtr group, unsigned= int *weight) getBlkioWeight, -1, weight); } =20 +/** + * virCgroupSetupBlkio + * + * @group: The cgroup to change block io setting for + * @def: pointer to domain def + * + * Returns: 0 on success, -1 on error + */ +int +virCgroupSetupBlkio(virCgroupPtr group, virDomainDefPtr def) +{ + size_t i; + + if (def->blkio.weight !=3D 0 && + virCgroupSetBlkioWeight(group, def->blkio.weight) < 0) + return -1; + + if (def->blkio.ndevices) { + for (i =3D 0; i < def->blkio.ndevices; i++) { + virBlkioDevicePtr dev =3D &def->blkio.devices[i]; + if (dev->weight && + (virCgroupSetBlkioDeviceWeight(group, dev->path, + dev->weight) < 0 || + virCgroupGetBlkioDeviceWeight(group, dev->path, + &dev->weight) < 0)) + return -1; + + if (dev->riops && + (virCgroupSetBlkioDeviceReadIops(group, dev->path, + dev->riops) < 0 || + virCgroupGetBlkioDeviceReadIops(group, dev->path, + &dev->riops) < 0)) + return -1; + + if (dev->wiops && + (virCgroupSetBlkioDeviceWriteIops(group, dev->path, + dev->wiops) < 0 || + virCgroupGetBlkioDeviceWriteIops(group, dev->path, + &dev->wiops) < 0)) + return -1; + + if (dev->rbps && + (virCgroupSetBlkioDeviceReadBps(group, dev->path, + dev->rbps) < 0 || + virCgroupGetBlkioDeviceReadBps(group, dev->path, + &dev->rbps) < 0)) + return -1; + + if (dev->wbps && + (virCgroupSetBlkioDeviceWriteBps(group, dev->path, + dev->wbps) < 0 || + virCgroupGetBlkioDeviceWriteBps(group, dev->path, + &dev->wbps) < 0)) + return -1; + } + } + + return 0; +} + + /** * virCgroupSetBlkioDeviceReadIops: * @group: The cgroup to change block io setting for diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h index 3eefe78787..9815c51fda 100644 --- a/src/util/vircgroup.h +++ b/src/util/vircgroup.h @@ -24,6 +24,7 @@ #include "virutil.h" #include "virbitmap.h" #include "virenum.h" +#include "conf/domain_conf.h" =20 struct _virCgroup; typedef struct _virCgroup virCgroup; @@ -123,6 +124,8 @@ int virCgroupAddThread(virCgroupPtr group, pid_t pid); int virCgroupSetBlkioWeight(virCgroupPtr group, unsigned int weight); int virCgroupGetBlkioWeight(virCgroupPtr group, unsigned int *weight); =20 +int virCgroupSetupBlkio(virCgroupPtr group, virDomainDefPtr def); + int virCgroupGetBlkioIoServiced(virCgroupPtr group, long long *bytes_read, long long *bytes_write, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 08:38:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1572407008; cv=none; d=zoho.com; s=zohoarc; b=Roert9JWo+Gn/hb2MhuWndr6voNjCDmu4+KnKJGRxcQjGyf2WnH7fbmno6U5spLy+qG9ggXD+x8evXKwpUEqw/RKEhV9bQIMr+VDLAhq2Bj4r7xmZkZGo01G83m/c45awQB5ES2PgbU9XTnSmGTDcicRYrPuuxrGOsNBhcHZPjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572407008; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+8J88uE2+gfBIN3TpLF1cfHRGeSGnlpAVoXuklWeVWc=; b=lneBmvj707KOv0DwGjfN+v2BqI40NAk3nYr4sjXursIUDgNLly7UHlIES9LrYxou6AuIA/6zdyky9rZxqG6ohI9eMNViKEbaVfOH9lM/GSWEKQyvnisw4CoqXfMYCpS5B5c7v52KEebkl2IgMUyGATo8fAtCfm2nQ4P0p8JZsYo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1572407008969537.3906672448655; Tue, 29 Oct 2019 20:43:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-366-WLY6BkNKMomgFmc82f9_sQ-1; Tue, 29 Oct 2019 23:43:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9C8A9107AD29; Wed, 30 Oct 2019 03:43:19 +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 9F3C75D6D0; Wed, 30 Oct 2019 03:43:18 +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 4D2421809567; Wed, 30 Oct 2019 03:43:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9U3hA9J030990 for ; Tue, 29 Oct 2019 23:43:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id D996A60C4E; Wed, 30 Oct 2019 03:43:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D32CB60C4B for ; Wed, 30 Oct 2019 03:43:08 +0000 (UTC) Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [221.176.66.80]) by mx1.redhat.com (Postfix) with ESMTP id 1000E3086272 for ; Wed, 30 Oct 2019 03:42:47 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app07-12007 (RichMail) with SMTP id 2ee75db906a5203-ba676; Wed, 30 Oct 2019 11:42:29 +0800 (CST) Received: from localhost.localdomain (unknown[112.25.154.149]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95db9069cb4a-0e0db; Wed, 30 Oct 2019 11:42:28 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572407007; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=+8J88uE2+gfBIN3TpLF1cfHRGeSGnlpAVoXuklWeVWc=; b=IyBcMfN4vmh+EEmv0wecdtgE/gRyFiG+axxQspCnBZ5Hu/yRaVpN6tOkPBKik4IgB2esnP 5rdHCCoJ5cXS1Ous9LK3a28xAVHj4Io9bW0tpRjbQ0ViBik+pzD889cNXV1v+RbP0pkqGw L3wr9gH6d4P+KMFoy30Jh2iImoVvMIw= X-RM-TRANSID: 2ee75db906a5203-ba676 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee95db9069cb4a-0e0db From: Mao Zhongyi To: libvir-list@redhat.com Date: Wed, 30 Oct 2019 11:42:13 +0800 Message-Id: <20191030034213.2888382-5-maozhongyi@cmss.chinamobile.com> In-Reply-To: <20191030034213.2888382-1-maozhongyi@cmss.chinamobile.com> References: <20191030034213.2888382-1-maozhongyi@cmss.chinamobile.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 30 Oct 2019 03:43:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 30 Oct 2019 03:43:01 +0000 (UTC) for IP:'221.176.66.80' DOMAIN:'cmccmta2.chinamobile.com' HELO:'cmccmta2.chinamobile.com' FROM:'maozhongyi@cmss.chinamobile.com' RCPT:'' X-RedHat-Spam-Score: -0.698 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE) 221.176.66.80 cmccmta2.chinamobile.com 221.176.66.80 cmccmta2.chinamobile.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Zhang Shengju , Mao Zhongyi Subject: [libvirt] [PATCH 4/4] util: consolidate QEMU and LXC memory related duplicate code 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: WLY6BkNKMomgFmc82f9_sQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Both qemu and lxc drivers have some duplicate code when dealing with cgroups, such as virLXCCgroupSetupMemTune() and qemuSetupMemoryCgroup(), duplicate code over 80, so consolidate the same chunk into a separate routine. Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- src/libvirt_private.syms | 1 + src/lxc/lxc_cgroup.c | 28 +--------------------------- src/qemu/qemu_cgroup.c | 14 +------------- src/util/vircgroup.c | 30 ++++++++++++++++++++++++++++++ src/util/vircgroup.h | 1 + 5 files changed, 34 insertions(+), 40 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 3df2af55bd..ff002fc60b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1686,6 +1686,7 @@ virCgroupSetMemorySoftLimit; virCgroupSetMemSwapHardLimit; virCgroupSetOwner; virCgroupSetupBlkio; +virCgroupSetupMemory; virCgroupSupportsCpuBW; virCgroupTerminateMachine; =20 diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index fdf8df79aa..ea6c14dfef 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -102,32 +102,6 @@ static int virLXCCgroupSetupCpusetTune(virDomainDefPtr= def, } =20 =20 -static int virLXCCgroupSetupMemTune(virDomainDefPtr def, - virCgroupPtr cgroup) -{ - int ret =3D -1; - - if (virCgroupSetMemory(cgroup, virDomainDefGetMemoryInitial(def)) < 0) - goto cleanup; - - if (virMemoryLimitIsSet(def->mem.hard_limit)) - if (virCgroupSetMemoryHardLimit(cgroup, def->mem.hard_limit) < 0) - goto cleanup; - - if (virMemoryLimitIsSet(def->mem.soft_limit)) - if (virCgroupSetMemorySoftLimit(cgroup, def->mem.soft_limit) < 0) - goto cleanup; - - if (virMemoryLimitIsSet(def->mem.swap_hard_limit)) - if (virCgroupSetMemSwapHardLimit(cgroup, def->mem.swap_hard_limit)= < 0) - goto cleanup; - - ret =3D 0; - cleanup: - return ret; -} - - static int virLXCCgroupGetMemSwapUsage(virCgroupPtr cgroup, virLXCMeminfoPtr meminfo) { @@ -438,7 +412,7 @@ int virLXCCgroupSetup(virDomainDefPtr def, if (virCgroupSetupBlkio(cgroup, def) < 0) goto cleanup; =20 - if (virLXCCgroupSetupMemTune(def, cgroup) < 0) + if (virCgroupSetupMemory(cgroup, def) < 0) goto cleanup; =20 if (virLXCCgroupSetupDeviceACL(def, cgroup) < 0) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index c9925ee5ca..22f77a03ad 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -554,19 +554,7 @@ qemuSetupMemoryCgroup(virDomainObjPtr vm) } } =20 - if (virMemoryLimitIsSet(vm->def->mem.hard_limit)) - if (virCgroupSetMemoryHardLimit(priv->cgroup, vm->def->mem.hard_li= mit) < 0) - return -1; - - if (virMemoryLimitIsSet(vm->def->mem.soft_limit)) - if (virCgroupSetMemorySoftLimit(priv->cgroup, vm->def->mem.soft_li= mit) < 0) - return -1; - - if (virMemoryLimitIsSet(vm->def->mem.swap_hard_limit)) - if (virCgroupSetMemSwapHardLimit(priv->cgroup, vm->def->mem.swap_h= ard_limit) < 0) - return -1; - - return 0; + return virCgroupSetupMemory(priv->cgroup, vm->def); } =20 =20 diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 165e5f4854..12af8759f7 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -1670,6 +1670,36 @@ virCgroupSetMemory(virCgroupPtr group, unsigned long= long kb) setMemory, -1, kb); } =20 +/** + * virCgroupSetupMemory + * + * @group: The cgroup to change memory for + * @def: pointer to domian def + * + * Returns: 0 on success, -1 on error. + */ +int +virCgroupSetupMemory(virCgroupPtr group, virDomainDefPtr def) +{ + int ret =3D -1; + + if (virMemoryLimitIsSet(def->mem.hard_limit)) + if (virCgroupSetMemoryHardLimit(group, def->mem.hard_limit) < 0) + goto cleanup; + + if (virMemoryLimitIsSet(def->mem.soft_limit)) + if (virCgroupSetMemorySoftLimit(group, def->mem.soft_limit) < 0) + goto cleanup; + + if (virMemoryLimitIsSet(def->mem.swap_hard_limit)) + if (virCgroupSetMemSwapHardLimit(group, def->mem.swap_hard_limit) = < 0) + goto cleanup; + + ret =3D 0; + cleanup: + return ret; +} + =20 /** * virCgroupGetMemoryStat: diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h index 9815c51fda..17f07ea53c 100644 --- a/src/util/vircgroup.h +++ b/src/util/vircgroup.h @@ -179,6 +179,7 @@ int virCgroupGetBlkioDeviceWriteBps(virCgroupPtr group, unsigned long long *wbps); =20 int virCgroupSetMemory(virCgroupPtr group, unsigned long long kb); +int virCgroupSetupMemory(virCgroupPtr group, virDomainDefPtr def); int virCgroupGetMemoryStat(virCgroupPtr group, unsigned long long *cache, unsigned long long *activeAnon, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list