[libvirt] [PATCH] Don't check volume format for lvm backing store

With the recently added COW support, we were trying to validate the passed logical volume's format, when there won't ever be one pulled from the xml (logical volumes don't have any valid format values). Just remove this check, and let any validation in this manner be done by the actual call to 'lvcreate'. Thanks, Cole

Cole Robinson:
With the recently added COW support, we were trying to validate the passed logical volume's format, when there won't ever be one pulled from the xml (logical volumes don't have any valid format values).
Just remove this check, and let any validation in this manner be done by the actual call to 'lvcreate'.
I've applied this patch to my copy of 0.6.0 and it fixed snapshot creation for me. Thanks! -- Man, I love how everyone is like "In my blog, which is Nick Moffitt a blog on the Internet, which you all may be interested nick@zork.net in visiting, I talked about what I am now saying here." -- George Moffitt

On Thu, Feb 12, 2009 at 02:37:33PM -0500, Cole Robinson wrote:
With the recently added COW support, we were trying to validate the passed logical volume's format, when there won't ever be one pulled from the xml (logical volumes don't have any valid format values).
Just remove this check, and let any validation in this manner be done by the actual call to 'lvcreate'.
Oh, I got this the wrong way around - I was thinking that the VIR_STORAGE_POOL_LOGICAL_LVM2 was the volume type, but its actually the pool type.
diff --git a/src/storage_backend_logical.c b/src/storage_backend_logical.c index 702a191..cbd2765 100644 --- a/src/storage_backend_logical.c +++ b/src/storage_backend_logical.c @@ -582,12 +582,6 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn, const char **cmdargv = cmdargvnew;
if (vol->backingStore.path) { - if (vol->backingStore.format != - VIR_STORAGE_POOL_LOGICAL_LVM2) { - virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s", - _("LVM snapshots must be backed by another LVM volume")); - return -1; - } cmdargv = cmdargvsnap; }
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Thu, Feb 12, 2009 at 02:37:33PM -0500, Cole Robinson wrote:
With the recently added COW support, we were trying to validate the passed logical volume's format, when there won't ever be one pulled from the xml (logical volumes don't have any valid format values).
Just remove this check, and let any validation in this manner be done by the actual call to 'lvcreate'.
Oh, I got this the wrong way around - I was thinking that the VIR_STORAGE_POOL_LOGICAL_LVM2 was the volume type, but its actually the pool type.
diff --git a/src/storage_backend_logical.c b/src/storage_backend_logical.c index 702a191..cbd2765 100644 --- a/src/storage_backend_logical.c +++ b/src/storage_backend_logical.c @@ -582,12 +582,6 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn, const char **cmdargv = cmdargvnew;
if (vol->backingStore.path) { - if (vol->backingStore.format != - VIR_STORAGE_POOL_LOGICAL_LVM2) { - virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s", - _("LVM snapshots must be backed by another LVM volume")); - return -1; - } cmdargv = cmdargvsnap; }
ACK
Daniel
Pushed now. Thanks, Cole

In my testing, I got the order of my images wrong, and tried to delete a base image that I had snapshotted: Feb 13 15:28:33 gnusto libvirtd: 15:28:33.800: error : internal error '/sbin/lvremove -f /dev/VMs/base' exited with non-zero status 5 and signal 0: Can't remove logical volume "base" under snapshot Feb 13 15:28:37 gnusto kernel: [683740.164008] libvirtd[10397] general protection rip:7fd6c91a1ae0 rsp:7fd6c62b2d88 error:0 Obviously the first error is 100% correct. -- "Here is the memo if you didn't receive it: GNOME and Nick Moffitt Free Software is all about *SAVING THE WORLD* not nick@zork.net drawing pissy little buttons on the screen." -- Jeff Waugh
participants (3)
-
Cole Robinson
-
Daniel P. Berrange
-
Nick Moffitt