From patchwork Tue Apr 17 18:40:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 133581 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp5037801ljb; Tue, 17 Apr 2018 11:40:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/TALXEyw0xMCf7eXfzrQ5WInuCXi5pbzwqAAROndpbc/6y40WOjHG7mXQKa3RaGZFei8Kx X-Received: by 2002:a9d:5f87:: with SMTP id g7-v6mr1867797oti.139.1523990420971; Tue, 17 Apr 2018 11:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523990420; cv=none; d=google.com; s=arc-20160816; b=ZSKEr1Biuq1UjS+8BHCz0VNWKalo7tOFFk8eqXdd7I0YDQ6ZrS3aAgIEL1fDUZEw9F JCEt8KHH0GGnsSKqxggscVimsAC6qSxAhs3UPvE+Bwg5POI35N7J86XFwDsZFEZE9im/ ZZ5CrL7s0+bdCxjDls/qUsYVRumCDparoVQh4FcP9fcwo+E8fIHzPZcb0bR2yYs20rkh xIj2Ur7vFlYYYhqhS3mwE3xQh5kUYGQZrCewld8JGIBN3tj3GeYkwlbWirZM9H2HLJOY J40UlnEkpIpHbbLQ0gOgbUQqkSvhe3fiWRUUi8g0m8PCkZ8xtygGI/8LkqDnQm/pyAO7 Un/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=FyVxhqFxmciOZlJw9QAxma25WBVTtz3BASJhze548pc=; b=GSpJbMAG+rGJuDeOeYgV1xP0SC/WzThne4503cNft6oVnGVr/nc5qfwW76ErMjtzab 1BcmVAKFPNq/x67KwrO/0uVHE48kiDPAfBUBrWCWwR+p/mMBaAcn8C4diOMJTrz/2jSY HnB1vHo+MiAFJVsJrPrh0HGTaHkXA6YTsVANL+n4xPeLPYZ+c94VCL3ajHXPhatVe0Oo aHt+4tZ6rJD/zVo5LhEuMRUq/VGcX+P4Ayxz0YyIJKeKbn8OwTJQg1LeLwNpt68dPCnt FLcRZ+Df4NqIiQUR1kh4Rdm6khgpLY1iytZsWu8vz4uDokW9QlgfA0zLc+8+7z+nBNcS s/uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id a10-v6si5591555oth.45.2018.04.17.11.40.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Apr 2018 11:40:20 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B6A143164228; Tue, 17 Apr 2018 18:40:19 +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 32A961899A; Tue, 17 Apr 2018 18:40:19 +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 B6C1C4CA9C; Tue, 17 Apr 2018 18:40:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3HIeF1l031793 for ; Tue, 17 Apr 2018 14:40:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8214F2023235; Tue, 17 Apr 2018 18:40:15 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-157.bos.redhat.com [10.18.17.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53EFD2023227; Tue, 17 Apr 2018 18:40:15 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 17 Apr 2018 14:40:10 -0400 Message-Id: <97094e3df1ef092f1b1aa2c19a118f3fd91837e2.1523989580.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [libvirt] [PATCH 1/3] conf: format/parse as tristate X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 17 Apr 2018 18:40:20 +0000 (UTC) is a bare boolean XML property. We don't really use this format anymore and instead prefer tristate since it's required for modeling on/off/default. If for example future qemu started enabling vmcoreinfo by default we wouldn't have any way for the user to turn this off. Convert it to tristate. For writing XML this is semanticly the same, is processed as . For apps reading guest XML this is technically an API change, as they might misinterpret , however this has only been present in libvirt since 3.10.0 and I don't think any apps are dependent on this yet Signed-off-by: Cole Robinson --- src/conf/domain_conf.c | 4 ++-- tests/qemuxml2xmloutdata/vmcoreinfo.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: John Ferlan diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4dad8e3b2..648057ad4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19281,7 +19281,6 @@ virDomainDefParseXML(xmlDocPtr xml, case VIR_DOMAIN_FEATURE_VIRIDIAN: case VIR_DOMAIN_FEATURE_PRIVNET: case VIR_DOMAIN_FEATURE_HYPERV: - case VIR_DOMAIN_FEATURE_VMCOREINFO: case VIR_DOMAIN_FEATURE_KVM: def->features[val] = VIR_TRISTATE_SWITCH_ON; break; @@ -19300,6 +19299,7 @@ virDomainDefParseXML(xmlDocPtr xml, } break; + case VIR_DOMAIN_FEATURE_VMCOREINFO: case VIR_DOMAIN_FEATURE_HAP: case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_PVSPINLOCK: @@ -26870,7 +26870,6 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_PAE: case VIR_DOMAIN_FEATURE_VIRIDIAN: - case VIR_DOMAIN_FEATURE_VMCOREINFO: case VIR_DOMAIN_FEATURE_PRIVNET: switch ((virTristateSwitch) def->features[i]) { case VIR_TRISTATE_SWITCH_ABSENT: @@ -26891,6 +26890,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, break; + case VIR_DOMAIN_FEATURE_VMCOREINFO: case VIR_DOMAIN_FEATURE_HAP: case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_PVSPINLOCK: diff --git a/tests/qemuxml2xmloutdata/vmcoreinfo.xml b/tests/qemuxml2xmloutdata/vmcoreinfo.xml index d0cd2f2ce..48b75d7d4 100644 --- a/tests/qemuxml2xmloutdata/vmcoreinfo.xml +++ b/tests/qemuxml2xmloutdata/vmcoreinfo.xml @@ -9,7 +9,7 @@ - + destroy From patchwork Tue Apr 17 18:40:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 133583 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp5038021ljb; Tue, 17 Apr 2018 11:40:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/NfZ8dIM04zNzDQrn5T7DwQIATNcT5uC4buLqoLfN2disIJFCvO5fn0cdtGc2Qw0w6XRKD X-Received: by 2002:a9d:51ce:: with SMTP id d14-v6mr2059061oth.386.1523990436799; Tue, 17 Apr 2018 11:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523990436; cv=none; d=google.com; s=arc-20160816; b=UdOSBiayOJgDQwqUTRwU2hJWbvuckSd+b+/G7113XDnkp9K3YeS1+Kgbsd219oD2v9 ngeTbC62IiQbkshUDrLYsgiVC+gIyhuFtdlV/9G/t1KnuynHkxTEvut/sJ8PzLeA43iP UNfzZVpmxaPfXTEOt0cVUUWgj/G4d4BSWZRkaEGPhjdJLTStcrX+nnAe3b/hTD5snak4 r4birxQ8Uxw/CYEHzNfCgM7SSzzZrdMkMSmWuFEQ2dHSkfawXhg1jIXd2yG0/+NbxwFR 7lpQuhX0GR7RafjyGaCH73G1L3+lUy96SC2l06Lg9Zglk2maIq+CGHu6fPBXDJNltKr3 IlSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=OtWr3vnfe3StCCNKAzBg1ABjJDA99dNnvBvhSJ3JrdE=; b=XCGgFRGmm0/F9ooy9p/XHaxzE3no5lIcRUdgIqVsOI7uOxBPcLr5dcD2XtSrPwjOdx ++/kAdLgvztkT+gIRVdcpIJ6CYp8kestY1rgi21+Y+n+zi3srya+LhxaRNRaH4WDdxOx PwaIdPx67fz0G/rE5P4RgNJIMSveFbtwUmOYc7zECxesv+hMG/PYqNlh4xyWsishkdKk P8ZkSTeeizGLCv9W+z4gtOqmzFAabODW2L+unRpPeA7K8OI5nWCikRgTYzUjUtfgVf1c ZzTPn59ofjxviM4sv5QmUjYgeTP1rYgzMwylXbNIJfneSOVy0JQ8gz2Ea9c7i/WjPmca rrGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id r35-v6si5820110ote.425.2018.04.17.11.40.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Apr 2018 11:40:36 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 6349E81DE4; Tue, 17 Apr 2018 18:40:35 +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 28A297ED44; Tue, 17 Apr 2018 18:40:35 +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 D76A8180BAD3; Tue, 17 Apr 2018 18:40:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3HIeFuX031801 for ; Tue, 17 Apr 2018 14:40:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id BEDEC200BCCE; Tue, 17 Apr 2018 18:40:15 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-157.bos.redhat.com [10.18.17.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90E242023227; Tue, 17 Apr 2018 18:40:15 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 17 Apr 2018 14:40:11 -0400 Message-Id: <18601ec4d9e0e022f5d411eb60051114b7b462ab.1523989580.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [libvirt] [PATCH 2/3] conf: Add a comment warning about boolean feature XML X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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.25]); Tue, 17 Apr 2018 18:40:35 +0000 (UTC) This is the old style and we really shouldn't be adding any more examples like this. Add a comment to warn devs away Signed-off-by: Cole Robinson --- docs/schemas/domaincommon.rng | 6 +++++- src/conf/domain_conf.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) -- 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: John Ferlan diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4cab55f05..015c5b737 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5036,7 +5036,11 @@ - + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 648057ad4..e303c503e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -26871,6 +26871,8 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_FEATURE_PAE: case VIR_DOMAIN_FEATURE_VIRIDIAN: case VIR_DOMAIN_FEATURE_PRIVNET: + /* NOTE: This is for old style booleans. New XML + * should use the explicit state=on|off output below */ switch ((virTristateSwitch) def->features[i]) { case VIR_TRISTATE_SWITCH_ABSENT: break; From patchwork Tue Apr 17 18:40:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 133584 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp5038095ljb; Tue, 17 Apr 2018 11:40:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx48O7HLx3/i/zw6FQfXm+WuI0JdSvSsxT0wkEz/UYFJbeGZEnBa9PdPJl+TQFiSkhvvKuPfX X-Received: by 2002:aca:d9d6:: with SMTP id q205-v6mr1866317oig.193.1523990441079; Tue, 17 Apr 2018 11:40:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523990441; cv=none; d=google.com; s=arc-20160816; b=QtC0Bxk3+GnJ+ixxiFfFLY0/1+CYKCRh1/KKvhhL2p8/BO5Cqs7lC85npUR+1bYbcU EArHZZu28O00pA7mUpIncgMYoKsxqA52y16QWr3gb+tCfphjGDPe9RubyI+OYKLlpuAL h2ThtKmr8Sr7lI3rcl2oHPvWKg8Uoot4x9Ez7X4b0y04QjYoz5PZzDqLwpQH3iF2D5Ee w9aSV/yUWgS+3Gu7hswQRsjE2RDrhFWnzNOK9WI2dM08lzlQ8ScS19PBPsCWts0YPqz8 w2ZejCoR9iKkFC6NyBPILdSkMHMs3B2kXEkdEQXN2SadhSOLvgw/aWY/xw7BnrTgnBgE CI6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=D7b2mMlqllvWyf11G7KbTcsPyoZ/dhX5Cq/W6bs6tfw=; b=KWT0VlsMPdzghbLx9PlFymy+8x8PlOKHm1uuwd6OxsiSLdGUQqWOfKb2xOkkxmeuxr r2bzRLyq1oY1wxpgpU9+WuLGNdAmtAiHEqRBnCu7ss10pbwQMXtBQEWsvzaXADIp+Cxb +Zy7ix2CXJJBYVswqXToZv8pXpWzEdfObYV22qRA2GvlYhfGJt+KaHDd7LQYtXP5v6C5 AunkizcMU7/PiMMxSBIOjcOoaAipprW3W/485ASJZ/pZEBE2CfktwhtTDzO+AiLWPW4R AzD6Y0v+5z7qOsxPU4jOMAQZAsIH2BG5zX1E+MFiz6GuMRB9Q2nfHia3Nvqoogj/OBAE 9MZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id n31-v6si5528565otn.125.2018.04.17.11.40.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Apr 2018 11:40:41 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C89F316423E; Tue, 17 Apr 2018 18:40:39 +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 3CBC0177EA; Tue, 17 Apr 2018 18:40:39 +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 CE10418033EB; Tue, 17 Apr 2018 18:40:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3HIeGOU031806 for ; Tue, 17 Apr 2018 14:40:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0F3682023587; Tue, 17 Apr 2018 18:40:16 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (dhcp-17-157.bos.redhat.com [10.18.17.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD9932024CA1; Tue, 17 Apr 2018 18:40:15 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 17 Apr 2018 14:40:12 -0400 Message-Id: <736bd8df7acb3633530a9fc3a0a219be7032a042.1523989580.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [libvirt] [PATCH 3/3] domain_capabilities: Report support X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 17 Apr 2018 18:40:40 +0000 (UTC) Report domaincaps if the guest config accepts Signed-off-by: Cole Robinson --- This bucks the domaincapabilities trend of always having a child enum if supported='yes'. Following that trend we would give us this XML when vmcoreinfo is supported: on off Which is verbose but fine. But it's unclear what we do in the case when vmcoreinfo isn't supported... do we do: which may not be entirely accurate because the code will still accept . Or do we do: off Which is weird IMO. I'm not certain what the semantics of 'supported' are meant to be so I went with this minimal option but I'm not tied to it docs/formatdomaincaps.html.in | 5 +++++ docs/schemas/domaincaps.rng | 7 +++++++ src/conf/domain_capabilities.c | 2 ++ src/conf/domain_capabilities.h | 1 + src/qemu/qemu_capabilities.c | 3 +++ tests/domaincapsschemadata/basic.xml | 1 + tests/domaincapsschemadata/bhyve_basic.x86_64.xml | 1 + tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml | 1 + tests/domaincapsschemadata/bhyve_uefi.x86_64.xml | 1 + tests/domaincapsschemadata/full.xml | 1 + tests/domaincapsschemadata/libxl-xenfv-usb.xml | 1 + tests/domaincapsschemadata/libxl-xenfv.xml | 1 + tests/domaincapsschemadata/libxl-xenpv-usb.xml | 1 + tests/domaincapsschemadata/libxl-xenpv.xml | 1 + tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml | 1 + tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml | 1 + tests/domaincapsschemadata/qemu_2.12.0.s390x.xml | 1 + tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml | 1 + tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 + tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml | 1 + tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.7.0.s390x.xml | 1 + tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.8.0.s390x.xml | 1 + tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml | 1 + tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml | 1 + 30 files changed, 43 insertions(+) -- 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: John Ferlan diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in index 6bfcaf61c..acdc1cf8a 100644 --- a/docs/formatdomaincaps.html.in +++ b/docs/formatdomaincaps.html.in @@ -417,6 +417,7 @@ <value>3</value> </enum> </gic> + <vmcoreinfo supported='yes'/> </features> </domainCapabilities> @@ -441,5 +442,9 @@ gic element. +

vmcoreinfo

+ +

Reports whether the vmcoreinfo feature can be enabled

+ diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng index 39053181e..bace0e44a 100644 --- a/docs/schemas/domaincaps.rng +++ b/docs/schemas/domaincaps.rng @@ -173,6 +173,7 @@ + @@ -184,6 +185,12 @@ + + + + + + diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index f7d9be50f..ccdccd695 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -587,6 +587,8 @@ virDomainCapsFormat(virDomainCapsPtr const caps) virBufferAdjustIndent(&buf, 2); virDomainCapsFeatureGICFormat(&buf, &caps->gic); + virBufferAsprintf(&buf, "\n", + caps->vmcoreinfo ? "yes" : "no"); virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "
\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index fa4c1e442..5bb028f63 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -157,6 +157,7 @@ struct _virDomainCaps { /* add new domain devices here */ virDomainCapsFeatureGIC gic; + bool vmcoreinfo; /* add new domain features here */ }; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f379fc6d2..0543c0194 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4830,6 +4830,9 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, domCaps->maxvcpus = MIN(domCaps->maxvcpus, hostmaxvcpus); } + domCaps->vmcoreinfo = virQEMUCapsGet(qemuCaps, + QEMU_CAPS_DEVICE_VMCOREINFO); + if (virQEMUCapsFillDomainOSCaps(os, firmwares, nfirmwares) < 0 || virQEMUCapsFillDomainCPUCaps(caps, qemuCaps, domCaps) < 0 || virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, diff --git a/tests/domaincapsschemadata/basic.xml b/tests/domaincapsschemadata/basic.xml index 6b788d914..e937b3607 100644 --- a/tests/domaincapsschemadata/basic.xml +++ b/tests/domaincapsschemadata/basic.xml @@ -17,5 +17,6 @@ + diff --git a/tests/domaincapsschemadata/bhyve_basic.x86_64.xml b/tests/domaincapsschemadata/bhyve_basic.x86_64.xml index 95a8038c2..70e36e97e 100644 --- a/tests/domaincapsschemadata/bhyve_basic.x86_64.xml +++ b/tests/domaincapsschemadata/bhyve_basic.x86_64.xml @@ -27,5 +27,6 @@ + diff --git a/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml b/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml index 662d0db9a..19b76da45 100644 --- a/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml +++ b/tests/domaincapsschemadata/bhyve_fbuf.x86_64.xml @@ -44,5 +44,6 @@ + diff --git a/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml b/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml index f8c79b99b..c278df038 100644 --- a/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml +++ b/tests/domaincapsschemadata/bhyve_uefi.x86_64.xml @@ -36,5 +36,6 @@ + diff --git a/tests/domaincapsschemadata/full.xml b/tests/domaincapsschemadata/full.xml index ab6ef9f2e..93bdad2eb 100644 --- a/tests/domaincapsschemadata/full.xml +++ b/tests/domaincapsschemadata/full.xml @@ -107,5 +107,6 @@ + diff --git a/tests/domaincapsschemadata/libxl-xenfv-usb.xml b/tests/domaincapsschemadata/libxl-xenfv-usb.xml index 6a9e3d96f..dfa992cb7 100644 --- a/tests/domaincapsschemadata/libxl-xenfv-usb.xml +++ b/tests/domaincapsschemadata/libxl-xenfv-usb.xml @@ -70,5 +70,6 @@ + diff --git a/tests/domaincapsschemadata/libxl-xenfv.xml b/tests/domaincapsschemadata/libxl-xenfv.xml index d48e69948..c74632a13 100644 --- a/tests/domaincapsschemadata/libxl-xenfv.xml +++ b/tests/domaincapsschemadata/libxl-xenfv.xml @@ -69,5 +69,6 @@ + diff --git a/tests/domaincapsschemadata/libxl-xenpv-usb.xml b/tests/domaincapsschemadata/libxl-xenpv-usb.xml index d1a3918ef..8277a9efd 100644 --- a/tests/domaincapsschemadata/libxl-xenpv-usb.xml +++ b/tests/domaincapsschemadata/libxl-xenpv-usb.xml @@ -60,5 +60,6 @@ + diff --git a/tests/domaincapsschemadata/libxl-xenpv.xml b/tests/domaincapsschemadata/libxl-xenpv.xml index c0e3193fe..c816b2053 100644 --- a/tests/domaincapsschemadata/libxl-xenpv.xml +++ b/tests/domaincapsschemadata/libxl-xenpv.xml @@ -59,5 +59,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml index 8d1ad8657..d79e8015f 100644 --- a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml @@ -108,5 +108,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml index 9cba942fb..982f31a9a 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml @@ -115,5 +115,6 @@ 3 +
diff --git a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml index 4029e9e38..0aa14b127 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml @@ -77,5 +77,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml index 50680c1ef..693b6dc7a 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml @@ -74,5 +74,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml index 851d914bc..797ecfae7 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml @@ -139,5 +139,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml index 7c019b230..5e4ac26f7 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml @@ -112,5 +112,6 @@ 2 +
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml index 3b1428062..5bc69e717 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml @@ -108,5 +108,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml index 98c72d36d..0543e3f56 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml @@ -81,5 +81,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml index de8188623..21198b500 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml @@ -113,5 +113,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml index b93d00ece..1e6140091 100644 --- a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml @@ -74,5 +74,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml index d860cd833..8ae794f69 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml @@ -114,5 +114,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml index ee40d1e84..ac6317755 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml @@ -155,5 +155,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml index 33161f7b8..d227926c6 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml @@ -114,5 +114,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml index 07e1db641..513b71c1b 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml @@ -122,5 +122,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml index 6c2bbac19..38fddf586 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml @@ -146,5 +146,6 @@ + diff --git a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml index 2fc3b7213..501fcc682 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml @@ -123,5 +123,6 @@ +