Re: [PATCH 4/5] src/xenconfig: remove dead code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/15/2014 09:50 PM, Jim Fehlig wrote:
> Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
> ---
>  src/xenconfig/xen_xm.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/src/xenconfig/xen_xm.c b/src/xenconfig/xen_xm.c
> index 0402213..83cc8c6 100644
> --- a/src/xenconfig/xen_xm.c
> +++ b/src/xenconfig/xen_xm.c
> @@ -29,7 +29,6 @@
>  #include "virerror.h"
>  #include "virconf.h"
>  #include "viralloc.h"
> -#include "verify.h"
>  #include "viruuid.h"
>  #include "virsexpr.h"
>  #include "count-one-bits.h"
> @@ -2414,10 +2413,6 @@ xenFormatConfigCommon(virConfPtr conf,
>  }
>  
>  
> -/* Computing the vcpu_avail bitmask works because MAX_VIRT_CPUS is
> -   either 32, or 64 on a platform where long is big enough.  */
> -verify(MAX_VIRT_CPUS <= sizeof(1UL) * CHAR_BIT);

Umm, why are you declaring this to be dead code?  I still see in
src/xenconfig/xen_xm.c the following:

xenParseXMCPUFeatures(virConfPtr conf, virDomainDefPtr def)
...
    if (xenXMConfigGetULong(conf, "vcpus", &count, 1) < 0 ||
        MAX_VIRT_CPUS < count)
        return -1;

...
xenFormatXMCPUAllocation(virConfPtr conf, virDomainDefPtr def)
...
    /* Computing the vcpu_avail bitmask works because MAX_VIRT_CPUS is
       either 32, or 64 on a platform where long is big enough.  */
    if (def->vcpus < def->maxvcpus &&
        xenXMConfigSetInt(conf, "vcpu_avail", (1UL << def->vcpus) - 1) < 0)

which sounds to me like the verify is still required code.

NACK unless you can offer better justification.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]