<div dir="ltr">Hi Eric,<div><br></div><div>I realised you have not received my mails due to some problem with IMAP server. </div><div><br></div><div>I sent out second version of my patch with your suggestions last week. <a href="https://www.redhat.com/archives/libvir-list/2013-October/msg01110.html">https://www.redhat.com/archives/libvir-list/2013-October/msg01110.html</a></div>
<div><br></div><div>Could you please help me reviewing the V2 ?</div><div><br></div><div>Thanks and Regards,</div><div>Shiva</div><div><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Shivaprasad G Bhat</b> <span dir="ltr"><<a href="mailto:sbhat@linux.vnet.ibm.com">sbhat@linux.vnet.ibm.com</a>></span><br>
Date: Tue, Nov 5, 2013 at 12:07 PM<br>Subject: Fwd: Re: [libvirt] [PATCH] virsh domxml-from-native to treat SCSI as the bus type for pseries by default<br>To: Shivaprasad G Bhat <<a href="mailto:shivaprasadbhat@gmail.com">shivaprasadbhat@gmail.com</a>><br>
<br><br>
  

    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <br>
    <div><br>
      <br>
      -------- Original Message --------
      <table border="0" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">Message-ID:
            </th>
            <td><a href="mailto:526E1EB5.5050902@linux.vnet.ibm.com" target="_blank"><526E1EB5.5050902@linux.vnet.ibm.com></a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">Date: </th>
            <td>Mon, 28 Oct 2013 13:52:13 +0530</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">From: </th>
            <td>Shivaprasad G Bhat <a href="mailto:sbhat@linux.vnet.ibm.com" target="_blank"><sbhat@linux.vnet.ibm.com></a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">User-Agent:
            </th>
            <td>Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101
              Thunderbird/24.0</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">MIME-Version:
            </th>
            <td>1.0</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">To: </th>
            <td>Eric Blake <a href="mailto:eblake@redhat.com" target="_blank"><eblake@redhat.com></a>, Shivaprasad G Bhat
              <a href="mailto:shivaprasadbhat@gmail.com" target="_blank"><shivaprasadbhat@gmail.com></a>, <a href="mailto:libvir-list@redhat.com" target="_blank">libvir-list@redhat.com</a>,
              <a href="mailto:zhlcindy@linux.vnet.ibm.com" target="_blank">zhlcindy@linux.vnet.ibm.com</a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">CC: </th>
            <td><a href="mailto:bpradip@in.ibm.com" target="_blank">bpradip@in.ibm.com</a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">Subject:
            </th>
            <td>Re: [libvirt] [PATCH] virsh domxml-from-native to treat
              SCSI as the bus type for pseries by default</td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">References:
            </th>
            <td><a href="mailto:20131024070709.13853.10308.stgit@localhost.localdomain" target="_blank"><20131024070709.13853.10308.stgit@localhost.localdomain></a>
              <a href="mailto:5268CB8C.3090404@redhat.com" target="_blank"><5268CB8C.3090404@redhat.com></a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">In-Reply-To:
            </th>
            <td><a href="mailto:5268CB8C.3090404@redhat.com" target="_blank"><5268CB8C.3090404@redhat.com></a></td>
          </tr>
          <tr>
            <th align="RIGHT" nowrap valign="BASELINE">Content-Type:
            </th>
            <td>multipart/alternative;
              boundary="------------050306080405050600030204"</td>
          </tr>
        </tbody>
      </table><div><div class="h5">
      <br>
      <br>
      
      <div>Thanks Eric and Li.  Sending out the
        v2 with the recommended changes. <br>
        <br>
        Regards,<br>
        Shiva<br>
        <br>
        On 10/24/2013 12:56 PM, Eric Blake wrote:<br>
      </div>
      <blockquote type="cite">
        <pre>On 10/24/2013 08:07 AM, Shivaprasad G Bhat wrote:
</pre>
        <blockquote type="cite">
          <pre>From: Shivaprasad G Bhat <a href="mailto:sbhat@linux.vnet.ibm.com" target="_blank"><sbhat@linux.vnet.ibm.com></a>

The bus type IDE being enum Zero, the bus type on pseries system appears as IDE for all the disk types. Pseries platform needs this to appear as SCSI instead of IDE.

Signed-off-by: Shivaprasad G Bhat <a href="mailto:sbhat@linux.vnet.ibm.com" target="_blank"><sbhat@linux.vnet.ibm.com></a>
---
 src/qemu/qemu_command.c |   21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index abb62e9..728409f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9995,6 +9995,7 @@ error:
 static virDomainDiskDefPtr
 qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
                          const char *val,
+                        virDomainDefPtr dom,
</pre>
        </blockquote>
        <pre>TAB damage.  Please run 'make syntax-check' and fix that.

</pre>
        <blockquote type="cite">
          <pre>                          int nvirtiodisk,
                          bool old_style_ceph_args)
 {
@@ -10018,7 +10019,11 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
     if (VIR_ALLOC(def) < 0)
         goto cleanup;
 
-    def->bus = VIR_DOMAIN_DISK_BUS_IDE;
+    if (((dom->os.arch == VIR_ARCH_PPC64) &&
+         dom->os.machine && STREQ(dom->os.machine, "pseries")))
+        def->bus = VIR_DOMAIN_DISK_BUS_SCSI;
+    else
+       def->bus = VIR_DOMAIN_DISK_BUS_IDE;
</pre>
        </blockquote>
        <pre>I'm wondering if we should reuse our post-XML-parse callbacks here,
rather than open-coding a machine check.  In other words, since we
already have code that knows how to do per-machine fixups to a domain
definition, we should be reusing those instead of open-coding duplicate
checks.  (Actually, domxml-from-native needs a LOT of TLC, there's much
more wrong with it, even on non-pseries machines, than what you are
trying to patch).

</pre>
        <br>
        <fieldset></fieldset>
        <br>
        <pre>--
libvir-list mailing list
<a href="mailto:libvir-list@redhat.com" target="_blank">libvir-list@redhat.com</a>
<a href="https://www.redhat.com/mailman/listinfo/libvir-list" target="_blank">https://www.redhat.com/mailman/listinfo/libvir-list</a></pre>
      </blockquote>
      <br>
      <br>
    </div></div></div>
    <br>
  </div>

</div><br></div></div></div>