[libvirt] [PATCH] qemu: Floppy disks not supported on pSeries machines

Kothapally Madhu Pavan posted 1 patch 6 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1507456573-144759-1-git-send-email-kmp@linux.vnet.ibm.com
src/qemu/qemu_parse_command.c | 5 +++++
1 file changed, 5 insertions(+)
[libvirt] [PATCH] qemu: Floppy disks not supported on pSeries machines
Posted by Kothapally Madhu Pavan 6 years, 6 months ago
Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
---
 src/qemu/qemu_parse_command.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
index 7c409b0..d5745ce 100644
--- a/src/qemu/qemu_parse_command.c
+++ b/src/qemu/qemu_parse_command.c
@@ -760,6 +760,11 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
             } else if (STREQ(values[i], "floppy")) {
                 def->bus = VIR_DOMAIN_DISK_BUS_FDC;
                 def->device = VIR_DOMAIN_DISK_DEVICE_FLOPPY;
+                if (qemuDomainIsPSeries(dom)) {
+                    virReportError(VIR_ERR_INTERNAL_ERROR,
+                                   _("pseries systems do not support floppy devices '%s'"), val);
+                    goto error;
+                }
             } else if (STREQ(values[i], "virtio")) {
                 def->bus = VIR_DOMAIN_DISK_BUS_VIRTIO;
             } else if (STREQ(values[i], "xen")) {
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Floppy disks not supported on pSeries machines
Posted by Ján Tomko 6 years, 6 months ago
On Sun, Oct 08, 2017 at 03:26:13PM +0530, Kothapally Madhu Pavan wrote:
>Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
>---
> src/qemu/qemu_parse_command.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
>index 7c409b0..d5745ce 100644
>--- a/src/qemu/qemu_parse_command.c
>+++ b/src/qemu/qemu_parse_command.c
>@@ -760,6 +760,11 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
>             } else if (STREQ(values[i], "floppy")) {
>                 def->bus = VIR_DOMAIN_DISK_BUS_FDC;
>                 def->device = VIR_DOMAIN_DISK_DEVICE_FLOPPY;
>+                if (qemuDomainIsPSeries(dom)) {
>+                    virReportError(VIR_ERR_INTERNAL_ERROR,
>+                                   _("pseries systems do not support floppy devices '%s'"), val);
>+                    goto error;

Do we actually need to worry about that here?

I would expect that if pseries does not support floppy devices, you will
not be able to run QEMU with such command line in the first place.

So this case would never happen with QEMU that is actually running.

Jan

>+                }
>             } else if (STREQ(values[i], "virtio")) {
>                 def->bus = VIR_DOMAIN_DISK_BUS_VIRTIO;
>             } else if (STREQ(values[i], "xen")) {
>-- 
>1.8.3.1
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Floppy disks not supported on pSeries machines
Posted by Madhu Pavan 6 years, 6 months ago

On 10/10/2017 02:05 PM, Ján Tomko wrote:
> On Sun, Oct 08, 2017 at 03:26:13PM +0530, Kothapally Madhu Pavan wrote:
>> Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
>> ---
>> src/qemu/qemu_parse_command.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/src/qemu/qemu_parse_command.c 
>> b/src/qemu/qemu_parse_command.c
>> index 7c409b0..d5745ce 100644
>> --- a/src/qemu/qemu_parse_command.c
>> +++ b/src/qemu/qemu_parse_command.c
>> @@ -760,6 +760,11 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr 
>> xmlopt,
>>             } else if (STREQ(values[i], "floppy")) {
>>                 def->bus = VIR_DOMAIN_DISK_BUS_FDC;
>>                 def->device = VIR_DOMAIN_DISK_DEVICE_FLOPPY;
>> +                if (qemuDomainIsPSeries(dom)) {
>> +                    virReportError(VIR_ERR_INTERNAL_ERROR,
>> +                                   _("pseries systems do not support 
>> floppy devices '%s'"), val);
>> +                    goto error;
>
> Do we actually need to worry about that here?
>
> I would expect that if pseries does not support floppy devices, you will
> not be able to run QEMU with such command line in the first place.
>
> So this case would never happen with QEMU that is actually running.
This is definitely not a possible use case for qemu-attach as you point 
out.  I intended
this patch for "virsh domxml-from-native qemu-argv <cmdline>". I expect 
domxml-from-native
command to be equally capable of validating qemu-argv as that of 
qemu-attach command
which otherwise errors out from qemu.

Madhu
>
>> +                }
>>             } else if (STREQ(values[i], "virtio")) {
>>                 def->bus = VIR_DOMAIN_DISK_BUS_VIRTIO;
>>             } else if (STREQ(values[i], "xen")) {
>> -- 
>> 1.8.3.1
>>
>> -- 
>> libvir-list mailing list
>> libvir-list@redhat.com
>> https://www.redhat.com/mailman/listinfo/libvir-list

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list