[libvirt] [PATCH] virAsprintf cleanup
by Guido Günther
Hi,
please find a possible asprintf vs. virAsprintf cleanup attached. There
were several occations where the result of a failed asprintf was used.
Cheers,
-- Guido
15 years, 10 months
Re: [libvirt] KVM/qemu: problems with autostart of vms with non-bridged nets
by Gerd v. Egidy
> > I came up with the attached patch to fix this for me, but
> > a) I'm not sure if it is a clean use of the api to call virConnectOpen()
> > from within a state-initializer function
> > b) This is just for qemu/kvm, I haven't looked at any other drivers
> >
> > It would be nice if an experienced libvirt-developer could take a look at
> > this. Thank you very much.
>
> Thanks for the bug report & patch.
>
> Did this patch actually make it work for you ? AFAICT, there's a problem
> even earlier, which is that we are doing autostart of the virtual machines,
> before autostart of the networks and storage pools, so I'm not sure that
> this patch is sufficient.
This patch alone not, but this patch + the one in my first mail
(see https://www.redhat.com/archives/libvir-list/2008-November/msg00457.html)
together make it work for me. The first patch fixes the autostart order, the
second one adds the necessary conn structure.
Kind regards,
Gerd
--
Address (better: trap) for people I really don't want to get mail from:
james(a)cactusamerica.com
15 years, 10 months
[libvirt] [PATCH] avoid xgettext warning aboug bug-reporting address
by Jim Meyering
Building "make distcheck", I saw this go by:
/usr/bin/xgettext: warning: The option --msgid-bugs-address was not specified.
If you are using a `Makevars' file, please specify
the MSGID_BUGS_ADDRESS variable there; otherwise please
specify an --msgid-bugs-address command line option.
Here's the part of Makevars where that's defined:
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
# in the GNU gettext documentation, section 'Preparing Strings'.
# - Strings which use unclear terms or require additional context to be
# understood.
# - Strings which make invalid assumptions about notation of date, time or
# money.
# - Pluralisation problems.
# - Incorrect English spelling.
# - Incorrect formatting.
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS = http://translate.fedoraproject.org/
I figure it's better to point people at the Fedora Translation pages
than at libvirt's mailing list.
I had to propagate this into libvirt.pot as well to avoid
a "make distcheck" failure when update-po would try to move
the just-changed libvirt.po onto a read-only libvirt.pot file
because of the differing Report-Msgid-Bugs-To line.
>From 1bb5f75174200e465038ac5cb5b7eee2e798627b Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Mon, 5 Jan 2009 10:23:52 +0100
Subject: [PATCH] avoid xgettext warning aboug bug-reporting address
* po/Makevars (MSGID_BUGS_ADDRESS): Set, to avoid xgettext warning.
* po/libvirt.pot: Set bug-reporting address.
---
po/Makevars | 2 +-
po/libvirt.pot | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/po/Makevars b/po/Makevars
index 32692ab..9fbda10 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -34,7 +34,7 @@ COPYRIGHT_HOLDER = Free Software Foundation, Inc.
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
-MSGID_BUGS_ADDRESS =
+MSGID_BUGS_ADDRESS = http://translate.fedoraproject.org/
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
diff --git a/po/libvirt.pot b/po/libvirt.pot
index 92d6d88..23e6987 100644
--- a/po/libvirt.pot
+++ b/po/libvirt.pot
@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
+"Report-Msgid-Bugs-To: http://translate.fedoraproject.org/\n"
"POT-Creation-Date: 2008-12-04 16:26+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
--
1.6.1.rc3.350.g541da
15 years, 10 months
[libvirt] [PATCH 1/2] mark a few diagnostics for translation
by Jim Meyering
Here are two warning-avoidance changes I'm about to commit:
>From 588ecf78ffd6f284aa7872c13d946b9b5a146ef0 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 23 Dec 2008 16:49:26 +0100
Subject: [PATCH 1/2] mark a few diagnostics for translation
* src/xen_inotify.c (xenInotifyXendDomainsDirLookup): Mark a diagnostic.
(xenInotifyXendDomainsDirRemoveEntry, xenInotifyOpen): Likewise.
---
src/xen_inotify.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/xen_inotify.c b/src/xen_inotify.c
index fe1bc76..f6a7992 100644
--- a/src/xen_inotify.c
+++ b/src/xen_inotify.c
@@ -128,7 +128,7 @@ xenInotifyXendDomainsDirLookup(virConnectPtr conn, const char *filename,
if (virUUIDParse(uuid_str, rawuuid) < 0) {
virXenInotifyError(NULL, VIR_ERR_INTERNAL_ERROR,
- "parsing uuid %s", uuid_str);
+ _("parsing uuid %s"), uuid_str);
return -1;
}
/* call directly into xend here, as driver may not yet
@@ -145,7 +145,7 @@ xenInotifyXendDomainsDirLookup(virConnectPtr conn, const char *filename,
*name = strdup(configInfoList->doms[i]->name);
if (!*name) {
virXenInotifyError(NULL, VIR_ERR_INTERNAL_ERROR,
- "finding dom for %s", uuid_str);
+ _("finding dom for %s"), uuid_str);
return -1;
}
memcpy(uuid, configInfoList->doms[i]->uuid, VIR_UUID_BUFLEN);
@@ -201,7 +201,7 @@ xenInotifyXendDomainsDirRemoveEntry(virConnectPtr conn ATTRIBUTE_UNUSED,
if (virUUIDParse(uuidstr, uuid) < 0) {
virXenInotifyError(NULL, VIR_ERR_INTERNAL_ERROR,
- "parsing uuid %s", uuidstr);
+ _("parsing uuid %s"), uuidstr);
return -1;
}
@@ -428,7 +428,7 @@ xenInotifyOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
IN_CLOSE_WRITE | IN_DELETE |
IN_MOVED_TO | IN_MOVED_FROM) < 0) {
virXenInotifyError(NULL, VIR_ERR_INTERNAL_ERROR,
- "adding watch on %s", _(configDir));
+ _("adding watch on %s"), _(configDir));
return -1;
}
--
1.6.1.302.gccd4d
>From 527665ea39b24b46c9f276b879dbcf12049787c4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 23 Dec 2008 16:54:05 +0100
Subject: [PATCH 2/2] * Makefile.maint (msg_gen_function): Add to the list.
---
Makefile.maint | 64 +++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 47 insertions(+), 17 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index 0f43b1c..2f65bcf 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -361,36 +361,66 @@ sc_two_space_separator_in_usage:
echo "$(ME): an option and its description"; \
1>&2; exit 1; } || :
+# Many of the function names below came from this filter:
+# git grep -B2 '\<_('|grep -E '\.c- *[[:alpha:]_][[:alnum:]_]* ?\(.*[,;]$' \
+# |sed 's/.*\.c- *//'|perl -pe 's/ ?\(.*//'|sort -u \
+# |grep -vE '^(qsort|if|close|assert|fputc|free|N_|vir.*GetName|.*Unlock|virNodeListDevices|virHashRemoveEntry|freeaddrinfo|.*[fF]ree|xdrmem_create|xmlXPathFreeObject|virUUIDFormat|openvzSetProgramSentinal|polkit_action_unref)$'
+
msg_gen_function =
+msg_gen_function += DEBUG0
msg_gen_function += DISABLE_fprintf
-msg_gen_function += virXendError
-msg_gen_function += virXMLError
-msg_gen_function += virHashError
+msg_gen_function += ERROR
+msg_gen_function += ERROR0
+msg_gen_function += REMOTE_DEBUG
+msg_gen_function += ReportError
+msg_gen_function += VIR_FREE
+msg_gen_function += VIR_USE_CPU
+msg_gen_function += errorf
+msg_gen_function += lxcError
+msg_gen_function += networkLog
+msg_gen_function += networkReportError
+msg_gen_function += openvzError
+msg_gen_function += openvzLog
+msg_gen_function += qemudDispatchClientFailure
+msg_gen_function += qemudLog
+msg_gen_function += qemudReportError
+msg_gen_function += regerror
+msg_gen_function += remoteDispatchError
+msg_gen_function += remoteDispatchFormatError
+msg_gen_function += umlError
+msg_gen_function += umlLog
+msg_gen_function += umlReportError
msg_gen_function += virConfError
-msg_gen_function += virTestError
+msg_gen_function += virDomainReportError
+msg_gen_function += virHashError
msg_gen_function += virLibConnError
-msg_gen_function += virStorageReportError
-msg_gen_function += virxmlRpcError
+msg_gen_function += virLibDomainError
msg_gen_function += virLog
-msg_gen_function += qemudLog
-msg_gen_function += remoteDispatchError
+msg_gen_function += virNetworkReportError
+msg_gen_function += virNodeDeviceReportError
+msg_gen_function += virRaiseError
+msg_gen_function += virReportErrorHelper
+msg_gen_function += virSexprError
msg_gen_function += virStorageLog
+msg_gen_function += virStorageReportError
+msg_gen_function += virTestError
+msg_gen_function += virXMLError
+msg_gen_function += virXenInotifyError
+msg_gen_function += virXenStoreError
+msg_gen_function += virXendError
+msg_gen_function += virxmlRpcError
+msg_gen_function += vshCloseLogFile
msg_gen_function += xenXMError
-msg_gen_function += ReportError
-msg_gen_function += qemudReportError
-msg_gen_function += openvzLog
-msg_gen_function += openvzError
-msg_gen_function += virDomainReportError
-msg_gen_function += virReportErrorHelper
-msg_gen_function += lxcError
-msg_gen_function += umlError
# Uncomment the following and run "make syntax-check" to see diagnostics
# that are not yet marked for translation, but that need to be rewritten
# so that they are translatable.
# msg_gen_function += error
-# msg_gen_function += virXenError
+# msg_gen_function += fprintf
# msg_gen_function += testError
+# msg_gen_function += virXenError
+# msg_gen_function += vshPrint
+# msg_gen_function += vshError
func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
func_re := ($(func_or))
--
1.6.1.302.gccd4d
15 years, 10 months
[libvirt] PATCH: Fix numa build failure on 32-bit f9
by Daniel P. Berrange
The automated build on Fedora 9, i386 is currently failing with
cc1: warnings being treated as errors
nodeinfo.c: In function 'virCapsInitNUMA':
nodeinfo.c:212: error: passing argument 2 of 'numa_node_to_cpus' from incompatible pointer type
make[3]: *** [libvirt_driver_la-nodeinfo.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
The following patch addresses it:
Index: src/nodeinfo.c
===================================================================
RCS file: /data/cvs/libvirt/src/nodeinfo.c,v
retrieving revision 1.15
diff -u -p -u -r1.15 nodeinfo.c
--- src/nodeinfo.c 21 Dec 2008 18:55:09 -0000 1.15
+++ src/nodeinfo.c 5 Jan 2009 12:22:04 -0000
@@ -194,7 +194,7 @@ int
virCapsInitNUMA(virCapsPtr caps)
{
int n;
- uint64_t *mask = NULL;
+ unsigned long *mask = NULL;
int *cpus = NULL;
int ret = -1;
int max_n_cpus = NUMA_MAX_N_CPUS;
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
15 years, 10 months
[libvirt] Where are libvirt configuration files located ?
by Fabien Dupont
Hello.
As there's a /etc/libvirt/qemu/networks directory, where are located
configuration files for pools, domains, storage volumes ? How can I
autostart a pool, as I don't know where to store its XML Dump ?
Your help would be very useful. Thanks.
--
Fabien Dupont
System Engineer
Email : evenit(a)gmail.com
15 years, 10 months
[libvirt] [PATCH] Makefile.maint: sync from coreutils
by Jim Meyering
I sync'd Makefile.maint from coreutils a few weeks ago.
Here's the result I'll push soon:
[no review needed, imho, since this affects only "make syntax-check"]
>From fb3793e69bf25ccd71b8e0815e86cdd952f3b759 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 5 Dec 2008 13:57:48 +0100
Subject: [PATCH] Makefile.maint: sync from coreutils
---
Makefile.maint | 77 ++++++++++++++++++++++++++++++-------------------------
1 files changed, 42 insertions(+), 35 deletions(-)
diff --git a/Makefile.maint b/Makefile.maint
index 2f65bcf..4e2d347 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -62,7 +62,7 @@ sc_avoid_write:
fi
sc_cast_of_argument_to_free:
- @grep -nE '\<free \(\(' $$($(VC_LIST_EXCEPT)) && \
+ @grep -nE '\<free *\( *\(' $$($(VC_LIST_EXCEPT)) && \
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
exit 1; } || :
@@ -100,9 +100,10 @@ sc_prohibit_atoi_atof:
# Use STREQ rather than comparing strcmp == 0, or != 0.
# Similarly, use STREQLEN or STRPREFIX rather than strncmp.
sc_prohibit_strcmp:
- @grep -nE '! *str''n?cmp *\(|\<str''n?cmp *\([^)]+\) *==' \
- $$($(VC_LIST_EXCEPT)) && \
- { echo '$(ME): use STREQ in place of the above uses of str''cmp' \
+ @grep -nE '! *strn?cmp *\(|\<strn?cmp *\([^)]+\) *==' \
+ $$($(VC_LIST_EXCEPT)) \
+ | grep -vE ':# *define STREQ(LEN)?\(' && \
+ { echo '$(ME): use STREQ(LEN) in place of the above uses of strcmp(strncmp)' \
1>&2; exit 1; } || :
# Use virAsprintf rather than a'sprintf since *strp is undefined on error.
@@ -124,6 +125,7 @@ sc_file_system:
'rewrite to use "file system"' 1>&2; \
exit 1; } || :
+# Don't use cpp tests of this symbol. All code assumes config.h is included.
sc_no_have_config_h:
@grep -n '^# *if.*HAVE''_CONFIG_H' $$($(VC_LIST_EXCEPT)) && \
{ echo '$(ME): found use of HAVE''_CONFIG_H; remove' \
@@ -235,19 +237,22 @@ endif
# On 2004-04-13, they were all changed to start with gl_ instead.
# Make sure that none are inadvertently reintroduced.
sc_prohibit_jm_in_m4:
- @grep -nE 'jm_[A-Z]' \
- $$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \
- { echo '$(ME): do not use jm_ in m4 macro names' \
+ @grep -nE 'jm_[A-Z]' \
+ $$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \
+ { echo '$(ME): do not use jm_ in m4 macro names' \
1>&2; exit 1; } || :
+# Ensure that each root-requiring test is run via the "check-root" rule.
sc_root_tests:
@if test -d tests \
&& grep check-root tests/Makefile.am>/dev/null 2>&1; then \
t1=sc-root.expected; t2=sc-root.actual; \
grep -nl '^require_root_$$' \
- $$($(VC_LIST) tests) |sed s,tests,., |sort > $$t1; \
- sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
- $(srcdir)/tests/Makefile.am |sort > $$t2; \
+ $$($(VC_LIST) tests) |sed s,tests/,, |sort > $$t1; \
+ sed -n '/^root_tests =[ ]*\\$$/,/[^\]$$/p' \
+ $(srcdir)/tests/Makefile.am \
+ | sed 's/^ *//;/^root_tests =/d' \
+ | tr -s '\012\\' ' ' | fmt -1 | sort > $$t2; \
diff -u $$t1 $$t2 || diff=1; \
rm -f $$t1 $$t2; \
test "$$diff" \
@@ -469,12 +474,20 @@ sc_GPL_version:
# Ensure that the c99-to-c89 patch applies cleanly.
patch-check:
rm -rf src-c89 $@.1 $@.2
- cp -a src src-c89
- (cd src-c89; patch -p1 -V never --fuzz=0) < src/c99-to-c89.diff \
+ cp -a $(srcdir)/src src-c89
+ if test "x$(srcdir)" != x.; then \
+ cp -a src/* src-c89; \
+ dotfiles=`ls src/.[!.]* 2>/dev/null`; \
+ test -z "$$dotfiles" || cp -a src/.[!.]* src-c89; \
+ fi
+ (cd src-c89; patch -p1 -V never --fuzz=0) < $(srcdir)/src/c99-to-c89.diff \
> $@.1 2>&1
- if test "$$REGEN_PATCH" = yes; then \
- diff -upr src src-c89 | sed 's,src-c89/,src/,' \
- | grep -v '^Only in' > new-diff || : ; fi
+ if test "$(REGEN_PATCH)" = yes; then \
+ diff -upr $(srcdir)/src src-c89 | sed 's,$(srcdir)/src-c89/,src/,' \
+ | grep -vE '^(Only in|File )' \
+ | perl -pe 's/^((?:\+\+\+|---) \S+\t).*/$${1}$(epoch_date)/;' \
+ -e 's/^ $$//' \
+ > new-diff || : ; fi
grep -v '^patching file ' $@.1 > $@.2 || :
msg=ok; test -s $@.2 && msg='fuzzy patch' || : ; \
rm -f src-c89/*.o || msg='rm failed'; \
@@ -529,7 +542,7 @@ changelog-check:
m4-check:
@grep -n 'AC_DEFUN([^[]' $(srcdir)/m4/*.m4 \
- && { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
+ && { echo '$(ME): quote the first arg to AC_DEFUN' 1>&2; \
exit 1; } || :
fix_po_file_diag = \
@@ -539,20 +552,19 @@ apply the above patch\n'
# Verify that all source files using _() are listed in po/POTFILES.in.
po_file = po/POTFILES.in
po-check:
- @if test -f po/POTFILES.in; then \
- grep -E -v '^(#|$$)' po/POTFILES.in \
+ @if test -f $(po_file); then \
+ grep -E -v '^(#|$$)' $(po_file) \
| grep -v '^src/false\.c$$' | sort > $@-1; \
files=; \
for file in $$($(VC_LIST_EXCEPT)); do \
case $$file in \
- djgpp/* | man/*) continue;; \
- */c99-to-c89.diff) continue;; \
+ *.?|*.??) ;; \
+ *) continue;; \
esac; \
case $$file in \
*.[ch]) \
base=`expr " $$file" : ' \(.*\)\..'`; \
{ test -f $$base.l || test -f $$base.y; } && continue;; \
- *) continue;; \
esac; \
files="$$files $$file"; \
done; \
@@ -568,7 +580,7 @@ po-check:
# gettext recognizes it as a string requiring translation.
author_mark_check:
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
- { echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
+ { echo '$(ME): enclose the above strings in N_ (...)' 1>&2; \
exit 1; } || :
# Sometimes it is useful to change the PATH environment variable
@@ -577,7 +589,7 @@ author_mark_check:
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
# and there probably aren't many projects with so many Makefile.am files
# that we'd have to worry about limits on command line length.
-msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
+msg = '$(ME): Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
makefile_path_separator_check:
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
&& { echo $(msg) 1>&2; exit 1; } || :
@@ -591,7 +603,7 @@ writable-files:
test -w $$file \
|| { echo ERROR: $$file is not writable; fail=1; }; \
done; \
- test "$$fail" && exit 1 || :
+ test "$$fail" && exit 1 || : ; \
fi
v_etc_file = lib/version-etc.c
@@ -640,16 +652,18 @@ maintainer-distcheck:
# arithmetic problems with -Wpointer-arith.
# These CFLAGS are pretty strict. If you build this target, you probably
# have to have a recent version of gcc and glibc headers.
-# The for-loop below ensures that there is a bin/ directory full of all
-# of the programs under test (except the few that are required for basic
-# Makefile rules), all symlinked to the just-built "false" program.
+# The hard-linking for-loop below ensures that there is a bin/ directory
+# full of all of the programs under test (except the ones that are required
+# for basic Makefile rules), all symlinked to the just-built "false" program.
# This is to ensure that if ever a test neglects to make PATH include
# the build srcdir, these always-failing programs will run.
# Otherwise, it is too easy to test the wrong programs.
# Note that "false" itself is a symlink to true, so it too will malfunction.
TMPDIR ?= /tmp
t=$(TMPDIR)/$(PACKAGE)/test
-my-distcheck: $(local-check) check
+my-distcheck: $(DIST_ARCHIVES) $(local-check)
+ $(MAKE) syntax-check
+ $(MAKE) check
-rm -rf $(t)
mkdir -p $(t)
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
@@ -662,13 +676,6 @@ my-distcheck: $(local-check) check
(cd $(t) && mv $(distdir) $(distdir).old \
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
- if test -f $(srcdir)/src/c99-to-c89.diff; then \
- cd $(t)/$(distdir) \
- && (cd src && patch -V never --fuzz=0 <c99-to-c89.diff) \
- && ./configure --disable-largefile \
- CFLAGS='-Werror -ansi -Wno-long-long' \
- && $(MAKE); \
- fi
-rm -rf $(t)
@echo "========================"; \
echo "$(distdir).tar.gz is ready for distribution"; \
--
1.6.1.94.g9388
15 years, 10 months
[libvirt] [PATCH] avoid bogus descriptions due to use of gettext with the empty string
by Jim Meyering
I noticed many warnings like this:
src/virsh.c:2115: warning: Empty msgid. It is reserved by GNU gettext:
gettext("") returns the header entry with
meta information, not the empty string.
This is the trivial fix I'll commit shortly:
>From ac43b94577b8df451b420be70202c1e2aa4c1742 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Mon, 5 Jan 2009 09:55:47 +0100
Subject: [PATCH] avoid bogus descriptions due to use of gettext with the empty string
* src/virsh.c: Use `""', not `gettext_noop("")', in numerous
vshCmdInfo definitions. The latter provokes a warning from gettext.
---
src/virsh.c | 33 ++++++++++++++++-----------------
1 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/src/virsh.c b/src/virsh.c
index 3d55b32..fd23e9f 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -1,7 +1,7 @@
/*
* virsh.c: a Xen shell used to exercise the libvirt API
*
- * Copyright (C) 2005, 2007-2008 Red Hat, Inc.
+ * Copyright (C) 2005, 2007-2009 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
@@ -2112,7 +2112,7 @@ cmdDumpXML(vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_domname[] = {
{"help", gettext_noop("convert a domain id or UUID to domain name")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -2142,7 +2142,7 @@ cmdDomname(vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_domid[] = {
{"help", gettext_noop("convert a domain name or UUID to domain id")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -2177,7 +2177,7 @@ cmdDomid(vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_domuuid[] = {
{"help", gettext_noop("convert a domain name or id to domain UUID")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -2625,7 +2625,7 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
*/
static const vshCmdInfo info_network_name[] = {
{"help", gettext_noop("convert a network UUID to network name")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -2732,7 +2732,7 @@ cmdNetworkUndefine(vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_network_uuid[] = {
{"help", gettext_noop("convert a network name to network UUID")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -3600,7 +3600,7 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_pool_name[] = {
{"help", gettext_noop("convert a pool UUID to pool name")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -3828,7 +3828,7 @@ cmdPoolUndefine(vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_pool_uuid[] = {
{"help", gettext_noop("convert a pool name to pool UUID")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -4135,7 +4135,7 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
*/
static const vshCmdInfo info_vol_name[] = {
{"help", gettext_noop("convert a vol UUID to vol name")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -4168,7 +4168,7 @@ cmdVolName(vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_vol_key[] = {
{"help", gettext_noop("convert a vol UUID to vol key")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -4201,7 +4201,7 @@ cmdVolKey(vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_vol_path[] = {
{"help", gettext_noop("convert a vol UUID to vol path")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -4317,7 +4317,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
*/
static const vshCmdInfo info_node_list_devices[] = {
{"help", gettext_noop("enumerate devices on this host")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -4405,7 +4405,7 @@ cmdNodeDeviceDumpXML (vshControl *ctl, const vshCmd *cmd)
*/
static const vshCmdInfo info_hostname[] = {
{"help", gettext_noop("print the hypervisor hostname")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -4434,7 +4434,7 @@ cmdHostname (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
*/
static const vshCmdInfo info_uri[] = {
{"help", gettext_noop("print the hypervisor canonical URI")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -5480,7 +5480,7 @@ static const vshCmdOptDef opts_pool_edit[] = {
*/
static const vshCmdInfo info_quit[] = {
{"help", gettext_noop("quit this interactive terminal")},
- {"desc", gettext_noop("")}, /* FIXME: describe */
+ {"desc", ""},
{NULL, NULL}
};
@@ -5722,8 +5722,7 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
fputc('\n', stdout);
if (desc[0]) {
- /* FIXME: remove this test once all of the empty descriptions
- have been removed; see `FIXME: describe' lines. */
+ /* Print the description only if it's not empty. */
fputs(_("\n DESCRIPTION\n"), stdout);
fprintf(stdout, " %s\n", desc);
}
--
1.6.1.rc3.350.g541da
15 years, 10 months