Skip to content

Instantly share code, notes, and snippets.

@warewolf
Created May 6, 2016 21:49
Show Gist options
  • Select an option

  • Save warewolf/4888df27b436c19b823528132fc4bcdf to your computer and use it in GitHub Desktop.

Select an option

Save warewolf/4888df27b436c19b823528132fc4bcdf to your computer and use it in GitHub Desktop.
diff -urN libvirt-1.2.18.2/src/qemu/qemu_command.c libvirt-1.2.18.2-patched/src/qemu/qemu_command.c
--- libvirt-1.2.18.2/src/qemu/qemu_command.c 2015-12-23 18:21:41.000000000 -0500
+++ libvirt-1.2.18.2-patched/src/qemu/qemu_command.c 2016-05-06 17:26:55.033133087 -0400
@@ -3756,9 +3756,7 @@
virBufferAddLit(&opt, ",readonly=on");
}
if (disk->transient) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("transient disks not supported yet"));
- goto error;
+ virBufferAddLit(&opt, ",snapshot=on");
}
if (disk->src->format > 0 &&
disk->src->type != VIR_STORAGE_TYPE_DIR &&
@@ -9839,13 +9837,20 @@
optstr = qemuBuildDriveStr(conn, disk,
emitBootindex ? false : !!bootindex,
qemuCaps);
+
if (deviceFlagMasked)
virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE);
+
if (!optstr)
goto error;
+
virCommandAddArg(cmd, optstr);
VIR_FREE(optstr);
+ if (disk->transient) {
+ virCommandAddArg(cmd, "-snapshot");
+ }
+
if (!emitBootindex)
bootindex = 0;
else if (disk->info.bootIndex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment