Revision a519eb13 src/um/QuotaVirtualMachine.cc

View differences:

src/um/QuotaVirtualMachine.cc
55 55
    int memory;
56 56
    float cpu;
57 57

  
58
    if ( tmpl->get("MEMORY", memory) == false )
58
    if ( tmpl->get("MEMORY", memory) == false  || memory <= 0 )
59 59
    {
60
        memory = 0;
60
        error = "MEMORY attribute must be a positive integer value";
61
        return false;
61 62
    }
62 63

  
63
    if ( tmpl->get("CPU", cpu) == false )
64
    if ( tmpl->get("CPU", cpu) == false || cpu <= 0 )
64 65
    {
65
        cpu = 0;
66
        error = "CPU attribute must be a positive float or integer value";
67
        return false;
66 68
    }
67 69

  
68 70
    vm_request.insert(make_pair("VMS",1));

Also available in: Unified diff