[libvirt] Fwd: Re: [PATCH] virsh domxml-from-native to treat SCSI as the bus type for pseries by default

Shivaprasad bhat shivaprasadbhat at gmail.com
Tue Nov 5 06:57:40 UTC 2013


Hi Eric,

I realised you have not received my mails due to some problem with IMAP
server.

I sent out second version of my patch with your suggestions last week.
https://www.redhat.com/archives/libvir-list/2013-October/msg01110.html

Could you please help me reviewing the V2 ?

Thanks and Regards,
Shiva

---------- Forwarded message ----------
From: Shivaprasad G Bhat <sbhat at linux.vnet.ibm.com>
Date: Tue, Nov 5, 2013 at 12:07 PM
Subject: Fwd: Re: [libvirt] [PATCH] virsh domxml-from-native to treat SCSI
as the bus type for pseries by default
To: Shivaprasad G Bhat <shivaprasadbhat at gmail.com>





-------- Original Message --------  Message-ID:
<526E1EB5.5050902 at linux.vnet.ibm.com>
<526E1EB5.5050902 at linux.vnet.ibm.com>  Date:
Mon, 28 Oct 2013 13:52:13 +0530  From: Shivaprasad G Bhat
<sbhat at linux.vnet.ibm.com> <sbhat at linux.vnet.ibm.com>  User-Agent: Mozilla/5.0
(X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0  MIME-Version:
1.0  To: Eric Blake <eblake at redhat.com> <eblake at redhat.com>, Shivaprasad G
Bhat <shivaprasadbhat at gmail.com> <shivaprasadbhat at gmail.com>,
libvir-list at redhat.com, zhlcindy at linux.vnet.ibm.com  CC:
bpradip at in.ibm.com  Subject:
Re: [libvirt] [PATCH] virsh domxml-from-native to treat SCSI as the bus
type for pseries by default  References:
<20131024070709.13853.10308.stgit at localhost.localdomain><20131024070709.13853.10308.stgit at localhost.localdomain>
<5268CB8C.3090404 at redhat.com> <5268CB8C.3090404 at redhat.com>  In-Reply-To:
<5268CB8C.3090404 at redhat.com> <5268CB8C.3090404 at redhat.com>
Content-Type: multipart/alternative;
boundary="------------050306080405050600030204"


Thanks Eric and Li.  Sending out the v2 with the recommended changes.

Regards,
Shiva

On 10/24/2013 12:56 PM, Eric Blake wrote:

On 10/24/2013 08:07 AM, Shivaprasad G Bhat wrote:

 From: Shivaprasad G Bhat <sbhat at linux.vnet.ibm.com> <sbhat at linux.vnet.ibm.com>

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 <sbhat at linux.vnet.ibm.com>
<sbhat at linux.vnet.ibm.com>
---
 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,

 TAB damage.  Please run 'make syntax-check' and fix that.


                           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;

 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).




--
libvir-list mailing
listlibvir-list at redhat.comhttps://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131105/831ea6d7/attachment-0001.htm>


More information about the libvir-list mailing list