<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 03/29/2016 07:45 AM, Moshe Levi
      wrote:<br>
    </div>
    <blockquote
cite="mid:AM4PR05MB182628008587A83389C1424FD0870@AM4PR05MB1826.eurprd05.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
h4
        {mso-style-priority:9;
        mso-style-link:"Heading 4 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",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;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.Heading4Char
        {mso-style-name:"Heading 4 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 4";
        font-family:"Times New Roman",serif;
        font-weight:bold;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:686710565;
        mso-list-type:hybrid;
        mso-list-template-ids:1635913176 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:1229917838;
        mso-list-type:hybrid;
        mso-list-template-ids:2125207760 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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 class="WordSection1">
        <p class="MsoNormal">Hi,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I was  testing <a moz-do-not-send="true"
            name="elementsHostDev">Host device assignment</a>  in
          OpenStack environment where the driver name is vfio or kvm.
          <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">My setup is as follow: <o:p></o:p></p>
        <p class="MsoListParagraph"
          style="text-indent:-.25in;mso-list:l1 level1 lfo1"><!--[if !supportLists]--><span
            style="mso-list:Ignore">1.<span style="font:7.0pt
              "Times New Roman"">      
            </span></span><!--[endif]--><span dir="LTR"></span>Fedora 21<o:p></o:p></p>
        <p class="MsoListParagraph"
          style="text-indent:-.25in;mso-list:l1 level1 lfo1"><!--[if !supportLists]--><span
            style="mso-list:Ignore">2.<span style="font:7.0pt
              "Times New Roman"">      
            </span></span><!--[endif]--><span dir="LTR"></span>Libvirt
          1.3.0 which I compiled<o:p></o:p></p>
        <p class="MsoListParagraph"
          style="text-indent:-.25in;mso-list:l1 level1 lfo1"><!--[if !supportLists]--><span
            style="mso-list:Ignore">3.<span style="font:7.0pt
              "Times New Roman"">      
            </span></span><!--[endif]--><span dir="LTR"></span>OpenStack
          master <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I have also other setups with older Libvirt
          version and the same OpenStack environment.
          <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I notice that on my fedora environment the
          driver name is vfio were in my old environment the driver name
          is kvm.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">According to Libvirt documentation default
          is "vfio" on systems where the VFIO driver is available and
          loaded, see [1]<o:p></o:p></p>
        <p class="MsoNormal">I remove the vfio modules by removing vfio,
          vfio_iommu_type1, vfio_pci but when I boot a vm the drive name
          is vfio<o:p></o:p></p>
        <p class="MsoNormal">How can change the driver name to be kvm?</p>
      </div>
    </blockquote>
    <br>
    libvirt tries very hard to use vfio rather than legacy kvm, because
    legacy kvm is old, deprecated, and "declared bad" :-). But it won't
    changed it to vfio if you've explicitly said that you want to use
    kvm. If you really want to use legacy kvm device assignment,
    manually set that in the config. When you do that, if the system
    you're running on doesn't support it, it will error out rather than
    switching.<br>
    <br>
    <blockquote
cite="mid:AM4PR05MB182628008587A83389C1424FD0870@AM4PR05MB1826.eurprd05.prod.outlook.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Another thing that I encounter is an error
          when suspending VM (in OpenStack environment)  when the driver
          name is  vfio.<o:p></o:p></p>
        <p class="MsoNormal">In such case I am getting  the following
          error from Libvirt:<o:p></o:p></p>
        <p class="MsoNormal">2016-03-28 11:42:59.527 1966 ERROR
          oslo_messaging.rpc.dispatcher   File
          "/usr/lib64/python2.7/site-packages/libvirt.py", line 560, in
          attachDeviceFlags<o:p></o:p></p>
        <p class="MsoNormal">2016-03-28 11:42:59.527 1966 ERROR
          oslo_messaging.rpc.dispatcher     if ret == -1: raise
          libvirtError ('virDomainAttachDeviceFlags() failed', dom=self)<o:p></o:p></p>
        <p class="MsoNormal">2016-03-28 11:42:59.527 1966 ERROR
          oslo_messaging.rpc.dispatcher libvirtError: internal error:
          unable to execute QEMU command 'device_add': Device
          initialization failed.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I would appreciate for some pointers on
          what can cause this issue.</p>
      </div>
    </blockquote>
    <br>
    Assuming that openstack uses libvirt's virDomainSave API I would
    expect suspending a guest to fail if it had an assigned device
    (since libvirt implements this by "migrating to disk", and qemu
    doesn't allow migration of a guest with an assigned device. But your
    problem is that it's trying to *attach* a device, which I wouldn't
    consider to be a part of a save or suspend or whatever operation. Is
    it possible to get more information about what leads up to this?<br>
    <br>
    <br>
    <blockquote
cite="mid:AM4PR05MB182628008587A83389C1424FD0870@AM4PR05MB1826.eurprd05.prod.outlook.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">[1] <a moz-do-not-send="true"
            href="https://libvirt.org/formatdomain.html#elementsHostDev">
            https://libvirt.org/formatdomain.html#elementsHostDev</a><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">--
libvir-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/libvir-list">https://www.redhat.com/mailman/listinfo/libvir-list</a></pre>
    </blockquote>
    <br>
  </body>
</html>