]> git.proxmox.com Git - pve-qemu-kvm.git/commitdiff
Fix #934: assume raw for /dev paths in vma extract
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 12 Apr 2016 12:06:03 +0000 (14:06 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 13 Apr 2016 06:46:49 +0000 (08:46 +0200)
debian/patches/pve/0045-vma-also-guess-raw-for-dev-paths.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/pve/0045-vma-also-guess-raw-for-dev-paths.patch b/debian/patches/pve/0045-vma-also-guess-raw-for-dev-paths.patch
new file mode 100644 (file)
index 0000000..b48b5e8
--- /dev/null
@@ -0,0 +1,36 @@
+From 7878879d6dc2330e6d2d34c1e83101ad796ce939 Mon Sep 17 00:00:00 2001
+From: Wolfgang Bumiller <w.bumiller@proxmox.com>
+Date: Tue, 12 Apr 2016 13:49:44 +0200
+Subject: [PATCH] vma: also "guess" raw for /dev/ paths
+
+---
+ vma.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/vma.c b/vma.c
+index 1c4103f..2f604bb 100644
+--- a/vma.c
++++ b/vma.c
+@@ -304,13 +304,15 @@ static int extract_content(int argc, char **argv)
+           size_t devlen = strlen(devfn);
+           bool protocol = path_has_protocol(devfn);
+           QDict *options = NULL;
+-          if (devlen > 4 && strcmp(devfn+devlen-4, ".raw") == 0 && !protocol) {
++          if (protocol) {
++              /* tell bdrv_open to honor the protocol */
++              flags |= BDRV_O_PROTOCOL;
++          } else if ((devlen > 4 && strcmp(devfn+devlen-4, ".raw") == 0) ||
++                     strncmp(devfn, "/dev/", 5) == 0)
++          {
+               /* explicit raw format */
+               options = qdict_new();
+               qdict_put(options, "driver", qstring_from_str("raw"));
+-          } else if (protocol) {
+-              /* tell bdrv_open to honor the protocol */
+-              flags |= BDRV_O_PROTOCOL;
+           }
+           if (errp || bdrv_open(&bs, devfn, NULL, options, flags, &errp)) {
+-- 
+2.1.4
+
index e165c8125c7e3210b05f3a5953a9cb8cabb2e0ca..ecb8ad4442f88accec3bdc6518d644c1caad6416 100644 (file)
@@ -42,6 +42,7 @@ pve/0041-PVE-VNC-authentication.patch
 pve/0042-vma-writer-don-t-bail-out-on-zero-length-files.patch
 pve/0043-vma-better-driver-guessing-for-bdrv_open.patch
 pve/0044-block-add-zeroinit.patch
+pve/0045-vma-also-guess-raw-for-dev-paths.patch
 extra/0001-vnc-clear-vs-tlscreds-after-unparenting-it.patch
 extra/CVE-2016-2198-ehci-null-pointer.patch
 extra/CVE-2016-2391-usb-ohci-avoid-multiple-eof-timers.patch