[libvirt] [PATCH 07/35] utils: storage: Mark that a virStorageSource is going to be used as a floppy

Peter Krempa posted 35 patches 7 years ago
[libvirt] [PATCH 07/35] utils: storage: Mark that a virStorageSource is going to be used as a floppy
Posted by Peter Krempa 7 years ago
Add a flag denoting that a virStorageSource is going to be used as a
floppy image. This will be useful in cases where the user passes in
files which shall be exposed as an image to the guest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_domain.c    | 3 +++
 src/util/virstoragefile.h | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 109f4f7f36..f8254bfdd5 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11862,6 +11862,9 @@ qemuDomainPrepareDiskSourceChain(virDomainDiskDefPtr disk,
         n->iomode = disk->iomode;
         n->cachemode = disk->cachemode;
         n->discard = disk->discard;
+
+        if (disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY)
+            n->floppyimg = true;
     }

     return 0;
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index b450da55ae..57d39f98c2 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -313,6 +313,9 @@ struct _virStorageSource {
     int cachemode; /* enum virDomainDiskCache */
     int discard; /* enum virDomainDiskDiscard */
     int detect_zeroes; /* enum virDomainDiskDetectZeroes */
+
+    bool floppyimg; /* set to true if the storage source is going to be used
+                       as a source for floppy drive */
 };


-- 
2.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 07/35] utils: storage: Mark that a virStorageSource is going to be used as a floppy
Posted by John Ferlan 7 years ago

On 04/25/2018 11:15 AM, Peter Krempa wrote:
> Add a flag denoting that a virStorageSource is going to be used as a
> floppy image. This will be useful in cases where the user passes in
> files which shall be exposed as an image to the guest.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/qemu/qemu_domain.c    | 3 +++
>  src/util/virstoragefile.h | 3 +++
>  2 files changed, 6 insertions(+)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

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