From nobody Sun Feb 8 10:09:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1575933375; cv=none; d=zohomail.com; s=zohoarc; b=K2IxIg/4NDSEPNDGhJzX8ZmAV2OorIMwM+P7V4wXomvbuu11IrwNUnn1CohfmmwZ8rpPJb9wCye7U/iUXOHRUim5iluBMbSRINYWG/3QmDAIToWiKvALyY1sjnJC3fqhUGwNLdAE2qW0nmXilk9FqiTwYfOvBxC6p6NG8Azw4lU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575933375; 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=AhOu6PrUwW5lBFXhnVpI2Ak75swL7pQiVuLX56N66J8=; b=TH3Gr6rsIEpZPB64CO0NFbx+C6p4/UTfVxByikzllGeQCwWF/hDJSJgUxKOkvwcJF/5YqGLAYVZxMpQ/yMBO+9O8MjHm54ANvz5E0kVPFfzZpCyleNrO8AQ6ZUktOIhI/cSj4PXfdhFqjvFoHiSC5wnWZ0hWETI8xLH+sCUNE6E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= 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 1575933375089672.8636418248761; Mon, 9 Dec 2019 15:16:15 -0800 (PST) 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-54-B5G1RsPMNhWvWEWeWz4xbg-1; Mon, 09 Dec 2019 18:16:11 -0500 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 A69EB107ACC5; Mon, 9 Dec 2019 23:16:03 +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 7BEC61001B09; Mon, 9 Dec 2019 23:16:03 +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 3564283556; Mon, 9 Dec 2019 23:16:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB9NFqsQ008294 for ; Mon, 9 Dec 2019 18:15:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id 302822166B29; Mon, 9 Dec 2019 23:15:52 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2BB202166B27 for ; Mon, 9 Dec 2019 23:15:52 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 127E7900178 for ; Mon, 9 Dec 2019 23:15:52 +0000 (UTC) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-218-yIY3xIMqNLygcLzVgQp1_w-1; Mon, 09 Dec 2019 18:15:50 -0500 Received: by mail-qt1-f171.google.com with SMTP id 5so962419qtz.1; Mon, 09 Dec 2019 15:15:50 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:fe5:8243:c780:f073:3beb]) by smtp.gmail.com with ESMTPSA id e130sm352436qkb.72.2019.12.09.15.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 15:15:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575933373; 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=AhOu6PrUwW5lBFXhnVpI2Ak75swL7pQiVuLX56N66J8=; b=bKRPTQuem03qo4HMGgOYteH1e9w7cdv7ty2vctgaG0Ps2G3dOrEhHjGN83rRmUl/9Dx31Q R3oCJB99KOMOZCgmo/sTRlV0+slRX4v6yuluY0m429UJ026Xtppv9l1rzQH1xIlWTP+bsV 4xt6JeWmPRukkCaFItRJ+otaRFVSlvc= 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:mime-version:content-transfer-encoding; bh=zAuCydqD950HUPKY4M8K695MCpXdATxoN7Q+FEt6T+U=; b=azJ2I2zVINlOgW+fGib8dziP3XXoVuAChDzj4dfeukDRWKE8GWTLuO1PxV3rGSf43j S9Qf+J2qDze9nSbkaTnfsSqWnbgva2qHX8Bcbz422knB23mN/RjJCjCFsnZh74iB4a8p CJm5nQD6tqYyIfrPk4N9zBuj3fuJm2KJ8Hu0KgXmUTD1OgfvHLDHZ8HfetKoxT1aIOAl Qhuh8F03YKlzDvrJ6GWQzTuKUoRv2DmNUs7QegA+BSvfBnmaXkaMfIClY1/DoQ5L8m5A iZyHBRYIAU7glgCP5qHo7G4jeQwBRo8/9501Ks5BbNEbD78oNGS5MeR2FTiytnC3Rkqj 7yhA== X-Gm-Message-State: APjAAAVXaaJ7BKiUcFX2JLf4lsZaKi+WcRQ9Q+LXe4S+Ws22VZ2b4nGF q3T47cY8VqaLwrvEToJ0jbXf6uma6iU= X-Google-Smtp-Source: APXvYqwWSkWQNpaCJ7h9FEJefrlda4Jmc+PfEkUXfpSTmvcl9TTw5iOjBM5z4igWYBZzfNFtCEwEgA== X-Received: by 2002:ac8:21ae:: with SMTP id 43mr15519794qty.223.1575933349772; Mon, 09 Dec 2019 15:15:49 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 9 Dec 2019 20:15:09 -0300 Message-Id: <20191209231531.2423222-5-danielhb413@gmail.com> In-Reply-To: <20191209231531.2423222-1-danielhb413@gmail.com> References: <20191209231531.2423222-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: yIY3xIMqNLygcLzVgQp1_w-1 X-MC-Unique: B5G1RsPMNhWvWEWeWz4xbg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id xB9NFqsQ008294 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , crobinso@redhat.com Subject: [libvirt] [PATCH v1 04/26] qemu_command.c: move nvdimm validation to qemu_domain.c 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: , 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-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" QEMU_CAPS_DEVICE_NVDIMM validation is now being done inside qemuDomainDefValidateMemory(). Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_command.c | 5 ----- src/qemu/qemu_domain.c | 10 ++++++++++ tests/qemuxml2xmltest.c | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e7365ba86a..25886bf49a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7180,11 +7180,6 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, =20 for (i =3D 0; i < def->nmems; i++) { if (def->mems[i]->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("nvdimm isn't supported by this QEMU bina= ry")); - return -1; - } virBufferAddLit(&buf, ",nvdimm=3Don"); break; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d62e13f26c..8eb0905f22 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5021,6 +5021,7 @@ qemuDomainDefValidateMemory(const virDomainDef *def, { const long system_page_size =3D virGetSystemPageSizeKB(); const virDomainMemtune *mem =3D &def->mem; + size_t i; =20 if (mem->nhugepages =3D=3D 0) return 0; @@ -5066,6 +5067,15 @@ qemuDomainDefValidateMemory(const virDomainDef *def, return -1; } =20 + for (i =3D 0; i < def->nmems; i++) { + if (def->mems[i]->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("nvdimm isn't supported by this QEMU binary")= ); + return -1; + } + } + return 0; } =20 diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 4353c7a6b8..0e2933e13e 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -302,7 +302,7 @@ mymain(void) DO_TEST("hugepages-shared", NONE); DO_TEST("hugepages-memaccess", NONE); DO_TEST("hugepages-memaccess2", NONE); - DO_TEST("hugepages-nvdimm", NONE); + DO_TEST("hugepages-nvdimm", QEMU_CAPS_DEVICE_NVDIMM); DO_TEST("nosharepages", NONE); DO_TEST("restore-v2", NONE); DO_TEST("migrate", NONE); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list