[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v3 04/14] parallels: report, that cdroms are readonly



Set readonly flag for cdrom devices when we
retrieve a list of domains from PCS.

Signed-off-by: Dmitry Guryanov <dguryanov parallels com>
---
 src/parallels/parallels_sdk.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
index 7a90eec..a49f792 100644
--- a/src/parallels/parallels_sdk.c
+++ b/src/parallels/parallels_sdk.c
@@ -478,10 +478,12 @@ prlsdkGetDiskInfo(PRL_HANDLE prldisk,
         virDomainDiskSetFormat(disk, VIR_STORAGE_FILE_RAW);
     }
 
-    if (isCdrom)
+    if (isCdrom) {
         disk->device = VIR_DOMAIN_DISK_DEVICE_CDROM;
-    else
+        disk->src->readonly = true;
+    } else {
         disk->device = VIR_DOMAIN_DISK_DEVICE_DISK;
+    }
 
     pret = PrlVmDev_GetFriendlyName(prldisk, NULL, &buflen);
     prlsdkCheckRetGoto(pret, cleanup);
-- 
2.1.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]