<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 06/14/2016 01:02 AM, Jim Fehlig
      wrote:<br>
    </div>
    <blockquote cite="mid:575F8FF6.7070400@suse.com" type="cite">
      <blockquote type="cite" style="font-weight: bold; color: #660000;">
        <pre wrap="">diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
<span class="moz-txt-citetags">> </span>index 490260f..5c3de83 100644
<span class="moz-txt-citetags">> </span>--- a/src/qemu/qemu_command.c
<span class="moz-txt-citetags">> </span>+++ b/src/qemu/qemu_command.c
<span class="moz-txt-citetags">> </span>@@ -133,6 +133,10 @@ VIR_ENUM_IMPL(qemuControllerModelUSB, VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST,
<span class="moz-txt-citetags">> </span>               "vt82c686b-usb-uhci",
<span class="moz-txt-citetags">> </span>               "pci-ohci",
<span class="moz-txt-citetags">> </span>               "nec-usb-xhci",
<span class="moz-txt-citetags">> </span>+              "pvusb1",
<span class="moz-txt-citetags">> </span>+              "pvusb2",
<span class="moz-txt-citetags">> </span>+              "qusb1",
<span class="moz-txt-citetags">> </span>+              "qusb2",
<span class="moz-txt-citetags">> </span>               "none");
</pre>
      </blockquote>
      <pre wrap="">It seems odd that these need to be added to qemu_command.c. But sadly, I'm not
familiar with how USB controllers are handled in the qemu driver to give much
useful feedback at this time. I can certainly start investigating that, but in
the meantime I've added Laine to the cc list. He has done quite a bit of work in
this area in the past and might have a few minutes free to comment on these changes.</pre>
    </blockquote>
    <p><br>
    </p>
    <p><tt>This enum exists because the model strings recognized/stored
        by libvirt's XML parser are slightly different from the exact
        name of the devices on the qemu commandline. For example, if you
        put "ehci" in the XML, the device that qemu uses is called
        "usb-ehci". Internally (in the domain object) it is stored as an
        enum value, and when we create the qemu commandline we use
        qemuControllerModelUSBTypeToString(model) to get the name of the
        device.</tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt>This points out a couple of things:</tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt>1) the VIR_ENUM_IMPL for qemuControllerModelUSB and
        virDomainontrollerModelUSB must be kept in sync (this is partly
        enforced by the VIR_ENUM_IMPL() macro, which checks that the
        array of strings has as many entries as VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST).</tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt>2) If new models are added that aren't supported in a
        particular hypervisor, the post-parse validation for that
        hypervisor should check for those models and flag them as
        errors.</tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt><br>
      </tt></p>
  </body>
</html>