int colo_mode)
{
char *drive = NULL;
- char *common = GCSPRINTF("cache=writeback");
+ char *common = GCSPRINTF("cache=writeback,readonly=%s",
+ disk->readwrite ? "off" : "on");
const char *exportname = disk->colo_export;
const char *active_disk = disk->active_disk;
const char *hidden_disk = disk->hidden_disk;
const char *exportname = disk->colo_export;
const char *active_disk = disk->active_disk;
const char *hidden_disk = disk->hidden_disk;
+
+ assert(disk->readwrite); /* should have been checked earlier */
switch (colo_mode) {
case LIBXL__COLO_NONE:
if (strncmp(disks[i].vdev, "sd", 2) == 0) {
if (colo_mode == LIBXL__COLO_SECONDARY) {
drive = libxl__sprintf
- (gc, "if=none,driver=%s,file=%s,id=%s",
- format, target_path, disks[i].colo_export);
+ (gc, "if=none,driver=%s,file=%s,id=%s,readonly=%s",
+ format, target_path, disks[i].colo_export,
+ disks[i].readwrite ? "off" : "on");
flexarray_append(dm_args, "-drive");
flexarray_append(dm_args, drive);