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

Peter Krempa pkrempa at redhat.com
Thu Apr 19 15:25:04 UTC 2018


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 at 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 288bdb86ad..6d7ab4ff80 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11851,6 +11851,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.14.3




More information about the libvir-list mailing list