Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
875b7782
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
875b7782
编写于
2月 11, 2017
作者:
P
Pavel Hrdina
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
conf: remove redundant iothreads variable
Signed-off-by:
N
Pavel Hrdina
<
phrdina@redhat.com
>
上级
2b5dcda7
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
17 addition
and
23 deletion
+17
-23
src/conf/domain_conf.c
src/conf/domain_conf.c
+17
-15
src/conf/domain_conf.h
src/conf/domain_conf.h
+0
-1
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+0
-6
src/qemu/qemu_process.c
src/qemu/qemu_process.c
+0
-1
未找到文件。
src/conf/domain_conf.c
浏览文件 @
875b7782
...
...
@@ -2559,7 +2559,8 @@ virDomainIOThreadIDDefArrayFree(virDomainIOThreadIDDefPtr *def,
static int
virDomainIOThreadIDDefArrayInit(virDomainDefPtr def)
virDomainIOThreadIDDefArrayInit(virDomainDefPtr def,
unsigned int iothreads)
{
int retval = -1;
size_t i;
...
...
@@ -2570,11 +2571,11 @@ virDomainIOThreadIDDefArrayInit(virDomainDefPtr def)
/* Same value (either 0 or some number), then we have none to fill in or
* the iothreadid array was filled from the XML
*/
if (
def->
iothreads == def->niothreadids)
if (iothreads == def->niothreadids)
return 0;
/* iothread's are numbered starting at 1, account for that */
if (!(thrmap = virBitmapNew(
def->
iothreads + 1)))
if (!(thrmap = virBitmapNew(iothreads + 1)))
goto error;
virBitmapSetAll(thrmap);
...
...
@@ -2586,11 +2587,11 @@ virDomainIOThreadIDDefArrayInit(virDomainDefPtr def)
def->iothreadids[i]->iothread_id));
/* resize array */
if (VIR_REALLOC_N(def->iothreadids,
def->
iothreads) < 0)
if (VIR_REALLOC_N(def->iothreadids, iothreads) < 0)
goto error;
/* Populate iothreadids[] using the set bit number from thrmap */
while (def->niothreadids <
def->
iothreads) {
while (def->niothreadids < iothreads) {
if ((nxt = virBitmapNextSetBit(thrmap, nxt)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to populate iothreadids"));
...
...
@@ -16433,6 +16434,7 @@ virDomainDefParseXML(xmlDocPtr xml,
bool usb_other = false;
bool usb_master = false;
char *netprefix = NULL;
unsigned int iothreads = 0;
if (flags & VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA) {
char *schema = virFileFindResource("domain.rng",
...
...
@@ -16762,7 +16764,7 @@ virDomainDefParseXML(xmlDocPtr xml,
/* Optional - iothreads */
tmp = virXPathString("string(./iothreads[1])", ctxt);
if (tmp && virStrToLong_uip(tmp, NULL, 10, &
def->
iothreads) < 0) {
if (tmp && virStrToLong_uip(tmp, NULL, 10, &iothreads) < 0) {
virReportError(VIR_ERR_XML_ERROR,
_("invalid iothreads count '%s'"), tmp);
goto error;
...
...
@@ -16773,8 +16775,8 @@ virDomainDefParseXML(xmlDocPtr xml,
if ((n = virXPathNodeSet("./iothreadids/iothread", ctxt, &nodes)) < 0)
goto error;
if (n >
def->
iothreads)
def->
iothreads = n;
if (n > iothreads)
iothreads = n;
if (n && VIR_ALLOC_N(def->iothreadids, n) < 0)
goto error;
...
...
@@ -16795,7 +16797,7 @@ virDomainDefParseXML(xmlDocPtr xml,
}
VIR_FREE(nodes);
if (virDomainIOThreadIDDefArrayInit(def) < 0)
if (virDomainIOThreadIDDefArrayInit(def
, iothreads
) < 0)
goto error;
/* Extract cpu tunables. */
...
...
@@ -19493,11 +19495,11 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src,
if (!virDomainDefVcpuCheckAbiStability(src, dst))
goto error;
if (src->
iothreads != dst->iothrea
ds) {
if (src->
niothreadids != dst->niothreadi
ds) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Target domain iothreads count %u does not "
"match source %u"),
dst->
iothreads, src->iothrea
ds);
_("Target domain iothreads count %
l
u does not "
"match source %
l
u"),
dst->
niothreadids, src->niothreadi
ds);
goto error;
}
...
...
@@ -23828,8 +23830,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
goto error;
if (def->niothreadids > 0) {
virBufferAsprintf(buf, "<iothreads>%u</iothreads>\n",
def->
iothrea
ds);
virBufferAsprintf(buf, "<iothreads>%
l
u</iothreads>\n",
def->
niothreadi
ds);
/* Only print out iothreadids if we read at least one */
for (i = 0; i < def->niothreadids; i++) {
if (!def->iothreadids[i]->autofill)
...
...
src/conf/domain_conf.h
浏览文件 @
875b7782
...
...
@@ -2211,7 +2211,6 @@ struct _virDomainDef {
int
placement_mode
;
virBitmapPtr
cpumask
;
unsigned
int
iothreads
;
size_t
niothreadids
;
virDomainIOThreadIDDefPtr
*
iothreadids
;
...
...
src/qemu/qemu_driver.c
浏览文件 @
875b7782
...
...
@@ -5617,10 +5617,8 @@ qemuDomainHotplugAddIOThread(virQEMUDriverPtr driver,
_("got wrong number of IOThread ids from QEMU monitor. "
"got %d, wanted %d"),
new_niothreads, exp_niothreads);
vm->def->iothreads = new_niothreads;
goto cleanup;
}
vm->def->iothreads = exp_niothreads;
/*
* If we've successfully added an IOThread, find out where we added it
...
...
@@ -5716,10 +5714,8 @@ qemuDomainHotplugDelIOThread(virQEMUDriverPtr driver,
_("got wrong number of IOThread ids from QEMU monitor. "
"got %d, wanted %d"),
new_niothreads, exp_niothreads);
vm->def->iothreads = new_niothreads;
goto cleanup;
}
vm->def->iothreads = exp_niothreads;
virDomainIOThreadIDDel(vm->def, iothread_id);
...
...
@@ -5798,7 +5794,6 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
if (!virDomainIOThreadIDAdd(persistentDef, iothread_id))
goto endjob;
persistentDef->iothreads++;
} else {
virDomainIOThreadIDDefPtr iothrid;
if (!(iothrid = virDomainIOThreadIDFind(persistentDef,
...
...
@@ -5811,7 +5806,6 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
}
virDomainIOThreadIDDel(persistentDef, iothread_id);
persistentDef->iothreads--;
}
if (virDomainSaveConfig(cfg->configDir, driver->caps,
...
...
src/qemu/qemu_process.c
浏览文件 @
875b7782
...
...
@@ -2123,7 +2123,6 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver,
/* Remove any trace */
VIR_FREE
(
vm
->
def
->
iothreadids
);
vm
->
def
->
niothreadids
=
0
;
vm
->
def
->
iothreads
=
0
;
}
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录