From nobody Sat Dec 21 13:46:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1726666990482680.0968653992697; Wed, 18 Sep 2024 06:43:10 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6B04C1BD6; Wed, 18 Sep 2024 09:43:09 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 189B91BBC; Wed, 18 Sep 2024 09:42:16 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id F27CA1AD6; Wed, 18 Sep 2024 09:42:11 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 709B61B03 for ; Wed, 18 Sep 2024 09:42:11 -0400 (EDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-482-roouJeG6Ptq5a8KdIAfJ0Q-1; Wed, 18 Sep 2024 09:42:10 -0400 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-42cb830ea86so48337235e9.3 for ; Wed, 18 Sep 2024 06:42:09 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e704d8a7fsm17655945e9.5.2024.09.18.06.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 06:42:07 -0700 (PDT) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 7C3C024F6876; Wed, 18 Sep 2024 15:42:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726666931; h=from:from: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; bh=XjJIYQLbNSV6FqH/iwHkqdautA2NfbA12V8/BsJwykQ=; b=QYOvPim34ZFksUdDoLBfm+eZwQqqgZSMojyCuqEDnuKQcW9b0R3kWqpvJhf6NmUSJd41tw MwujZDuXh97dmXdUp5tmGWB/utgriey7fwK+qNoiZ7qMFuJ8QuFnNfgMdA2Bldg9WKkdpe p0Zf66QHM2lm+Err8sxYdmSGUNWJ0m4= X-MC-Unique: roouJeG6Ptq5a8KdIAfJ0Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726666929; x=1727271729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XjJIYQLbNSV6FqH/iwHkqdautA2NfbA12V8/BsJwykQ=; b=PLXhfEAMTdN2MdA3nAvPyC2zHfoeyA/TRGxORWQen5bkD8MFLQOJ8jG4Lnk9I93Hea wqDdQspjFDr9PbOycT3gFU2vxFTZtGhio3lu6tMelWXYaHP6mjQROodfflWBSRqcn3qg hZNer55/orY762abDUC5mC9i0nsP1L5Gz5QWc+bZI+JBISyST28sQZA5syQfDcez4MDH CmEKCOKHfiulOAmNiD9C8Ody2PKcv619NmrACGan4dHpH6nyaQX3wyslNETlotdDxD4o PbYjxDKsF/IHB30uXijoeVnCyeQWk/Apyja6HuZ384GzasQjAo5xvaKb7xvDnmozaeM9 zIcQ== X-Gm-Message-State: AOJu0YxJ5XsPol3o8AuzPcGyNWllTxLkTmC94B4E1fe7WpyLvggMSkMV e7oOuwWam/e9GJqD99LGrA00Uwp1nX5nllNAqY1qJ0rkhTZgPVmjlj8qsMl1Hid5UN3BLBJAvwv WTgGqyfjapO2mYlXexazffQV0VnDwp1/NlfBMw3gvi027l1xVFEWrty8kFRPLQO0= X-Received: by 2002:a5d:4e50:0:b0:374:c11c:c5c3 with SMTP id ffacd0b85a97d-378c2d5a7d1mr12004254f8f.41.1726666928805; Wed, 18 Sep 2024 06:42:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFJmBwlrtJl2ZFeYN75G2zNUMVKSPsox8SqUaFJcxAyAD4D5pX0OGqHlsmrfyWEKd2YL+RDg== X-Received: by 2002:a5d:4e50:0:b0:374:c11c:c5c3 with SMTP id ffacd0b85a97d-378c2d5a7d1mr12004236f8f.41.1726666928369; Wed, 18 Sep 2024 06:42:08 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 1/8] qemu: Move domain-related functions to qemu_domain Date: Wed, 18 Sep 2024 15:41:59 +0200 Message-ID: <62d6b5ae529895937a568f53173635625d0685bc.1726666238.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: AU4U4D5W25WPECSXXDS2AV2GA3EDR67P X-Message-ID-Hash: AU4U4D5W25WPECSXXDS2AV2GA3EDR67P X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Michael Galaxy X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1726666991390116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Martin Kletzander --- src/qemu/qemu_conf.c | 58 ------------------------------------------ src/qemu/qemu_conf.h | 8 ------ src/qemu/qemu_domain.c | 58 ++++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 8 ++++++ 4 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index b36bede6c3c6..0d90a8739202 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1603,64 +1603,6 @@ qemuGetDomainHupageMemPath(virQEMUDriver *driver, } =20 =20 -int -qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, - const virDomainDef *def, - char **path) -{ - g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); - const char *root =3D driver->embeddedRoot; - g_autofree char *shortName =3D NULL; - - if (!(shortName =3D virDomainDefGetShortName(def))) - return -1; - - if (root && !STRPREFIX(cfg->memoryBackingDir, root)) { - g_autofree char * hash =3D virDomainDriverGenerateRootHash("qemu",= root); - *path =3D g_strdup_printf("%s/%s-%s", cfg->memoryBackingDir, hash,= shortName); - } else { - *path =3D g_strdup_printf("%s/%s", cfg->memoryBackingDir, shortNam= e); - } - - return 0; -} - - -/** - * qemuGetMemoryBackingPath: - * @driver: the qemu driver - * @def: domain definition - * @alias: memory object alias - * @memPath: constructed path - * - * Constructs path to memory backing dir and stores it at @memPath. - * - * Returns: 0 on success, - * -1 otherwise (with error reported). - */ -int -qemuGetMemoryBackingPath(virQEMUDriver *driver, - const virDomainDef *def, - const char *alias, - char **memPath) -{ - g_autofree char *domainPath =3D NULL; - - if (!alias) { - /* This should never happen (TM) */ - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("memory device alias is not assigned")); - return -1; - } - - if (qemuGetMemoryBackingDomainPath(driver, def, &domainPath) < 0) - return -1; - - *memPath =3D g_strdup_printf("%s/%s", domainPath, alias); - return 0; -} - - int qemuHugepageMakeBasedir(virQEMUDriver *driver, virHugeTLBFS *hugepage) diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index aa1e1a626c1a..c98b6137c1fd 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -368,14 +368,6 @@ int qemuGetDomainHupageMemPath(virQEMUDriver *driver, unsigned long long pagesize, char **memPath); =20 -int qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, - const virDomainDef *def, - char **path); -int qemuGetMemoryBackingPath(virQEMUDriver *driver, - const virDomainDef *def, - const char *alias, - char **memPath); - int qemuHugepageMakeBasedir(virQEMUDriver *driver, virHugeTLBFS *hugepage); =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ed305d9427f5..550ab5046f00 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -13143,3 +13143,61 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverConfi= g *cfg, =20 return ret; } + + +int +qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, + const virDomainDef *def, + char **path) +{ + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); + const char *root =3D driver->embeddedRoot; + g_autofree char *shortName =3D NULL; + + if (!(shortName =3D virDomainDefGetShortName(def))) + return -1; + + if (root && !STRPREFIX(cfg->memoryBackingDir, root)) { + g_autofree char * hash =3D virDomainDriverGenerateRootHash("qemu",= root); + *path =3D g_strdup_printf("%s/%s-%s", cfg->memoryBackingDir, hash,= shortName); + } else { + *path =3D g_strdup_printf("%s/%s", cfg->memoryBackingDir, shortNam= e); + } + + return 0; +} + + +/** + * qemuGetMemoryBackingPath: + * @driver: the qemu driver + * @def: domain definition + * @alias: memory object alias + * @memPath: constructed path + * + * Constructs path to memory backing dir and stores it at @memPath. + * + * Returns: 0 on success, + * -1 otherwise (with error reported). + */ +int +qemuGetMemoryBackingPath(virQEMUDriver *driver, + const virDomainDef *def, + const char *alias, + char **memPath) +{ + g_autofree char *domainPath =3D NULL; + + if (!alias) { + /* This should never happen (TM) */ + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("memory device alias is not assigned")); + return -1; + } + + if (qemuGetMemoryBackingDomainPath(driver, def, &domainPath) < 0) + return -1; + + *memPath =3D g_strdup_printf("%s/%s", domainPath, alias); + return 0; +} diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index d799f6c08676..e06ee60f4cd9 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1168,3 +1168,11 @@ int qemuDomainStorageUpdatePhysical(virQEMUDriverConfig *cfg, virDomainObj *vm, virStorageSource *src); + +int qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, + const virDomainDef *def, + char **path); +int qemuGetMemoryBackingPath(virQEMUDriver *driver, + const virDomainDef *def, + const char *alias, + char **memPath); --=20 2.46.0 From nobody Sat Dec 21 13:46:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 17266670155051011.5108413741909; Wed, 18 Sep 2024 06:43:35 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6B7B21BF7; Wed, 18 Sep 2024 09:43:34 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 80C721B7F; Wed, 18 Sep 2024 09:42:19 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 40CC81AD6; Wed, 18 Sep 2024 09:42:12 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B5F7F1AD5 for ; Wed, 18 Sep 2024 09:42:11 -0400 (EDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-187-pNKz1-l1M3atNVax_VBtDw-1; Wed, 18 Sep 2024 09:42:10 -0400 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-374c44e58a9so2902125f8f.1 for ; Wed, 18 Sep 2024 06:42:10 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e704cea56sm17737935e9.8.2024.09.18.06.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 06:42:08 -0700 (PDT) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 8926424F6877; Wed, 18 Sep 2024 15:42:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726666931; h=from:from: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; bh=E0bZ/QWuZXjGTNVvgKm2NuqkqDnGGnZH+pqM7REknD4=; b=LM2gcQR55GtRsf7Q50AcUZfXbjlh3+d6qebFpjnlCvPHyEhPCjl1JI3b23DXu+Pe35441r 5UGRGa1JfjIoW/TGVLg3itqssDb2vw7u7GheRUnh66K08I7GYZtkGnNafjwbaRCcb3PDeQ YRzGTeky5WJwnE/8ciZPfUAEvb6HeuA= X-MC-Unique: pNKz1-l1M3atNVax_VBtDw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726666929; x=1727271729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E0bZ/QWuZXjGTNVvgKm2NuqkqDnGGnZH+pqM7REknD4=; b=ZMw6nIkeMDdkdzuhMF5Ej7synOiTEeTrTMypojGOyoHtX0An4MA0VI/qkJREKF6PyC 206/bVQUwfO/8I4H98Md8LDD6xImEMJFcwSWi9AHpMpQtfdLbxiESKByclCs69dS74fr Ncr4BiLw/Ce2UGIUUZtlIMrsKBQWkDtR2DjdATjJune++IdMIfy5Z4jdgb+p9Ji4WrXg XWbUCCOrFsYFkPiVnCeLcG18HfrMOeX9fQ6tyN6brODDO9raxZ8QRRVCvMK4M/+8xhuN s7NRyETn0mAf6Ls16PX+T6s7EK6Xie5G0jsZtoZZxqNIRoLHAteEiw2L0CdQKK4PIrk6 ZoMQ== X-Gm-Message-State: AOJu0YzcKzewOzFOiO3kkRY1jEDISdV0gtjafXDasODqkxt1CPto1AHk 620oucTdCMeQ3CYlcH77poTqY9NVszd+BUB1TwUFRKEXmJveLDLpz6M+1o0anLQkYguYxob/qLs AaBcqMkZqceaZpw2mDpskBP5dtxyMLkPG9/UEMc2URsnYlEet2FUKKSs= X-Received: by 2002:a5d:4dc2:0:b0:371:87d4:8f12 with SMTP id ffacd0b85a97d-378c2cfc857mr11672599f8f.17.1726666929039; Wed, 18 Sep 2024 06:42:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG70G20xt+bjnMz7uqpJXbkz88s/yjGX9FlFpQVO+cAdU1li4rxspUfD6zHzojFzGGRdHqx/g== X-Received: by 2002:a5d:4dc2:0:b0:371:87d4:8f12 with SMTP id ffacd0b85a97d-378c2cfc857mr11672581f8f.17.1726666928555; Wed, 18 Sep 2024 06:42:08 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 2/8] qemu_domain.h: Change indentation for new functions Date: Wed, 18 Sep 2024 15:42:00 +0200 Message-ID: <6e71d1b070a6c111d704e789c305f9cf1b88373a.1726666238.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JCOP4GT5DAYCYS2JQHT6P5OUUQLAAWFW X-Message-ID-Hash: JCOP4GT5DAYCYS2JQHT6P5OUUQLAAWFW X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Michael Galaxy X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1726667017422116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Martin Kletzander --- src/qemu/qemu_domain.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index e06ee60f4cd9..6681246c2338 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1169,10 +1169,12 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverConfig= *cfg, virDomainObj *vm, virStorageSource *src); =20 -int qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, - const virDomainDef *def, - char **path); -int qemuGetMemoryBackingPath(virQEMUDriver *driver, - const virDomainDef *def, - const char *alias, - char **memPath); +int +qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, + const virDomainDef *def, + char **path); +int +qemuGetMemoryBackingPath(virQEMUDriver *driver, + const virDomainDef *def, + const char *alias, + char **memPath); --=20 2.46.0 From nobody Sat Dec 21 13:46:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1726667041250804.1321662839503; Wed, 18 Sep 2024 06:44:01 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 374BB1B7E; Wed, 18 Sep 2024 09:44:00 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6CB2F1BDE; Wed, 18 Sep 2024 09:42:22 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 998EC1B0F; Wed, 18 Sep 2024 09:42:12 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 131DC1AFC for ; Wed, 18 Sep 2024 09:42:12 -0400 (EDT) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-79-EBS4DwCdM8WXtR58Z3LKAA-1; Wed, 18 Sep 2024 09:42:10 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3789c3541e9so2937478f8f.2 for ; Wed, 18 Sep 2024 06:42:10 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e72e49bfsm12353649f8f.21.2024.09.18.06.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 06:42:08 -0700 (PDT) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 9550924F6878; Wed, 18 Sep 2024 15:42:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726666931; h=from:from: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; bh=coH4S0pqRiLv+fD7BMyqEPaXlzzNIMcE+CpW66AqmHw=; b=NYxBuYZx7FoPe1fyeQ8WSbMkDlUn+b2bGkW3zyXF2DVRy4sfLg8Mc4PjeYa0SJHVDYpIHe 1wKMb1hxLz9uQOJildTmxQboEL3WZdhj8HoA4hGznoDhq/hCwBhpWrt0niyQn7daA8U4ZB sF+AFPWLvLV+mJuUqrf+VqcNUd8b0lg= X-MC-Unique: EBS4DwCdM8WXtR58Z3LKAA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726666929; x=1727271729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=coH4S0pqRiLv+fD7BMyqEPaXlzzNIMcE+CpW66AqmHw=; b=vDEyAYb7Pqnpzn01UsT7y81/HzUl93tNrSXL7l7DUynLkInt6CjCDwwWJIFMyZup/c qiKshYBLnHQ5LUby8fR+YD03O+XgvHuQPRqekDvWGFqigppFlyWkKaahj6zE0iOVONnI duBP3b8yIpIZqRPXNwONtKalEzp7uBg5UARRjm2KnA1SvqQUVCR37DYGdZJrdWr1Oe9Z Nu8Nrhtli/xyqwQtFJ8Tpwq5ceuXXoyRbFL4lwQWqJpbhzn1P/WF9TNJot1/Imc2BLwG utPm/okPRW/nn4xyMCTu6GJRkEvs+eeoY7POvRdOe1fthVXM0JlbPnBToPf17SxWSteI XKmQ== X-Gm-Message-State: AOJu0YwcNsluYnQTogfsEz/roekdda8zFc/bgDPiiAGvm0VGPP2N/qpG JrRxe92L1INzgOvFuS8SNw6QuIXUIVjae07ycNsFzF0tqq/QpamxNPdj0Htujwkdc7Lw0EUO86l eHG/XA3Yp5hc+gqTLOYcnL4rPACORB4/6q2vsSa/M9CmewZU44rbxQZ8= X-Received: by 2002:adf:e988:0:b0:374:c2e9:28bc with SMTP id ffacd0b85a97d-378c2d0625cmr14352170f8f.21.1726666929256; Wed, 18 Sep 2024 06:42:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjk3WyEcBe5G16HmJ7UnRjG72DP1Pbz/f8gWmFi4LKL4/kW9lRHFfQjkxKS0DSRrA319egYw== X-Received: by 2002:adf:e988:0:b0:374:c2e9:28bc with SMTP id ffacd0b85a97d-378c2d0625cmr14352143f8f.21.1726666928758; Wed, 18 Sep 2024 06:42:08 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 3/8] qemu: Change parameters of qemuGetMemoryBackingDomainPath() Date: Wed, 18 Sep 2024 15:42:01 +0200 Message-ID: <017652c5095b6289de3611b8eec4df810616f546.1726666238.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2BQEFD6RVUBDBL3FE54FTN2EIAFN36DF X-Message-ID-Hash: 2BQEFD6RVUBDBL3FE54FTN2EIAFN36DF X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Michael Galaxy X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1726667041509116600 Content-Type: text/plain; charset="utf-8"; x-default="true" This way it does not use driver, since it will be later reworked and the following patches cleaner, hopefully. Signed-off-by: Martin Kletzander --- src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_domain.c | 7 ++++--- src/qemu/qemu_domain.h | 4 ++-- src/qemu/qemu_hotplug.c | 4 ++-- src/qemu/qemu_process.c | 7 +++---- src/qemu/qemu_process.h | 3 +-- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1b992d8eed7a..5d24439a6ff6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3421,7 +3421,7 @@ qemuBuildMemoryBackendProps(virJSONValue **backendPro= ps, } else { /* We can have both pagesize and mem source. If that's the cas= e, * prefer hugepages as those are more specific. */ - if (qemuGetMemoryBackingPath(priv->driver, def, mem->info.alia= s, &memPath) < 0) + if (qemuGetMemoryBackingPath(priv, def, mem->info.alias, &memP= ath) < 0) return -1; } =20 @@ -7315,7 +7315,7 @@ qemuBuildMemPathStr(const virDomainDef *def, return -1; prealloc =3D true; } else if (def->mem.source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_FILE) { - if (qemuGetMemoryBackingPath(priv->driver, def, "ram", &mem_path) = < 0) + if (qemuGetMemoryBackingPath(priv, def, "ram", &mem_path) < 0) return -1; } =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 550ab5046f00..e3db3ee903c0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -13146,10 +13146,11 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverConf= ig *cfg, =20 =20 int -qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, +qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv, const virDomainDef *def, char **path) { + virQEMUDriver *driver =3D priv->driver; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); const char *root =3D driver->embeddedRoot; g_autofree char *shortName =3D NULL; @@ -13181,7 +13182,7 @@ qemuGetMemoryBackingDomainPath(virQEMUDriver *drive= r, * -1 otherwise (with error reported). */ int -qemuGetMemoryBackingPath(virQEMUDriver *driver, +qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv, const virDomainDef *def, const char *alias, char **memPath) @@ -13195,7 +13196,7 @@ qemuGetMemoryBackingPath(virQEMUDriver *driver, return -1; } =20 - if (qemuGetMemoryBackingDomainPath(driver, def, &domainPath) < 0) + if (qemuGetMemoryBackingDomainPath(priv, def, &domainPath) < 0) return -1; =20 *memPath =3D g_strdup_printf("%s/%s", domainPath, alias); diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 6681246c2338..6cc4c14f74d3 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1170,11 +1170,11 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverConfig= *cfg, virStorageSource *src); =20 int -qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, +qemuGetMemoryBackingDomainPath(qemuDomainObjPrivate *priv, const virDomainDef *def, char **path); int -qemuGetMemoryBackingPath(virQEMUDriver *driver, +qemuGetMemoryBackingPath(qemuDomainObjPrivate *priv, const virDomainDef *def, const char *alias, char **memPath); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 75b97cf7367b..4ada4179dd7f 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2354,7 +2354,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver, qemuDomainObjExitMonitor(vm); =20 if (objAdded && mem) - ignore_value(qemuProcessDestroyMemoryBackingPath(driver, vm, mem)); + ignore_value(qemuProcessDestroyMemoryBackingPath(vm, mem)); =20 virErrorRestore(&orig_err); if (!mem) @@ -4649,7 +4649,7 @@ qemuDomainRemoveMemoryDevice(virQEMUDriver *driver, if (qemuDomainNamespaceTeardownMemory(vm, mem) < 0) VIR_WARN("Unable to remove memory device from /dev"); =20 - if (qemuProcessDestroyMemoryBackingPath(driver, vm, mem) < 0) + if (qemuProcessDestroyMemoryBackingPath(vm, mem) < 0) VIR_WARN("Unable to destroy memory backing path"); =20 qemuDomainReleaseMemoryDeviceSlot(vm, mem); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 2e4ee9e30502..1d3a905dd854 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4095,7 +4095,7 @@ qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *dri= ver, =20 if (!build || shouldBuildMB) { g_autofree char *path =3D NULL; - if (qemuGetMemoryBackingDomainPath(driver, vm->def, &path) < 0) + if (qemuGetMemoryBackingDomainPath(QEMU_DOMAIN_PRIVATE(vm), vm->de= f, &path) < 0) return -1; =20 if (qemuProcessBuildDestroyMemoryPathsImpl(driver, vm, @@ -4108,13 +4108,12 @@ qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *d= river, =20 =20 int -qemuProcessDestroyMemoryBackingPath(virQEMUDriver *driver, - virDomainObj *vm, +qemuProcessDestroyMemoryBackingPath(virDomainObj *vm, virDomainMemoryDef *mem) { g_autofree char *path =3D NULL; =20 - if (qemuGetMemoryBackingPath(driver, vm->def, mem->info.alias, &path) = < 0) + if (qemuGetMemoryBackingPath(QEMU_DOMAIN_PRIVATE(vm), vm->def, mem->in= fo.alias, &path) < 0) return -1; =20 if (unlink(path) < 0 && diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index 2324aeb7bdff..878c522d8255 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -43,8 +43,7 @@ int qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *dri= ver, virDomainMemoryDef *mem, bool build); =20 -int qemuProcessDestroyMemoryBackingPath(virQEMUDriver *driver, - virDomainObj *vm, +int qemuProcessDestroyMemoryBackingPath(virDomainObj *vm, virDomainMemoryDef *mem); =20 void qemuProcessReconnectAll(virQEMUDriver *driver); --=20 2.46.0 From nobody Sat Dec 21 13:46:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1726667179052735.3220574534375; Wed, 18 Sep 2024 06:46:19 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 098331B10; Wed, 18 Sep 2024 09:46:18 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 2019A1BD8; Wed, 18 Sep 2024 09:42:30 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 120841B9F; Wed, 18 Sep 2024 09:42:15 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 58FDA1AFC for ; Wed, 18 Sep 2024 09:42:14 -0400 (EDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-152-z9TpJLUBNaylMZKR4KKtmg-1; Wed, 18 Sep 2024 09:42:10 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-42cb5b01c20so40345905e9.1 for ; Wed, 18 Sep 2024 06:42:10 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e705162b0sm17331495e9.34.2024.09.18.06.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 06:42:08 -0700 (PDT) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id A0DC624F6879; Wed, 18 Sep 2024 15:42:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726666934; h=from:from: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; bh=Lm77bTFL4mzai24tIl8cq5R2qnSsnAegaxqiqlmz6Os=; b=KpVCWPomZG8AA5Fb2EN8cOA16D/Ne76Tisqri39waHs5Vj5OsEAW0WgKLZT5MKH7NIxuXA Q1rvRVVQRW578Cs37s+YVh06P82bWm3GOV+/YiPzfEBdkDiqcQ1iqMv7shisuEs+OI4qTM 3IbeKr/iSxfbsRqGmCD0lHztbE7xIzY= X-MC-Unique: z9TpJLUBNaylMZKR4KKtmg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726666929; x=1727271729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lm77bTFL4mzai24tIl8cq5R2qnSsnAegaxqiqlmz6Os=; b=vwnKeQsROQ6VVhyU6ivO/Shr3FN+3urvMv44BuEK19j8X4LP0RZg4dmYPf+Gkzr6W0 fiLzApxCV0TIad/8ClZZQe5d26JVJ1FTjDSuo9ozH7R8SlOHjDRV+RYRbrLuj9sovacb ngQ5m2T4NhU/l5clpUqCQczeGy6MQVUWinN6TUZzVJbXojCcg4+travCI0eReelnCloC OAHA3GRg7l63b59O21jJsW6hIzxpF95jo6zhwqd5xw7Z+j3ynJJQnx99rf/mv16ZKLV1 cQMEUdHfDTUmDUxavNB+deOieliqa04xdpij1Wb5aKWjHSGxtuycL8f8x9nrmH2e8KKG n4WA== X-Gm-Message-State: AOJu0Yy4Ao79cRmjdjZ95uxmG3BLVZ0I+VpYjCAczkUJcjurY5kwU5JI AMFmWnYe7k1N2MnnjEgdjtPUfGR/acH/YsCDbk9PoGU45iT4+7mZJBnd+c9pFCxYmFX/Ob6Ov9y XEqznX6abbiLrXjmyZyTS3EH9ztHlRagfaWAKOeyNNLuC0MY2spGR0+tnX9YOAcU= X-Received: by 2002:a5d:4dc6:0:b0:374:af59:427d with SMTP id ffacd0b85a97d-378d625a26dmr9796588f8f.49.1726666929408; Wed, 18 Sep 2024 06:42:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZ5yKKOz+GkurGyz7YrtPzk34D94UouAr7uDRLEgCYgVaKm/Y9SxJr/BHy7GagzTm26BS7PA== X-Received: by 2002:a5d:4dc6:0:b0:374:af59:427d with SMTP id ffacd0b85a97d-378d625a26dmr9796569f8f.49.1726666928985; Wed, 18 Sep 2024 06:42:08 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 4/8] qemu_domain: Add memoryBackingDir to qemuDomainObjPrivate Date: Wed, 18 Sep 2024 15:42:02 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 6ZQ7Z76MIOQ7EDARAXEY2Q6DMDGH3STP X-Message-ID-Hash: 6ZQ7Z76MIOQ7EDARAXEY2Q6DMDGH3STP X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Michael Galaxy X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1726667180400116600 Content-Type: text/plain; charset="utf-8"; x-default="true" This way we _can_ (but do not, yet) remember the memory backing path for running domains even after configuration change and daemon restart. Signed-off-by: Martin Kletzander --- src/qemu/qemu_domain.c | 5 ++ src/qemu/qemu_domain.h | 2 + .../memory-backing-dir-in.xml | 61 +++++++++++++++++++ .../memory-backing-dir-out.xml | 1 + tests/qemuxmlactivetest.c | 2 + 5 files changed, 71 insertions(+) create mode 100644 tests/qemustatusxml2xmldata/memory-backing-dir-in.xml create mode 120000 tests/qemustatusxml2xmldata/memory-backing-dir-out.xml diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e3db3ee903c0..d5c0c4b56834 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1875,6 +1875,8 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *p= riv) g_slist_free_full(g_steal_pointer(&priv->threadContextAliases), g_free= ); =20 priv->migrationRecoverSetup =3D false; + + g_clear_pointer(&priv->memoryBackingDir, g_free); } =20 =20 @@ -2649,6 +2651,7 @@ qemuDomainObjPrivateXMLFormat(virBuffer *buf, virBufferEscapeString(buf, "\n", priv->libDir); virBufferEscapeString(buf, "\n", priv->channelTargetDir); + virBufferEscapeString(buf, "\n", priv->= memoryBackingDir); =20 virCPUDefFormatBufFull(buf, priv->origCPU, NULL); =20 @@ -3370,6 +3373,8 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, priv->channelTargetDir =3D tmp; tmp =3D NULL; =20 + priv->memoryBackingDir =3D virXPathString("string(./memoryBackingDir/@= path)", ctxt); + qemuDomainSetPrivatePathsOld(driver, vm); =20 if (virCPUDefParseXML(ctxt, "./cpu", VIR_CPU_TYPE_GUEST, &priv->origCP= U, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 6cc4c14f74d3..b0fcbdd4673b 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -261,6 +261,8 @@ struct _qemuDomainObjPrivate { =20 /* named file descriptor groups associated with the VM */ GHashTable *fds; + + char *memoryBackingDir; }; =20 #define QEMU_DOMAIN_PRIVATE(vm) \ diff --git a/tests/qemustatusxml2xmldata/memory-backing-dir-in.xml b/tests/= qemustatusxml2xmldata/memory-backing-dir-in.xml new file mode 100644 index 000000000000..eea671a41c0d --- /dev/null +++ b/tests/qemustatusxml2xmldata/memory-backing-dir-in.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + testtest + + + + + + + + + + + + + + + + -2 + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i386 + +
+ + +
+ + + + +