提交 f88b6e42 编写于 作者: D Daniel P. Berrange

Format printf format specifier used with niothreadids

The niothreadids struct field is size_t, so must use %zu not %lu
with printf. While they're identical on some platforms, on others
they are different, causing warnings

conf/domain_conf.c: In function 'virDomainDefCheckABIStabilityFlags':
conf/domain_conf.c:19575:26: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'size_t {aka unsigned int}' [-Werror=format=]
                        _("Target domain iothreads count %lu does not "
                          ^

conf/domain_conf.c: In function 'virDomainDefFormatInternal':
conf/domain_conf.c:23915:46: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t {aka unsigned int}' [-Werror=format=]
         virBufferAsprintf(buf, "<iothreads>%lu</iothreads>\n",
                                              ^
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 7f602b82
...@@ -19572,8 +19572,8 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src, ...@@ -19572,8 +19572,8 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src,
if (src->niothreadids != dst->niothreadids) { if (src->niothreadids != dst->niothreadids) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Target domain iothreads count %lu does not " _("Target domain iothreads count %zu does not "
"match source %lu"), "match source %zu"),
dst->niothreadids, src->niothreadids); dst->niothreadids, src->niothreadids);
goto error; goto error;
} }
...@@ -23912,7 +23912,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, ...@@ -23912,7 +23912,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
goto error; goto error;
if (def->niothreadids > 0) { if (def->niothreadids > 0) {
virBufferAsprintf(buf, "<iothreads>%lu</iothreads>\n", virBufferAsprintf(buf, "<iothreads>%zu</iothreads>\n",
def->niothreadids); def->niothreadids);
if (virDomainDefIothreadShouldFormat(def)) { if (virDomainDefIothreadShouldFormat(def)) {
virBufferAddLit(buf, "<iothreadids>\n"); virBufferAddLit(buf, "<iothreadids>\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册