[libvirt] 答复: libvirt-0.10.2-46 compress failed

饶俊明 RAOJUNMING113 at pingan.com.cn
Wed Apr 22 09:34:53 UTC 2015

Dear michal

	I have modified the code ,then, The result is success by rpmbuild -bb libvirt.spec  Because my office environment causal relationship can not commit this code;

Modified code info:
    284     struct rados_cluster_stat_t modstat;
    285     if (rados_cluster_stat(ptr.cluster, &modstat) < 0) {
    286         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
    287                        _("failed to stat the RADOS cluster"));
    288         goto cleanup;
    289     }
    291     struct rados_pool_stat_t poolstat;
    292     if (rados_ioctx_pool_stat(ptr.ioctx, &poolstat) < 0) {
    293         virReportError(VIR_ERR_INTERNAL_ERROR,
    294                        _("failed to stat the RADOS pool '%s'"),
    295                        pool->def->source.name);
    296         goto cleanup;
    297     }
    299     pool->def->capacity = modstat.kb * 1024;
    300     pool->def->available = modstat.kb_avail * 1024;
    301     pool->def->allocation = poolstat.num_bytes;
    303     VIR_DEBUG("Utilization of RBD pool %s: (kb: %llu kb_avail: %llu num_bytes: %llu)",
    304               pool->def->source.name, (unsigned long long)modstat.kb,
    305               (unsigned long long)modstat.kb_avail,
    306               (unsigned long long)poolstat.num_bytes);

发件人: Michal Privoznik [mailto:mprivozn at redhat.com] 
发送时间: 2015年4月21日 20:35
收件人: 饶俊明; libvir-list at redhat.com
主题: Re: [libvirt] libvirt-0.10.2-46 compress failed

On 21.04.2015 08:48, 饶俊明 wrote:
> Hello
> 	When compress libvirt-0.10.2-46.el6.src.rpm to support rbd, then 
> failed;
> Error log:
> cc1: warnings being treated as errors
> storage/storage_backend_rbd.c: In function 'virStorageBackendRBDRefreshPool':
> storage/storage_backend_rbd.c:284: error: declaration of 'stat' 
> shadows a global declaration [-Wshadow]
> /usr/include/sys/stat.h:455: error: shadowed declaration is here 
> [-Wshadow] At top level:
> cc1: error: unrecognized command line option "-Wno-suggest-attribute=const"
> cc1: error: unrecognized command line option "-Wno-suggest-attribute=pure"
> make[3]: *** [libvirt_driver_storage_impl_la-storage_backend_rbd.lo] 
> Error 1
> make[3]: *** Waiting for unfinished jobs....
> make[3]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2/src'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2'
> make: *** [all] Error 2
> error: Bad exit status from /var/tmp/rpm-tmp.g0IuFq (%build) RPM build 
> errors:
>     Bad exit status from /var/tmp/rpm-tmp.g0IuFq (%build)
> Thanks!!!

Seems like this patch needs to be backported:

commit 6100cd985c9958f5590875e80597e26118e58bd9
Author:     Michael Chapman <mike at very.puzzling.org>
AuthorDate: Wed Dec 11 19:14:51 2013 +1100
Commit:     Michal Privoznik <mprivozn at redhat.com>
CommitDate: Wed Dec 11 10:18:15 2013 +0100

    storage_backend_rbd: rename "stat" variable
    This variable shadows the stat(2) function, which only became visible in
    this scope as of commit 9cac8639. Rename the variable so it doesn't
    Signed-off-by: Michael Chapman <mike at very.puzzling.org>



The information in this email is confidential and may be legally privileged. If you have received this email in error or are not the intended recipient, please immediately notify the sender and delete this message from your computer. Any use, distribution, or copying of this email other than by the intended recipient is strictly prohibited. All messages sent to and from us may be monitored to ensure compliance with internal policies and to protect our business. 
Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. Anyone who communicates with us by email is taken to accept these risks. 


More information about the libvir-list mailing list