From nobody Mon Feb 9 08:57:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1486042298286593.9617715634049; Thu, 2 Feb 2017 05:31:38 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v12DS09s003503; Thu, 2 Feb 2017 08:28:00 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.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 v12DRwUY017161 for ; Thu, 2 Feb 2017 08:27:58 -0500 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v12DRw4h004883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 2 Feb 2017 08:27:58 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF718C05680F for ; Thu, 2 Feb 2017 13:27:47 +0000 (UTC) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 02 Feb 2017 05:27:46 -0800 Received: from silpixa00384861.ir.intel.com ([10.237.222.130]) by orsmga003.jf.intel.com with ESMTP; 02 Feb 2017 05:27:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,324,1477983600"; d="scan'208";a="929369516" From: Jaroslav Safka To: libvir-list@redhat.com Date: Thu, 2 Feb 2017 13:27:31 +0000 Message-Id: <1486042053-3640-3-git-send-email-jaroslavx.safka@intel.com> In-Reply-To: <1486042053-3640-1-git-send-email-jaroslavx.safka@intel.com> References: <1486042053-3640-1-git-send-email-jaroslavx.safka@intel.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 200 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 02 Feb 2017 13:27:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 02 Feb 2017 13:27:48 +0000 (UTC) for IP:'134.134.136.65' DOMAIN:'mga03.intel.com' HELO:'mga03.intel.com' FROM:'jaroslavx.safka@intel.com' RCPT:'' X-RedHat-Spam-Score: -4.222 (BAYES_50, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RP_MATCHES_RCVD, SPF_PASS) 134.134.136.65 mga03.intel.com 134.134.136.65 mga03.intel.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-loop: libvir-list@redhat.com Cc: sean.k.mooney@intel.com, Jaroslav Safka , michalx.ptacek@intel.com Subject: [libvirt] [PATCHv5 2/4] qemu_conf: Add param memory_backing_dir 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add new parameter memory_backing_dir where files will be stored when memory= Backing source is selected as file. Value is stored inside char* memoryBackingDir --- src/qemu/libvirtd_qemu.aug | 3 +++ src/qemu/qemu.conf | 4 ++++ src/qemu/qemu_conf.c | 9 +++++++++ src/qemu/qemu_conf.h | 2 ++ src/qemu/test_libvirtd_qemu.aug.in | 1 + 5 files changed, 19 insertions(+) diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index de723b2..82bae9e 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -109,6 +109,8 @@ module Libvirtd_qemu =3D =20 let gluster_debug_level_entry =3D int_entry "gluster_debug_level" =20 + let memory_entry =3D str_entry "memory_backing_dir" + (* Each entry in the config is one of the following ... *) let entry =3D default_tls_entry | vnc_entry @@ -125,6 +127,7 @@ module Libvirtd_qemu =3D | log_entry | nvram_entry | gluster_debug_level_entry + | memory_entry =20 let comment =3D [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \= t\n][^\n]*)?/ . del /\n/ "\n" ] let empty =3D [ label "#empty" . eol ] diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf index a8cd369..97d769d 100644 --- a/src/qemu/qemu.conf +++ b/src/qemu/qemu.conf @@ -673,3 +673,7 @@ # devices entries throughout the domain lifetime. This namespace is turned= on # by default. #namespaces =3D [ "mount" ] + +# This directory is used for memoryBacking source if configured as file. +# NOTE: big files will be stored here +#memory_backing_dir =3D "/var/lib/libvirt/qemu/ram" diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 6613d59..0223a95 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -186,6 +186,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool priv= ileged) goto error; if (virAsprintf(&cfg->nvramDir, "%s/nvram", cfg->libDir) < 0) goto error; + if (virAsprintf(&cfg->memoryBackingDir, "%s/ram", cfg->libDir) < 0) + goto error; } else { char *rundir; char *cachedir; @@ -231,6 +233,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool priv= ileged) if (virAsprintf(&cfg->nvramDir, "%s/qemu/nvram", cfg->configBaseDir) < 0) goto error; + if (virAsprintf(&cfg->memoryBackingDir, "%s/qemu/ram", cfg->config= BaseDir) < 0) + goto error; } =20 if (virAsprintf(&cfg->configDir, "%s/qemu", cfg->configBaseDir) < 0) @@ -408,6 +412,8 @@ static void virQEMUDriverConfigDispose(void *obj) VIR_FREE(cfg->lockManagerName); =20 virFirmwareFreeList(cfg->firmwares, cfg->nfirmwares); + + VIR_FREE(cfg->memoryBackingDir); } =20 =20 @@ -835,6 +841,9 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr = cfg, } } =20 + if (virConfGetValueString(conf, "memory_backing_dir", &cfg->memoryBack= ingDir) < 0) + goto cleanup; + ret =3D 0; =20 cleanup: diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 92a7a50..91904ed 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -195,6 +195,8 @@ struct _virQEMUDriverConfig { virFirmwarePtr *firmwares; size_t nfirmwares; unsigned int glusterDebugLevel; + + char *memoryBackingDir; }; =20 /* Main driver state */ diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qe= mu.aug.in index a749f09..bd25235 100644 --- a/src/qemu/test_libvirtd_qemu.aug.in +++ b/src/qemu/test_libvirtd_qemu.aug.in @@ -94,3 +94,4 @@ module Test_libvirtd_qemu =3D { "namespaces" { "1" =3D "mount" } } +{ "memory_backing_dir" =3D "/var/lib/libvirt/qemu/ram" } --=20 2.7.4 -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact = the sender and delete all copies. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list