From nobody Sun Feb 8 14:12:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1575933364; cv=none; d=zohomail.com; s=zohoarc; b=jRGbAyNZwH51A0ywsprY+JwooNweCbtYpHF0i/iEy6MU7QEq4NUyQO1Lhq59bGzQ7LvpSy8DmVfkOnA8G9Oy5Zrz4nt4BB6OtvGfvxiSkJvj6aJ6E6qBvAuCaot6+L7kZTMMU7vDzeBRKChfzdo6Kp35n/cf2vkCMn2n8tTYUT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575933364; 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=kI+hCC5/FQsZB1n82QweMxDznZ/C1W4hD2+jEjmzUWs=; b=JQB4+01cT1wO94Qh3xEGme0qykdsvCeT2s9FBJvqao2SMEm7BLapdafubOacxCgye3/1s0diOu3OTkvGN31F4ByNAaQZgqvpmv+0OppoaQgDnfSmrTWsREfN3dhpIqRBV2Zq2cjtwz/nSOT4aXayHfidkyOW3wdgH9jlUV5p3Po= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1575933364485648.2296585778498; Mon, 9 Dec 2019 15:16:04 -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-257-HFeYkggAMJ60x1zwDDUwDg-1; Mon, 09 Dec 2019 18:16:01 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2692218B5F73; Mon, 9 Dec 2019 23:15:56 +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 E2FA2995E; Mon, 9 Dec 2019 23:15:55 +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 F0E3218089CE; Mon, 9 Dec 2019 23:15:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB9NFrH0008304 for ; Mon, 9 Dec 2019 18:15:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 24C751006EAD; Mon, 9 Dec 2019 23:15:53 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1EC781006EBC for ; Mon, 9 Dec 2019 23:15:52 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 E5D4390B970 for ; Mon, 9 Dec 2019 23:15:51 +0000 (UTC) Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-227-6abegNjBOC-uTeqBBCgprw-1; Mon, 09 Dec 2019 18:15:48 -0500 Received: by mail-qk1-f174.google.com with SMTP id r14so6631309qke.13; Mon, 09 Dec 2019 15:15:48 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 15:15:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575933363; 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=kI+hCC5/FQsZB1n82QweMxDznZ/C1W4hD2+jEjmzUWs=; b=jSUP+JN6Xpid9GyUpEoqPuPmYO0SAp7UyVQjsukx+x87zXsbLOG7GNuf5XQG0xW2YiD5CH sbMnQGG4WDwQK/828AmPAyZ5p3WJcjzi0QEH+Y5ZdiLvG3Eag1rfRUwuf+S3FiLE95ELxz 6RvKkzo4h5Td1ct5wzn3d7V//LqcSPc= 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=3hbtyE8z0GjLq4BIYOQggLGPToGaJmOPhVpZGAehdzo=; b=n04M+34ZRh7/TStOpHlBfR1mqOFa1r/u3opiVJNubPf44BQZorp2y4NYp5aip8zizI RqJjat1PSet4V/kGMM2ARM5oMXlVlkAYfKOfwDATk/PkQvsrVHIJA8PAPidBpBn0mUf4 58vZKviP4JTKF2HG3W8yATD3QwCo6Dd9mnStqlVSHkfukdd3VDe5HMCNMbCpvKlLThMd B7wEmaleXDl5jNMQIO34Ibdn0HFCSQy1G2UXme5cSNLmkDACOs09UgXKdaa7yvyybzB7 i92nBFcK4LSMhNzNrpVuRNTQnxcuOeXeMAdU+6Sc/nXbuHIMPlxLDyEJvz9L80AkXHmO E/zA== X-Gm-Message-State: APjAAAXK0nVgOJtW4POPs/htWeF8GWvlK27ikuWqJbFjtRTs4W7YsgkX 4Ztu18Z2muyLEuZ1AbsyPXz2VMUdiz0= X-Google-Smtp-Source: APXvYqxxGgqIASyuJ1l8cEwXA/XNBSn/+NLH8lDmLLX6//MEno+NLr0Ixt+6zZemZPXBansMa9GtFA== X-Received: by 2002:a37:9245:: with SMTP id u66mr30981341qkd.102.1575933348226; Mon, 09 Dec 2019 15:15:48 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 9 Dec 2019 20:15:08 -0300 Message-Id: <20191209231531.2423222-4-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: 6abegNjBOC-uTeqBBCgprw-1 X-MC-Unique: HFeYkggAMJ60x1zwDDUwDg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id xB9NFrH0008304 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , crobinso@redhat.com Subject: [libvirt] [PATCH v1 03/26] qemu_command.c: move validation of vmport 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.23 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" virQEMUCapsSupportsVmport() is now being called inside qemuDomainDefValidateFeatures() for VIR_DOMAIN_FEATURE_VMPORT feature. qemuxml2xmltest.c was changed to account for this caps being now validated at domain define time. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_command.c | 10 +--------- src/qemu/qemu_domain.c | 12 +++++++++++- tests/qemuxml2xmltest.c | 3 ++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a56f324af2..e7365ba86a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7097,17 +7097,9 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, */ virBufferAddLit(&buf, ",usb=3Doff"); =20 - if (vmport) { - if (!virQEMUCapsSupportsVmport(qemuCaps, def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("vmport is not available " - "with this QEMU binary")); - return -1; - } - + if (vmport !=3D VIR_TRISTATE_SWITCH_ABSENT) virBufferAsprintf(&buf, ",vmport=3D%s", virTristateSwitchTypeToString(vmport)); - } =20 if (smm) virBufferAsprintf(&buf, ",smm=3D%s", virTristateSwitchTypeToString= (smm)); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d78c5904ff..d62e13f26c 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4983,6 +4983,17 @@ qemuDomainDefValidateFeatures(const virDomainDef *de= f, } break; =20 + case VIR_DOMAIN_FEATURE_VMPORT: + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ABSENT && + !virQEMUCapsSupportsVmport(qemuCaps, def)) { + + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("vmport is not available " + "with this QEMU binary")); + return -1; + } + break; + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: @@ -4993,7 +5004,6 @@ qemuDomainDefValidateFeatures(const virDomainDef *def, case VIR_DOMAIN_FEATURE_PVSPINLOCK: case VIR_DOMAIN_FEATURE_CAPABILITIES: case VIR_DOMAIN_FEATURE_PMU: - case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_VMCOREINFO: case VIR_DOMAIN_FEATURE_MSRS: case VIR_DOMAIN_FEATURE_LAST: diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index e5bbd8dec4..4353c7a6b8 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -840,7 +840,8 @@ mymain(void) QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_HDA_DUPLEX, - QEMU_CAPS_USB_REDIR); + QEMU_CAPS_USB_REDIR, + QEMU_CAPS_MACHINE_VMPORT_OPT); DO_TEST("pcie-root", QEMU_CAPS_DEVICE_IOH3420, QEMU_CAPS_ICH9_AHCI, --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list