[libvirt] storage_backend_fs.c Bug

Cole Robinson crobinso at redhat.com
Tue Feb 17 14:44:24 UTC 2009


Jim Meyering wrote:
> Russell <russellhaering at gmail.com> wrote:
>> Line 1133 of storage_backend_fs.c in 0.6.0:
>>
>>         if (vol->target.backingStore != NULL) {
>>             virStorageReportError(conn, VIR_ERR_NO_SUPPORT,
>>                                   _("copy-on-write image not supported with "
>>                                     "qcow-create"));
>>             return -1;
>>         }
>>
>> virStorageVolTarget has no member called backingStore, resulting in
>> compile errors.
> 
> Thanks for the report.
> Here's a patch:
> 
>>From 5ba834b615a90df49da46d3f3c74cee1f9a5adec Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering at redhat.com>
> Date: Tue, 17 Feb 2009 11:05:41 +0100
> Subject: [PATCH] fix compile-error when configured without qemu-img
> 
> * src/storage_backend_fs.c (virStorageBackendFileSystemVolCreate):
> Test vol->target.path, not vol->target.backingStore.
> Reported by Russell Haering.
> ---
>  src/storage_backend_fs.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c
> index 240de96..488f578 100644
> --- a/src/storage_backend_fs.c
> +++ b/src/storage_backend_fs.c
> @@ -1130,7 +1130,7 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn,
>                                    vol->target.format);
>              return -1;
>          }
> -        if (vol->target.backingStore != NULL) {
> +        if (vol->target.path != NULL) {
>              virStorageReportError(conn, VIR_ERR_NO_SUPPORT,
>                                    _("copy-on-write image not supported with "
>                                      "qcow-create"));

That will fix the compilation failure, but doesn't match the error
message. I think the correct fix is:

-        if (vol->target.backingStore != NULL) {
+        if (vol->backingStore != NULL) {

Thanks,
Cole




More information about the libvir-list mailing list