)]}'
{"id":"openstack%2Fnova~673152","triplet_id":"openstack%2Fnova~master~I361490a439422ef5e2cec96f022f0a2f4e8cb2db","project":"openstack/nova","branch":"master","topic":"bp/amd-sev-libvirt-support","hashtags":[],"change_id":"I361490a439422ef5e2cec96f022f0a2f4e8cb2db","subject":"Enhance parsing of domain capabilities and track canonical machine types","status":"ABANDONED","created":"2019-07-27 21:27:21.000000000","updated":"2019-07-27 21:31:01.000000000","total_comment_count":0,"unresolved_comment_count":0,"has_review_started":true,"meta_rev_id":"8670fd1239f68e42bdb1c6eb512fc474de491825","_number":673152,"virtual_id_number":673152,"owner":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"actions":{},"labels":{"Verified":{"values":{"-2":"Fails","-1":"Doesn\u0027t seem to work"," 0":"No score","+1":"Works for me","+2":"Verified"},"description":"","default_value":0,"optional":true},"Code-Review":{"values":{"-2":"Do not merge","-1":"This patch needs further work before it can be merged"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me (core reviewer)"},"description":"","default_value":0,"optional":true},"Workflow":{"values":{"-1":"Work in progress"," 0":"Ready for reviews","+1":"Approved"},"description":"","default_value":0,"optional":true},"Review-Priority":{"values":{" 0":"Default Priority","+1":"Contributor Review Promise","+2":"Core Review Promise"},"description":"","default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{},"pending_reviewers":{},"reviewer_updates":[],"messages":[{"id":"2b83368e845623e54b8e0684c5f4428ab74a990e","author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"date":"2019-07-27 21:27:21.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"19dcbe681114333c426f22ef3620d5fd7d8408cc","author":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"date":"2019-07-27 21:31:01.000000000","message":"Abandoned\n\nDoh, this was accidentally created by the result of a fixup commit being squashed into the original without removing the new Change-Id.  Sorry for the noise.","accounts_in_message":[],"_revision_number":1}],"current_revision_number":1,"current_revision":"d231b78ad814615958b9aca68e5f9c2ad1f98d0a","revisions":{"d231b78ad814615958b9aca68e5f9c2ad1f98d0a":{"kind":"REWORK","_number":1,"created":"2019-07-27 21:27:21.000000000","uploader":{"_account_id":2394,"name":"Adam Spiers","email":"aspiers@suse.com","username":"adam.spiers"},"ref":"refs/changes/52/673152/1","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/nova","ref":"refs/changes/52/673152/1","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/nova refs/changes/52/673152/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/nova refs/changes/52/673152/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/nova refs/changes/52/673152/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/nova refs/changes/52/673152/1"}}},"commit":{"parents":[{"commit":"f1426d128ef504ce364828720ac1d08435dbdeb8","subject":"libvirt: harden Host.get_domain_capabilities()","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/nova/commit/f1426d128ef504ce364828720ac1d08435dbdeb8"}]}],"author":{"name":"Adam Spiers","email":"aspiers@suse.com","date":"2019-07-27 17:30:02.000000000","tz":60},"committer":{"name":"Adam Spiers","email":"aspiers@suse.com","date":"2019-07-27 21:20:52.000000000","tz":60},"subject":"Enhance parsing of domain capabilities and track canonical machine types","message":"Enhance parsing of domain capabilities and track canonical machine types\n\nCurrently we\u0027re only calling libvirt\u0027s getDomainCapabilities API once\nper architecture, with the assumption that covering a single machine\ntype (the default) for that architecture is enough.  However, the\ndefault for x86_64 is \u0027pc\u0027, but we need domain capabilities for \u0027q35\u0027\nin order to boot SEV guests.  So for x86_64, we need domain\ncapabilities for at least two machine types: \u0027pc\u0027 and \u0027q35\u0027.\n\nWe can obtain a sensibly small list of machine types with which to\ncall getDomainCapabilities by looking for the \u0027canonical\u0027 attribute in\nmachine types returned from getCapabilities (N.B. not\ngetDomainCapabilities). For example, getCapabilities returns these:\n\n    \u003cmachine canonical\u003d\u0027pc-i440fx-2.11\u0027 maxCpus\u003d\u0027255\u0027\u003epc\u003c/machine\u003e\n    \u003cmachine canonical\u003d\u0027pc-q35-2.11\u0027 maxCpus\u003d\u0027288\u0027\u003eq35\u003c/machine\u003e\n\nSo change Host.get_domain_capabilities() to call the API not just with\nthe default machine type, but also once per canonical machine type.\n\nIn order to obtain the canonical machine types, enhance config.py so\nthat it can extract them from the capabilities XML, modernize the\nfixtures for x86 capabilities so that they include the q35 family of\nmachine types, and add corresponding tests.  A new class\nLibvirtConfigCapsGuestDomain is introduced to model the elements of\nthe capabilities XML such as \u003cdomain type\u003d\u0027kvm\u0027\u003e, and their associated\nmachine types.  This supersedes the previous domtype attribute of\nLibvirtConfigCapsGuest objects.  Canonical machine types are tracked\nseparately from the others in order to allow\nHost.get_domain_capabilities to invoke libvirt\u0027s getDomainCapabilities\nonly on those types.\n\nAs before, we register both the shortened canonical (alias) machine\ntype (e.g. \u0027q35\u0027) plus its full expanded counterpart (e.g. \u0027pc-q35-2.11\u0027)\nif that is different.\n\nAs Host.get_domain_capabilities() is already long and complex, and\nneeds more functionality adding to support these changes, split out\nmuch of the code into smaller methods:\n\n    - _get_machine_types()\n    - _add_to_domain_capabilities()\n\nThe new tests require extending assertXmlEqual to pass through to\nmatcher.XMLMatches any options which the latter supports.  In\nparticular this allows the allow_mixed_nodes option to be enabled to\ncompare XML fragments with elements in different orders, since the\nchildren of \u003carch\u003e generated by LibvirtConfigCapsGuest.format_dom have\nthe non-canonical machine types first, followed by the canonical ones.\n\nThe tests also require removing the \u0027bamboo\u0027 canonical machine type\nfor the ppc architecture, since the getDomainCapabilities fixture for\nthis architecture is static and only returns results with a fixed\ng3beige machine type which would cause a mismatch when called with the\n\u0027bamboo\u0027 machine type.  The x86 fixtures are sufficient to test these\ncode paths, so this is a simpler alternative to adding complexity to\nthe ppc fixtures.\n\nIn the process of testing, a bug was discovered in\ntest_driver.LibvirtConnTestCase.test_cpu_info and\ntest_driver.LibvirtConnTestCase.test_get_instance_capabilities where\nit was incorrectly adding LibvirtConfigGuest fixture objects to the\nguests attribute of LibvirtConfigCaps.  This was fixed to instead add\nLibvirtConfigCapsGuest fixtures, the construction of which is adjusted\nto the new class model.\n\nblueprint: amd-sev-libvirt-support\nChange-Id: I9da9ce682dc8c8b72fb31dd4e732b556b2ed7f90\n\nsquash! Enhance parsing of domain capabilities and track canonical machine types\n\nChange-Id: I361490a439422ef5e2cec96f022f0a2f4e8cb2db\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/nova/commit/d231b78ad814615958b9aca68e5f9c2ad1f98d0a"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/nova/commit/d231b78ad814615958b9aca68e5f9c2ad1f98d0a"}]},"branch":"refs/heads/master"}},"requirements":[],"submit_records":[],"submit_requirements":[]}
