mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-22 14:09:22 +00:00
Fix compile warnings in virsh vcpupin
The 'char *cur' variable was being assigned from a 'const char *' string, thus discarding constness. As well as causing a compile warning, it masked a piece of code which attempts to assign to the previously const string. * tools/virsh.c: Fix const-ness of 'cur' variable in vcpupin
This commit is contained in:
parent
272ead559c
commit
b325768064
@ -3000,7 +3000,7 @@ cmdVcpupin(vshControl *ctl, const vshCmd *cmd)
|
|||||||
int cpumaplen;
|
int cpumaplen;
|
||||||
int i, cpu, lastcpu, maxcpu;
|
int i, cpu, lastcpu, maxcpu;
|
||||||
bool unuse = false;
|
bool unuse = false;
|
||||||
char *cur;
|
const char *cur;
|
||||||
int config = vshCommandOptBool(cmd, "config");
|
int config = vshCommandOptBool(cmd, "config");
|
||||||
int live = vshCommandOptBool(cmd, "live");
|
int live = vshCommandOptBool(cmd, "live");
|
||||||
int current = vshCommandOptBool(cmd, "current");
|
int current = vshCommandOptBool(cmd, "current");
|
||||||
@ -3067,7 +3067,7 @@ cmdVcpupin(vshControl *ctl, const vshCmd *cmd)
|
|||||||
} else if (*cur == 'r') {
|
} else if (*cur == 'r') {
|
||||||
for (cpu = 0; cpu < maxcpu; cpu++)
|
for (cpu = 0; cpu < maxcpu; cpu++)
|
||||||
VIR_USE_CPU(cpumap, cpu);
|
VIR_USE_CPU(cpumap, cpu);
|
||||||
*cur = 0;
|
cur = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
while (*cur != 0) {
|
while (*cur != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user