<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
“extra_info” is no longer a key in the stats pool, nor the “physical_function”. If you check pci/stats.py, the keys are     pool_keys = ['product_id', 'vendor_id', 'numa_node’] plus whatever tags are used in the whitelist. So I believe it’s something like this:</div>
<div>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
"os-pci:pci_stats": [<o:p></o:p></p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; text-indent: 0.5in;">
{<o:p></o:p></p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; margin-left: 0.5in; text-indent: 0.5in;">
"count": 5,<o:p></o:p></p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; margin-left: 0.5in; text-indent: 0.5in;">
"key1": "value1”,<o:p></o:p></p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; margin-left: 0.5in; text-indent: 0.5in;">
…</p>
<p class="MsoNormal" style="margin-left: 0.5in; text-indent: 0.5in;"><span style="text-indent: 0.5in;"><font face="Calibri,sans-serif">“</font><font face="Calibri,sans-serif" size="3">keyn": "valuen",</font></span></p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; margin-left: 0.5in; text-indent: 0.5in;">
<o:p></o:p></p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; margin-left: 0.5in; text-indent: 0.5in;">
"product_id": "1520",<o:p></o:p></p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; margin-left: 0.5in; text-indent: 0.5in;">
"vendor_id": “8086”,</p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; margin-left: 0.5in; text-indent: 0.5in;">
“numa_node"       <o:p></o:p></p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; text-indent: 0.5in;">
},</p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
],<o:p></o:p></p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<o:p> </o:p></p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
And each stats entry may have different keys.</p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
thanks,</p>
<p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
—Robert</p>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<span id="OLK_SRC_BODY_SECTION" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<div>
<div>On 3/5/15, 5:16 PM, "Jiang, Yunhong" <<a href="mailto:yunhong.jiang@intel.com">yunhong.jiang@intel.com</a>> wrote:</div>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Paul, you are right that the ‘extra_info’ should not be in the os-pci:pci_stats, since it’s not part of ‘pool-keys’ anymore, but I’m not sure if both ‘key1’ and ‘phys_function’ will be part of the pci_stats.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">--jyh<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="color:#1F497D"><o:p> </o:p></span></a></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Murray, Paul (HP Cloud) [<a href="mailto:pmurray@hp.com">mailto:pmurray@hp.com</a>]
<br>
<b>Sent:</b> Thursday, March 5, 2015 11:39 AM<br>
<b>To:</b> <a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a><br>
<b>Subject:</b> [openstack-dev] [Nova] pci stats format and functional tests<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I know Yunhong Jiang and Daniel Berrange have been involved in the following, but I thought it worth sending to the list for visibility.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">While writing code to convert the resource tracker to use the ComputeNode object realized that the api samples used in the functional tests are not the same as the format as the PciDevicePool object. For example: hypervisor-pci-detail-resp.json
 has something like this:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">"os-pci:pci_stats": [<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">{<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"count": 5,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"extra_info": {<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:1.0in;text-indent:.5in">"key1": "value1",<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:1.0in;text-indent:.5in">"phys_function": "[[\"0x0000\", \"0x04\", \"0x00\", \"0x1\"]]”<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">},<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"keya": "valuea",<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"product_id": "1520",<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"vendor_id": "8086"               
<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">}<o:p></o:p></p>
<p class="MsoNormal">],<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My understanding from interactions with yjiang5 in the past leads me to think that something like this is what is actually expected:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">"os-pci:pci_stats": [<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">{<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"count": 5,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"key1": "value1",<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"phys_function": "[[\"0x0000\", \"0x04\", \"0x00\", \"0x1\"]]”,<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"keya": "valuea",<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"product_id": "1520",<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in;text-indent:.5in">"vendor_id": "8086"               
<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">}<o:p></o:p></p>
<p class="MsoNormal">],<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This is the way the PciDevicePool object expects the data structure to be and is also the way the libvirt virt driver creates pci device information (i.e. without the “extra_info” key). Other than that (which is actually pretty clear) I
 couldn’t find anything to tell me definitively if my interpretation is correct and I don’t want to change the functional tests without being sure they are wrong. So if anyone can give some guidance here I would appreciate it.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I separated this stuff out into a patch with a couple of other minor cleanups in preparation for the ComputeNode change, see:
<a href="https://review.openstack.org/#/c/161843">https://review.openstack.org/#/c/161843</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Let me know if I am on the right track,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
<p class="MsoNormal">Paul<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;color:gray;mso-fareast-language:EN-GB">Paul Murray<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;color:gray;mso-fareast-language:EN-GB">Nova Technical Lead, HP Cloud<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:8.0pt;color:gray;mso-fareast-language:EN-GB">+44 117 316 2527<br>
<br>
Hewlett-Packard Limited registered Office: Cain Road, Bracknell, Berks RG12 1HN Registered No: 690597 England. The contents of this message and any attachments to it are confidential and may be legally privileged. If you have received this message in error,
 you should delete it from your system immediately and advise the sender. To any recipient of this message within HP, unless otherwise stated you should consider this message and attachments as "HP CONFIDENTIAL".</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
</span>
</body>
</html>