]> xenbits.xensource.com Git - libvirt.git/commitdiff
utils: storage: Mark that a virStorageSource is going to be used as a floppy
authorPeter Krempa <pkrempa@redhat.com>
Thu, 19 Apr 2018 13:31:55 +0000 (15:31 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 7 May 2018 12:52:43 +0000 (14:52 +0200)
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>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_domain.c
src/util/virstoragefile.h

index 48628466de42a7c3bf5b71a784a5dd53f6fd0fce..901132854c10f76d1d8e0f07aac6195f0e7086b3 100644 (file)
@@ -11852,6 +11852,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;
index 03e9ba9d2dd8f63ceef66cb9b551181ea5f42eb1..92864368275031fbb0811912144b532f0daa2a32 100644 (file)
@@ -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 */
 };