mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-03 12:55:45 +00:00
virsh: move command maxvcpus from domain group to host group.
Since the maxvcpus command query the maximum number of virtual CPUs supported for a guest VM on this connection, it should be in virsh-host.c but not virsh-domain.c. Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
This commit is contained in:
parent
42c6a0cdf9
commit
6c038ee330
@ -5172,44 +5172,6 @@ cmdDomjobabort(vshControl *ctl, const vshCmd *cmd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* "maxvcpus" command
|
|
||||||
*/
|
|
||||||
static const vshCmdInfo info_maxvcpus[] = {
|
|
||||||
{.name = "help",
|
|
||||||
.data = N_("connection vcpu maximum")
|
|
||||||
},
|
|
||||||
{.name = "desc",
|
|
||||||
.data = N_("Show maximum number of virtual CPUs for guests on this connection.")
|
|
||||||
},
|
|
||||||
{.name = NULL}
|
|
||||||
};
|
|
||||||
|
|
||||||
static const vshCmdOptDef opts_maxvcpus[] = {
|
|
||||||
{.name = "type",
|
|
||||||
.type = VSH_OT_STRING,
|
|
||||||
.help = N_("domain type")
|
|
||||||
},
|
|
||||||
{.name = NULL}
|
|
||||||
};
|
|
||||||
|
|
||||||
static bool
|
|
||||||
cmdMaxvcpus(vshControl *ctl, const vshCmd *cmd)
|
|
||||||
{
|
|
||||||
const char *type = NULL;
|
|
||||||
int vcpus;
|
|
||||||
|
|
||||||
if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if ((vcpus = virConnectGetMaxVcpus(ctl->conn, type)) < 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
vshPrint(ctl, "%d\n", vcpus);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "vcpucount" command
|
* "vcpucount" command
|
||||||
*/
|
*/
|
||||||
@ -10639,12 +10601,6 @@ const vshCmdDef domManagementCmds[] = {
|
|||||||
.info = info_managedsaveremove,
|
.info = info_managedsaveremove,
|
||||||
.flags = 0
|
.flags = 0
|
||||||
},
|
},
|
||||||
{.name = "maxvcpus",
|
|
||||||
.handler = cmdMaxvcpus,
|
|
||||||
.opts = opts_maxvcpus,
|
|
||||||
.info = info_maxvcpus,
|
|
||||||
.flags = 0
|
|
||||||
},
|
|
||||||
{.name = "memtune",
|
{.name = "memtune",
|
||||||
.handler = cmdMemtune,
|
.handler = cmdMemtune,
|
||||||
.opts = opts_memtune,
|
.opts = opts_memtune,
|
||||||
|
@ -192,6 +192,44 @@ cleanup:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "maxvcpus" command
|
||||||
|
*/
|
||||||
|
static const vshCmdInfo info_maxvcpus[] = {
|
||||||
|
{.name = "help",
|
||||||
|
.data = N_("connection vcpu maximum")
|
||||||
|
},
|
||||||
|
{.name = "desc",
|
||||||
|
.data = N_("Show maximum number of virtual CPUs for guests on this connection.")
|
||||||
|
},
|
||||||
|
{.name = NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const vshCmdOptDef opts_maxvcpus[] = {
|
||||||
|
{.name = "type",
|
||||||
|
.type = VSH_OT_STRING,
|
||||||
|
.help = N_("domain type")
|
||||||
|
},
|
||||||
|
{.name = NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool
|
||||||
|
cmdMaxvcpus(vshControl *ctl, const vshCmd *cmd)
|
||||||
|
{
|
||||||
|
const char *type = NULL;
|
||||||
|
int vcpus;
|
||||||
|
|
||||||
|
if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ((vcpus = virConnectGetMaxVcpus(ctl->conn, type)) < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
vshPrint(ctl, "%d\n", vcpus);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "nodeinfo" command
|
* "nodeinfo" command
|
||||||
*/
|
*/
|
||||||
@ -863,6 +901,12 @@ const vshCmdDef hostAndHypervisorCmds[] = {
|
|||||||
.info = info_hostname,
|
.info = info_hostname,
|
||||||
.flags = 0
|
.flags = 0
|
||||||
},
|
},
|
||||||
|
{.name = "maxvcpus",
|
||||||
|
.handler = cmdMaxvcpus,
|
||||||
|
.opts = opts_maxvcpus,
|
||||||
|
.info = info_maxvcpus,
|
||||||
|
.flags = 0
|
||||||
|
},
|
||||||
{.name = "node-memory-tune",
|
{.name = "node-memory-tune",
|
||||||
.handler = cmdNodeMemoryTune,
|
.handler = cmdNodeMemoryTune,
|
||||||
.opts = opts_node_memory_tune,
|
.opts = opts_node_memory_tune,
|
||||||
|
Loading…
Reference in New Issue
Block a user