From nobody Mon May 6 08:42:38 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 1542226657801644.0288948439527; Wed, 14 Nov 2018 12:17:37 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 94EAD307882A; Wed, 14 Nov 2018 20:17:35 +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 E18CC5D98E; Wed, 14 Nov 2018 20:17:34 +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 9C7AB14B1C; Wed, 14 Nov 2018 20:17:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAEJr15J002928 for ; Wed, 14 Nov 2018 14:53:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id C5BF961493; Wed, 14 Nov 2018 19:53:01 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3ACF061480; Wed, 14 Nov 2018 19:52:59 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (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 D276080F96; Wed, 14 Nov 2018 19:52:57 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id q70so10513655qkh.6; Wed, 14 Nov 2018 11:52:57 -0800 (PST) Received: from localhost.localdomain ([2804:431:f700:6757:dabd:2c88:c24c:80fc]) by smtp.gmail.com with ESMTPSA id n3sm11048027qtc.81.2018.11.14.11.52.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Nov 2018 11:52:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wMd2p16M6rPGVZuMVbgMUpdMVrQ19aAoj5zY7B6N5y8=; b=kWIt9Uz8TUowAxJ64DAuZR56rO7+oc87rjpxFjpR0/izmQxF6Xzzxydx+vkgUItViM U97FESt8bwiRWs0/tynocgyJF5HZ0NEUtYQWo0MJTvnfujVPO2WZdb7BTSLRP2Tamevc oS6snlBlB1Q+ogHJ4TlfXVKC1AMnuYj/W3cKjUNeC3kDv1qoHeXt8/wX+S1oLIC1vBF9 ygj/dygcfdK+77FbmJyZFukkvizEJCPJvrR8sSRisObAygd5zFyPaaDV5SGYhiawLxh7 lxND3W8EQ1eRummQ0uwr3xuXHUk9JXHTZG+AqEAt8Itx+yMVdrsAfCbZkmA59N+IRmS3 3uSA== 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=wMd2p16M6rPGVZuMVbgMUpdMVrQ19aAoj5zY7B6N5y8=; b=nZ5MsRUYdZJY7U0EGnvSv7DgidzUgW5w8X8O6BZavKq/GWdxTQdPQFWUMLTz/Blfdy WlNpMCejg4qoRVz1Y2zKjFWr1mwe9AH7S+EH8I8V8yyHePQ05mg6tc9bwO46ujaXY/4Q IRyilzoyy1SOzMNgBaR9H2ndfNfR6wB0QldoqHBXx9MsEv4n1bIXi96+jcf6UUEmlRet PLjKS0PlR28nGonvqDKD7jlHyOCBbZcjuzRrTut73vbqDbow3G/ee2mZX89nB0vI4+fd 12wiezepmWFwnr0s9X/XlfKSnW/WbeVzpUNnsH8IGok1ZyU8g/IZ61kJimS8Ahi7+m4+ H1Fg== X-Gm-Message-State: AGRZ1gKKcKx8XOQESFWcJr5ScwUDGElWjBg4S71rPjP+2pptWkC5cBj2 TUa2kg40aFrsKIboFaGlI7Gb32E9Dss= X-Google-Smtp-Source: AJdET5eRRLmtGNcJ6khPmdoAdxnckjf3lGkbW/WYOVwjRHAp1pYglYu1r0cuLQb4wrKUm+PDlhDjWw== X-Received: by 2002:ac8:101a:: with SMTP id z26mr3178549qti.184.1542225176972; Wed, 14 Nov 2018 11:52:56 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 14 Nov 2018 17:52:03 -0200 Message-Id: <20181114195207.26863-2-danielhb413@gmail.com> In-Reply-To: <20181114195207.26863-1-danielhb413@gmail.com> References: <20181114195207.26863-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 14 Nov 2018 19:52:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 14 Nov 2018 19:52:58 +0000 (UTC) for IP:'209.85.222.196' DOMAIN:'mail-qk1-f196.google.com' HELO:'mail-qk1-f196.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.196 mail-qk1-f196.google.com 209.85.222.196 mail-qk1-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 1/5] qemu_process.c: adding maxCpus value to error message 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: , 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 14 Nov 2018 20:17:36 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Adding the maxCpus value in the error message of qemuValidateCpuCount allows the user to set an acceptable maxCpus count without knowing QEMU internals. x86 guests, that might have been created prior to the x86 qemuDomainDefValidate maxCpus check code (that validates the maxCpus value in editing time), will also benefit from this change. Signed-off-by: Daniel Henrique Barboza Reviewed-by: John Ferlan --- src/qemu/qemu_process.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 1850923914..84a2163743 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3900,8 +3900,9 @@ qemuValidateCpuCount(virDomainDefPtr def, } =20 if (maxCpus > 0 && virDomainDefGetVcpusMax(def) > maxCpus) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Maximum CPUs greater than specified machine type= limit")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Maximum CPUs greater than specified machine " + "type limit %u"), maxCpus); return -1; } =20 --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 08:42:38 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 1542228352190560.3645543796044; Wed, 14 Nov 2018 12:45:52 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01EE8C07753C; Wed, 14 Nov 2018 20:45:50 +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 92A5519750; Wed, 14 Nov 2018 20:45:48 +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 67BE418005AD; Wed, 14 Nov 2018 20:45:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAEJr15Z002927 for ; Wed, 14 Nov 2018 14:53:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id C3BF061484; Wed, 14 Nov 2018 19:53:01 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 270DC61493; Wed, 14 Nov 2018 19:53:01 +0000 (UTC) Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) (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 DA45230024FC; Wed, 14 Nov 2018 19:52:59 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id 131so28019304qkd.4; Wed, 14 Nov 2018 11:52:59 -0800 (PST) Received: from localhost.localdomain ([2804:431:f700:6757:dabd:2c88:c24c:80fc]) by smtp.gmail.com with ESMTPSA id n3sm11048027qtc.81.2018.11.14.11.52.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Nov 2018 11:52:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eVyi4p8hYGajgGIAspHU3SPauHfl4pvSB0bDW/fbHOE=; b=nqaWOdd1O7RzMLSiUWQV/1JFAbYq/a7yKbU+B3hp8NrczqSvU0kxHgPLxbKQquBBhH uo5OnEeR55Rbk5sKFCQ2vLqcEIdrg1eKLxSMR0hQ8R0awjRK/CE1IAfSNcH6Vc3qdmFK uWnYtvmD6rsWKq7BW0YHq2wXmDDCSqTnesFRxMw7LJaKJ5oLjIGTxWfgGdHST4Go/hTE 0S5GgClmeV+0IwKvFUZNLE8LzMxkZq4JlolvC8Uiue39/vn63wVfjVww5cgTE9fjDxvt /mrGBd+1bT5i5mDWn6QNfyHIM/1mjQ6gSYiaAMCUCsr3tP2uM+SonfWEdGlMZuUxw+4P 6U2A== 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=eVyi4p8hYGajgGIAspHU3SPauHfl4pvSB0bDW/fbHOE=; b=gD62EljGJ5xseupqEDNnn8HGNo0GmXjFBOlJP04qKtDQqQb+RlXjsnn/3p6+05BbZn vaVCkZGkZ7RhLI9HA2yqMM94Pr3oROSDi5XYXaOl64j9KAnXsUAgpPmS7Iom2P9+CKRy YEyHlcZtwMzdVzL4tAEogcIpMGgxbnD6zqZdYXdbIWfvcVfRa8MQA9ORGv8Ii9KfRniA PbC+v+fmYLld7Y2HsfjdzDREvWBqjbmf1DQfKUzTvK9sWACVTeLQvmt2WVkgfx5nm0Lv CQ7mQuY3/eNu/6W9cTisCEMx6Au0gqUMBKC+4WAOEIu2ttXdvxBsYyyV1XPSEPqqMRjc uuLA== X-Gm-Message-State: AGRZ1gKK0kFVS9/2hfgLIqkYPE4GDzjtblN+mJcdduR1JxAP50pUJc5P 8dGt0nryNn4yuSglnBV35Cvl1LF6IHA= X-Google-Smtp-Source: AJdET5ewoc7guErVuU8DgGCHJubRddB5+OARW8nEURdwZQjxYjNK13IVfOtXeVY0QLLQNkiwllGXhg== X-Received: by 2002:a37:455:: with SMTP id 82mr3179108qke.60.1542225179034; Wed, 14 Nov 2018 11:52:59 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 14 Nov 2018 17:52:04 -0200 Message-Id: <20181114195207.26863-3-danielhb413@gmail.com> In-Reply-To: <20181114195207.26863-1-danielhb413@gmail.com> References: <20181114195207.26863-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 14 Nov 2018 19:53:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 14 Nov 2018 19:53:00 +0000 (UTC) for IP:'209.85.222.194' DOMAIN:'mail-qk1-f194.google.com' HELO:'mail-qk1-f194.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.194 mail-qk1-f194.google.com 209.85.222.194 mail-qk1-f194.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 2/5] qemu_process.c: make qemuValidateCpuCount public 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 14 Nov 2018 20:45:50 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" qemuValidateCpuCount validates the maxCpus value of a domain at startup time, preventing it to start if the value exceeds a maximum. This checking is also done at qemu_domain.c, qemuDomainDefValidate. However, it is done only for x86 (and even then, in a specific scenario). We want this check to be done for all archs. To accomplish this, let's first make qemuValidateCpuCount public so it can be used inside qemuDomainDefValidate. The function was renamed to qemuProcessValidateCpuCount to be compliant with the other public methods at qemu_process.h. The method signature was slightly adapted to fit the const 'def' variable used in qemuDomainDefValidate. This change has no downside in in its original usage at qemuProcessStartValidateXML. Signed-off-by: Daniel Henrique Barboza Reviewed-by: John Ferlan --- src/qemu/qemu_process.c | 8 ++++---- src/qemu/qemu_process.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 84a2163743..4d134bd7be 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3887,9 +3887,9 @@ qemuProcessSPICEAllocatePorts(virQEMUDriverPtr driver, } =20 =20 -static int -qemuValidateCpuCount(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +int +qemuProcessValidateCpuCount(const virDomainDef *def, + virQEMUCapsPtr qemuCaps) { unsigned int maxCpus =3D virQEMUCapsGetMachineMaxCpus(qemuCaps, def->o= s.machine); =20 @@ -5152,7 +5152,7 @@ qemuProcessStartValidateXML(virQEMUDriverPtr driver, * If back compat isn't a concern, XML validation should probably * be done at parse time. */ - if (qemuValidateCpuCount(vm->def, qemuCaps) < 0) + if (qemuProcessValidateCpuCount(vm->def, qemuCaps) < 0) return -1; =20 /* checks below should not be executed when starting a qemu process fo= r a diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index 2037467c94..d3b2baac51 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -47,6 +47,9 @@ int qemuProcessDestroyMemoryBackingPath(virQEMUDriverPtr = driver, virDomainObjPtr vm, virDomainMemoryDefPtr mem); =20 +int qemuProcessValidateCpuCount(const virDomainDef *def, + virQEMUCapsPtr qemuCaps); + void qemuProcessReconnectAll(virQEMUDriverPtr driver); =20 typedef struct _qemuProcessIncomingDef qemuProcessIncomingDef; --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 08:42:38 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 1542228367006422.7508556366005; Wed, 14 Nov 2018 12:46:07 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 35D2830A4CB8; Wed, 14 Nov 2018 20:46:04 +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 0008C60BF6; Wed, 14 Nov 2018 20:46: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 8BA98181A96A; Wed, 14 Nov 2018 20:46:03 +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 wAEJr4dS002949 for ; Wed, 14 Nov 2018 14:53:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2F5A960C65; Wed, 14 Nov 2018 19:53:04 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2293660C45; Wed, 14 Nov 2018 19:53:03 +0000 (UTC) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (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 1633E8F50F; Wed, 14 Nov 2018 19:53:02 +0000 (UTC) Received: by mail-qk1-f175.google.com with SMTP id n12so28020949qkh.11; Wed, 14 Nov 2018 11:53:02 -0800 (PST) Received: from localhost.localdomain ([2804:431:f700:6757:dabd:2c88:c24c:80fc]) by smtp.gmail.com with ESMTPSA id n3sm11048027qtc.81.2018.11.14.11.52.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Nov 2018 11:53:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lklCvFRmpyqxr3oNJtUJnviihwjtc22fdzrY4k+0g4U=; b=vcMHsC0gruFkqIrZhSFo5cMkt9NTXxeohePTb9cji/75hjrQL25Qr2zbbgN93+CMCy aOZOJCKP6qlR0luXLaEF8EiHFWJHF6JgBajKoDvSYU4wF08VPAnpp/4lyukAZACDSzly xMwRPKJPdEocWrCWH4I7oYmULwVPpZ9bMf8zp9x/AwwOxfRUiUhj0PiBvT3O2MXzNUZC 65rP3+Q9SAwWbDe/+Nk8Sau99elikAZUdIbSEnjMnEh7UT7USaspNsZAEaQ2GPlT4TWX 7raU6iD0+9bvV31aQX2SJVMwHwYn70WVL2SriGHISZyjbad3S3k5hms+IFIYeDQT8070 qWOA== 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=lklCvFRmpyqxr3oNJtUJnviihwjtc22fdzrY4k+0g4U=; b=BXWCpDBVeQ8zZ1i+GGGWP9z8Hrp5uBQZ3ubMEDt1atpl+ILBMc99SFUWBewZ+qnS6z wJN/Lkmqou6Mv5/RwNRY97OC5aIchmjF6POqlwfQLH3DNUduJocSacBvpSZPgDxz/rT4 1M4/dGPNO7sT3VKNRa9CukenkuiyzObITXiAYc+RfqRZ4F0PyDi2Zk/PPZuYtEnrM5eX kfFVC0Ce+FmXpkC/XMcL99Klf2Oqxm0JUzpBWkhjlAxY8XZU3xtQ8mcYow2JXq1SLZTK +bgum6EXEo23hYezJFCOchGPlYCXU/Evflxtap4dIfM5DQM9XWJ8TsOaFhlUycAg1RGm 4E6Q== X-Gm-Message-State: AGRZ1gKLlKT/GoUXDjc09btvHvOBEM2fJq26lZAVdDZqi3FRP2gN143u ofEILAWm7khJgK5I7WrdWRKqs6M7ED4= X-Google-Smtp-Source: AJdET5eFi53u3TxFE1aFdTVX66hqwwV66GPHaPK1DJB13gCDL5tngOLCGoadyrQDchZZOJSZPoWoyA== X-Received: by 2002:a37:2bcf:: with SMTP id r76mr3056699qkr.218.1542225181094; Wed, 14 Nov 2018 11:53:01 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 14 Nov 2018 17:52:05 -0200 Message-Id: <20181114195207.26863-4-danielhb413@gmail.com> In-Reply-To: <20181114195207.26863-1-danielhb413@gmail.com> References: <20181114195207.26863-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 14 Nov 2018 19:53:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 14 Nov 2018 19:53:02 +0000 (UTC) for IP:'209.85.222.175' DOMAIN:'mail-qk1-f175.google.com' HELO:'mail-qk1-f175.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.175 mail-qk1-f175.google.com 209.85.222.175 mail-qk1-f175.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 3/5] qemu_domain.c: moving maxCpu validation to qemuDomainDefValidate 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 14 Nov 2018 20:46:05 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Adding maxCpu validation in qemuDomainDefValidate allows the user to spot over the board maxCpus counts at editing time, instead of facing a runtime error when starting the domain. This check is also arch independent. This leaves us with 2 calls to qemuProcessValidateCpuCount: one in qemuProcessStartValidateXML and the new one at qemuDomainDefValidate. The call in qemuProcessStartValidateXML is redundant. Following up in that code, there is a call to virDomainDefValidate, which in turn will call config.domainValidateCallback. In this case, the callback function is qemuDomainDefValidate. This means that, on startup time, qemuProcessValidateCpuCount will be called twice. To avoid that, let's also remove the qemuProcessValidateCpuCount call from qemuProcessStartValidateXML. Signed-off-by: Daniel Henrique Barboza Reviewed-by: John Ferlan --- src/qemu/qemu_domain.c | 4 ++++ src/qemu/qemu_process.c | 14 +------------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 37926850b2..3b86d28216 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4084,6 +4084,10 @@ qemuDomainDefValidate(const virDomainDef *def, } } =20 + if (qemuProcessValidateCpuCount(def, qemuCaps) < 0) { + goto cleanup; + } + if (ARCH_IS_X86(def->os.arch) && virDomainDefGetVcpusMax(def) > QEMU_MAX_VCPUS_WITHOUT_EIM) { if (!qemuDomainIsQ35(def)) { diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 4d134bd7be..2adbf375ee 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5140,21 +5140,9 @@ qemuProcessStartValidateDisks(virDomainObjPtr vm, static int qemuProcessStartValidateXML(virQEMUDriverPtr driver, virDomainObjPtr vm, - virQEMUCapsPtr qemuCaps, virCapsPtr caps, unsigned int flags) { - /* The bits we validate here are XML configs that we previously - * accepted. We reject them at VM startup time rather than parse - * time so that pre-existing VMs aren't rejected and dropped from - * the VM list when libvirt is updated. - * - * If back compat isn't a concern, XML validation should probably - * be done at parse time. - */ - if (qemuProcessValidateCpuCount(vm->def, qemuCaps) < 0) - return -1; - /* checks below should not be executed when starting a qemu process fo= r a * VM that was running before (migration, snapshots, save). It's more * important to start such VM than keep the configuration clean */ @@ -5204,7 +5192,7 @@ qemuProcessStartValidate(virQEMUDriverPtr driver, =20 } =20 - if (qemuProcessStartValidateXML(driver, vm, qemuCaps, caps, flags) < 0) + if (qemuProcessStartValidateXML(driver, vm, caps, flags) < 0) return -1; =20 if (qemuProcessStartValidateGraphics(vm) < 0) --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 08:42:38 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 1542226673491834.4188941590706; Wed, 14 Nov 2018 12:17:53 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FC6589AF6; Wed, 14 Nov 2018 20:17:51 +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 2B24219750; Wed, 14 Nov 2018 20:17:51 +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 D1EA4181A86C; Wed, 14 Nov 2018 20:17:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAEJrAjF002964 for ; Wed, 14 Nov 2018 14:53:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 38568600D6; Wed, 14 Nov 2018 19:53:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 212BE620D4; Wed, 14 Nov 2018 19:53:05 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (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 3A44E89AED; Wed, 14 Nov 2018 19:53:04 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id d19so28021212qkg.5; Wed, 14 Nov 2018 11:53:04 -0800 (PST) Received: from localhost.localdomain ([2804:431:f700:6757:dabd:2c88:c24c:80fc]) by smtp.gmail.com with ESMTPSA id n3sm11048027qtc.81.2018.11.14.11.53.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Nov 2018 11:53:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VDgD7kYovepeiQPoPG7JL0bE4nPBMp8E5Zi0vT/FxKs=; b=jLQAi5cF0+nZob/lKpK5Joc0ipeHOz5pHiO2XLVGtEdYGJ0JChGwzghv6iuF+/O/Xn iIkOxc3IdOqsNYPvB6sRObbQzSyZKHz75s4tQinVc3vVOnIDKlvUe38l+cJ5N664fol4 Nhgz4wKPbV4tdzUR3bDUpv9Co3A0T2N+1omwD6foQR2b8ikAep1skP5p84Wxi0X614Yg 7UfAWzCmz4vx59/IL0eGACtV4LvmRm7UGVrYUBHSqjezar7s/ad2zYfNlQPCRI6eflLu uBzck8u+d2PsaH364jHAV8qsEpO8Eky6oQ/wLYHBVoK9M5UXKoF4CykKBXG3WS1rXJqK lApw== 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=VDgD7kYovepeiQPoPG7JL0bE4nPBMp8E5Zi0vT/FxKs=; b=VjTCVZoHw5jc/FZdOIAJnv9ZzWKmDOvSKfDKXXI+IpTtFUuLxwX2LUvBsTae0j7NfN YfxvFipsDqY92PefffIsMqxrd4yOXC5PHmvwtNm6+rIhBWUo5fe5AvRt22y5rXkcnEjK hm3uXOY45U2ZEI1nN42c4hze4CFaYOijTx7N/M0/Yof9kE6k6eWkd6QAv7rghiwY5vyO sbXl/bzUJ8QSjn98mTVnXymdOZhFImkUPRYuSAN+J+zSe8Cmce/7mxO6rpQMKjHugKhf h3QVQZ1JJ7ox5NqbH2aw6w81g0HELvGlhccMrS56wtPuiVNrUGIMLItg7Jhbwh74LlmW h1Mw== X-Gm-Message-State: AGRZ1gKdBsfH9fNllE49G7krYbEYuBf07+IDmJxOnzU4JtudDE0ioLcD 78VYrrToe6oYHCfajpwdZWvX0YMcCpE= X-Google-Smtp-Source: AJdET5cpthfzpBLN+pivKXg1jZ4pWQJdJS3KrnX6HCjiXL9dfS5y3bFdYPRpcP4UrzN99gfmYGYX5w== X-Received: by 2002:a37:62d3:: with SMTP id w202mr3029381qkb.357.1542225183368; Wed, 14 Nov 2018 11:53:03 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 14 Nov 2018 17:52:06 -0200 Message-Id: <20181114195207.26863-5-danielhb413@gmail.com> In-Reply-To: <20181114195207.26863-1-danielhb413@gmail.com> References: <20181114195207.26863-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 14 Nov 2018 19:53:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 14 Nov 2018 19:53:04 +0000 (UTC) for IP:'209.85.222.196' DOMAIN:'mail-qk1-f196.google.com' HELO:'mail-qk1-f196.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.196 mail-qk1-f196.google.com 209.85.222.196 mail-qk1-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 4/5] qemu_process.c: moving qemuValidateCpuCount 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 14 Nov 2018 20:17:52 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Previous patch removed the call to qemuProcessValidateCpuCount from qemuProcessStartValidateXML, in qemu_process.c. The only caller left is qemuDomainDefValidate, in qemu_domain.c. Instead of having a public function declared inside qemu_process.c that isn't used in that file, this patch moves the function to qemu_domain.c, making in static and renaming it to qemuDomainValidateCpuCount to be compliant with other static functions names in the file. Signed-off-by: Daniel Henrique Barboza Reviewed-by: John Ferlan --- src/qemu/qemu_domain.c | 25 ++++++++++++++++++++++++- src/qemu/qemu_process.c | 23 ----------------------- src/qemu/qemu_process.h | 3 --- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3b86d28216..a0d69da646 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3990,6 +3990,29 @@ qemuDomainDefValidateMemory(const virDomainDef *def) } =20 =20 +static int +qemuDomainValidateCpuCount(const virDomainDef *def, + virQEMUCapsPtr qemuCaps) +{ + unsigned int maxCpus =3D virQEMUCapsGetMachineMaxCpus(qemuCaps, def->o= s.machine); + + if (virDomainDefGetVcpus(def) =3D=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Domain requires at least 1 vCPU")); + return -1; + } + + if (maxCpus > 0 && virDomainDefGetVcpusMax(def) > maxCpus) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Maximum CPUs greater than specified machine " + "type limit %u"), maxCpus); + return -1; + } + + return 0; +} + + static int qemuDomainDefValidate(const virDomainDef *def, virCapsPtr caps ATTRIBUTE_UNUSED, @@ -4084,7 +4107,7 @@ qemuDomainDefValidate(const virDomainDef *def, } } =20 - if (qemuProcessValidateCpuCount(def, qemuCaps) < 0) { + if (qemuDomainValidateCpuCount(def, qemuCaps) < 0) { goto cleanup; } =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 2adbf375ee..0d1dc7ed35 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3887,29 +3887,6 @@ qemuProcessSPICEAllocatePorts(virQEMUDriverPtr drive= r, } =20 =20 -int -qemuProcessValidateCpuCount(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) -{ - unsigned int maxCpus =3D virQEMUCapsGetMachineMaxCpus(qemuCaps, def->o= s.machine); - - if (virDomainDefGetVcpus(def) =3D=3D 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Domain requires at least 1 vCPU")); - return -1; - } - - if (maxCpus > 0 && virDomainDefGetVcpusMax(def) > maxCpus) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Maximum CPUs greater than specified machine " - "type limit %u"), maxCpus); - return -1; - } - - return 0; -} - - static int qemuProcessVerifyHypervFeatures(virDomainDefPtr def, virCPUDataPtr cpu) diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index d3b2baac51..2037467c94 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -47,9 +47,6 @@ int qemuProcessDestroyMemoryBackingPath(virQEMUDriverPtr = driver, virDomainObjPtr vm, virDomainMemoryDefPtr mem); =20 -int qemuProcessValidateCpuCount(const virDomainDef *def, - virQEMUCapsPtr qemuCaps); - void qemuProcessReconnectAll(virQEMUDriverPtr driver); =20 typedef struct _qemuProcessIncomingDef qemuProcessIncomingDef; --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 08:42:38 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 1542228376993787.573840942915; Wed, 14 Nov 2018 12:46:16 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 4679BC05D402; Wed, 14 Nov 2018 20:46:15 +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 03CBA5D759; Wed, 14 Nov 2018 20:46:15 +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 B132A4BB79; Wed, 14 Nov 2018 20:46:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAEJrA8O002965 for ; Wed, 14 Nov 2018 14:53:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3B6286051E; Wed, 14 Nov 2018 19:53:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB9246013F; Wed, 14 Nov 2018 19:53:07 +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 B7ADF3078A4C; Wed, 14 Nov 2018 19:53:06 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id o89so28038214qko.0; Wed, 14 Nov 2018 11:53:06 -0800 (PST) Received: from localhost.localdomain ([2804:431:f700:6757:dabd:2c88:c24c:80fc]) by smtp.gmail.com with ESMTPSA id n3sm11048027qtc.81.2018.11.14.11.53.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Nov 2018 11:53:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=udD2hMlAnWzqKZkWty0wiTNTZl30FwwU8mwxmnHkyX4=; b=VrPVyX1asbzW6lIUkx6ln/ETBOQKV3Ngou4jLudK++XPfVr/p1zu3Vl3m/G+Ec5wXf BWchxIEQ79cVCmF7ZedxauS8TnGSguK2qldDHEOx0D+3k3/AvQT4XLqyV8LZVks6KWYq sOxdoPplrjIk/Sf+d6MROKp7N8hiVGThWMHk29a7z/i4veolVkt5kVFofLXIY0c4tCgH k0cf63EALN4dhF8tqqr0ueWB3sKIF+jHo6Ywhxgqq2csioVXqivHkIvXJlw64CBpcKIA PEzvQMxnAVuT7NzBpl+9bQMo8U1aOrUVUS+hQhkfwt9SjxaBVVf5rjY1ml6zxxntW5Dh iKWg== 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=udD2hMlAnWzqKZkWty0wiTNTZl30FwwU8mwxmnHkyX4=; b=tw+pUcPo1bb739iUTd8lYXkcB0HKLRa3tAsw8/XK8F42XJYtiL9uNDeWHd+DJX6ZUc 2bERnbApvXKr4Zs03DMw286Rg8ioxT8pjcRxORaTkFaaDcl7RQXfLqK1qBE0eVGxxH96 7B7NkKVhMb31S9s/Kx2FRn316u87w+lJVqgXDIg+2sbeU4IUIMI5hkCXS/6qNH7lIVoL wws+MxUqsKPhsmVxc6YQmIMOpgyfPuSBSwtbua6Js6UTmRMxVN4shTOrebCfRUNR/rSH pN4/CrOAVrn8vLSC3rhVlAn/F/V7zGmsfOglwXbX2IC+FFvxs9M7GgfwF/gGj6jYnRmh jEmQ== X-Gm-Message-State: AGRZ1gLIDc81EYdG6o3kxh4HF27mrVSnjLuTIMPgvWRxOVfVpdzVYLxj e6LOOUu5TA7Sb4OtZBnoFKPWaHsdbfo= X-Google-Smtp-Source: AJdET5dBxeF44Qd0hlX0MIZpEMloe4tct3qS0aim5RXwfJcptUzX81T9vnGxbtpNfBAnY8wRoknnSQ== X-Received: by 2002:a37:b785:: with SMTP id h127mr3096631qkf.294.1542225185876; Wed, 14 Nov 2018 11:53:05 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 14 Nov 2018 17:52:07 -0200 Message-Id: <20181114195207.26863-6-danielhb413@gmail.com> In-Reply-To: <20181114195207.26863-1-danielhb413@gmail.com> References: <20181114195207.26863-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 14 Nov 2018 19:53:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 14 Nov 2018 19:53:06 +0000 (UTC) for IP:'209.85.222.193' DOMAIN:'mail-qk1-f193.google.com' HELO:'mail-qk1-f193.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, 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.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 5/5] qemu_process.c: removing qemuProcessStartValidateXML 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: , 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 14 Nov 2018 20:46:15 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Commit ("qemu_domain.c: moving maxCpu validation to qemuDomainDefValidate") shortened the code of qemuProcessStartValidateXML. The function is called only by qemuProcessStartValidate, in the same file, and its code is now a single check that calls virDomainDefValida= te. Instead of leaving a function call just to execute a single check, this patch puts the check in the body of qemuProcessStartValidate in the place where qemuProcessStartValidateXML was being called. The function can now be removed. Signed-off-by: Daniel Henrique Barboza Reviewed-by: John Ferlan --- src/qemu/qemu_process.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 0d1dc7ed35..c9ef2050a1 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5114,23 +5114,6 @@ qemuProcessStartValidateDisks(virDomainObjPtr vm, } =20 =20 -static int -qemuProcessStartValidateXML(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCapsPtr caps, - unsigned int flags) -{ - /* checks below should not be executed when starting a qemu process fo= r a - * VM that was running before (migration, snapshots, save). It's more - * important to start such VM than keep the configuration clean */ - if ((flags & VIR_QEMU_PROCESS_START_NEW) && - virDomainDefValidate(vm->def, caps, 0, driver->xmlopt) < 0) - return -1; - - return 0; -} - - /** * qemuProcessStartValidate: * @vm: domain object @@ -5169,7 +5152,11 @@ qemuProcessStartValidate(virQEMUDriverPtr driver, =20 } =20 - if (qemuProcessStartValidateXML(driver, vm, caps, flags) < 0) + /* Checks below should not be executed when starting a qemu process fo= r a + * VM that was running before (migration, snapshots, save). It's more + * important to start such VM than keep the configuration clean */ + if ((flags & VIR_QEMU_PROCESS_START_NEW) && + virDomainDefValidate(vm->def, caps, 0, driver->xmlopt) < 0) return -1; =20 if (qemuProcessStartValidateGraphics(vm) < 0) --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list