Skip to contentSkip to conversation

qemu-img: Fix error "Unknown option 'size'" when using host_device format

PATCH In review Bitti 2 participants 2 messages Mar 2, 2010 – Mar 3, 2010

lore
Share & tools
lore

Bitti

author
#0 lore raw

PATCH 1/1 qemu-img: Fix error "Unknown option 'size'" when using host_device format

qemu-kvm-0.11.0

When I run:
sudo qemu-img convert ubuntu-kvm/disk0.qcow2 -O host_device /dev/vg01/vm_test

I get this:
Unknown option 'size'

Ubuntu Bug:
https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/460542

---

raw-posix.c renamed from raw-posix.c.orig +10 -0
@@ -1172,6 +1172,15 @@
     return ret;
 }
 
+static QEMUOptionParameter host_device_create_options[] = {
+    {
+        .name = BLOCK_OPT_SIZE,
+        .type = OPT_SIZE,
+        .help = "Virtual disk size"
+    },
+    { NULL }
+};
+
 static BlockDriver bdrv_host_device = {
     .format_name	= "host_device",
     .instance_size	= sizeof(BDRVRawState),
@@ -1197,6 +1206,7 @@
     .bdrv_aio_ioctl     = hdev_aio_ioctl,
 #endif
 #endif
+    .create_options = host_device_create_options,
 };
 
 #ifdef __linux__
raw-posix.c renamed from raw-posix.c.orig +10 -0
@@ -1172,6 +1172,15 @@
     return ret;
 }
 
+static QEMUOptionParameter host_device_create_options[] = {
+    {
+        .name = BLOCK_OPT_SIZE,
+        .type = OPT_SIZE,
+        .help = "Virtual disk size"
+    },
+    { NULL }
+};
+
 static BlockDriver bdrv_host_device = {
     .format_name	= "host_device",
     .instance_size	= sizeof(BDRVRawState),
@@ -1197,6 +1206,7 @@
     .bdrv_aio_ioctl     = hdev_aio_ioctl,
 #endif
 #endif
+    .create_options = host_device_create_options,
 };
 
 #ifdef __linux__