[Libvir] PATCH: 0/16: Storage management APIs
by Daniel P. Berrange
The patch series that follows provides storage management APIs for dealing
with local directories, local filesystems, remote filesystems, logical
volumes (LVM), disk partitioning, and iSCSI. It will also soon support
SCSI host adapters (including NPIV).
I'll include comments inline with each patch. The final patch in the
series also provides a 'storage.html' page for the website giving a fairly
friendly overview of the storage pool types and their associated XML
examples.
Although included here, the one API i really don't like is the one for
discovery virConnectDiscoverStoragePools, since its API is not flexible
enough in terms of metadata it accepts. I will probably just leave this
out next time around, since its not critical for the core functionality
and can thus be added later.
Also TBD is a way to format a filesystem on a volume, and how to clone
an existing volume, and take a snapshot. These things can all be added
at a later date.
Finally it does not include the async job support. This is also best added
once the core code is merged.
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
16 years, 10 months
[Libvir] [PATCH] Avoid "make syntax-check" failure.
by Jim Meyering
There were a few trailing blanks in a generated Makefile.am file.
This patch fixes the python script not to emit the offending spaces:
Avoid "make syntax-check" failure.
* docs/examples/index.py: Don't emit trailing blanks.
* docs/examples/Makefile.am: Regenerate.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
docs/examples/Makefile.am | 6 +++---
docs/examples/index.py | 10 +++-------
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/docs/examples/Makefile.am b/docs/examples/Makefile.am
index 6b5963e..9da4e21 100644
--- a/docs/examples/Makefile.am
+++ b/docs/examples/Makefile.am
@@ -22,9 +22,9 @@ install-data-local:
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml \
$(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
-EXTRA_DIST=examples.xsl index.py examples.xml
+EXTRA_DIST=examples.xsl index.py examples.xml
-noinst_PROGRAMS=info1 suspend
+noinst_PROGRAMS=info1 suspend
info1_SOURCES=info1.c
info1_LDFLAGS=
@@ -36,7 +36,7 @@ suspend_LDFLAGS=
suspend_DEPENDENCIES= $(DEPS)
suspend_LDADD= $(LDADDS)
-valgrind:
+valgrind:
$(MAKE) CHECKER='valgrind' tests
tests: $(noinst_PROGRAMS)
diff --git a/docs/examples/index.py b/docs/examples/index.py
index 7ea89e1..8f386ed 100755
--- a/docs/examples/index.py
+++ b/docs/examples/index.py
@@ -245,18 +245,14 @@ install-data-local:
$(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
"""
- EXTRA_DIST=""
- for extra in extras:
- EXTRA_DIST = EXTRA_DIST + extra + " "
+ EXTRA_DIST= string.join(extras, ' ')
Makefile = Makefile + "EXTRA_DIST=%s\n\n" % (EXTRA_DIST)
- noinst_PROGRAMS=""
- for example in examples:
- noinst_PROGRAMS = noinst_PROGRAMS + example + " "
+ noinst_PROGRAMS= string.join(examples, ' ')
Makefile = Makefile + "noinst_PROGRAMS=%s\n\n" % (noinst_PROGRAMS)
for example in examples:
Makefile = Makefile + "%s_SOURCES=%s.c\n%s_LDFLAGS=\n%s_DEPENDENCIES= $(DEPS)\n%s_LDADD= $(LDADDS)\n\n" % (example, example, example,
example, example)
- Makefile = Makefile + "valgrind: \n\t$(MAKE) CHECKER='valgrind' tests\n\n"
+ Makefile = Makefile + "valgrind:\n\t$(MAKE) CHECKER='valgrind' tests\n\n"
Makefile = Makefile + "tests: $(noinst_PROGRAMS)\n"
Makefile = Makefile + "\t@(echo '## examples regression tests')\n"
# Makefile = Makefile + "\t@(echo > .memdump)\n"
--
1.5.4.2.134.g82883
16 years, 10 months
[Libvir] Deprecated PolicyKit function
by Mark McLoughlin
Hi,
Just a heads-up ... trying to build with -Werror on Fedora rawhide, I
see:
cc1: warnings being treated as errors
remote.c: In function 'remoteDispatchAuthPolkit':
remote.c:2661: error: 'polkit_context_can_caller_do_action' is deprecated (declared at /usr/include/PolicyKit/polkit/polkit-context.h:173)
Cheers,
Mark.
16 years, 10 months
[Libvir] Dependent Xen and Libvirt patches?
by Ryan Scott
Hi all,
I have a question about compatibility issues when submitting changes
to both Xen and libvirt.
First, some background: I'm seeing a problem with virsh detach-disk.
It'll detach a disk from a running domain, but not update the domain's
configuration, so the disk will be back when the domain is rebooted.
This seems undesirable; I think the disk should be permanently removed
by virsh detach-disk.
To fix this, patches are necessary in both Xen and Libvirt.
First, the Xen patch:
--- old/tools/python/xen/xend/server/SrvDomain.py
+++ new/tools/python/xen/xend/server/SrvDomain.py
@@ -186,7 +186,9 @@
def op_device_destroy(self, _, req):
return self.call(self.dom.destroyDevice,
[['type', 'str'],
- ['dev', 'str']],
+ ['dev', 'str'],
+ ['force', 'int'],
+ ['rm_cfg', 'int']],
req)
def op_device_configure(self, _, req):
Next, the libvirt patch:
diff --git a/src/xend_internal.c b/src/xend_internal.c
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -3269,7 +3273,7 @@ xenDaemonDetachDevice(virDomainPtr domai
if (virDomainXMLDevID(domain, xml, class, ref, sizeof(ref)))
return (-1);
return(xend_op(domain->conn, domain->name, "op", "device_destroy",
- "type", class, "dev", ref, NULL));
+ "type", class, "dev", ref, "force", "0", "rm_cfg", "1", NULL));
}
Now, on to my question: I want to make sure I can do this without
causing too many problems. In my testing, the libvirt change without
the xen change won't cause any additional issues, but the xen change
without the libvirt change will cause all 'virsh detach-disk' calls to fail.
How should a change like this be handled? Submit the libvirt patch
now, and sit on the Xen patch for a while? Or submit both and include a
note that an upgrade will be necessary?
Thanks,
Ryan
16 years, 10 months
[Libvir] Announcing oVirt
by Hugh O. Brock
Announcing oVirt
================
It is my pleasure to announce oVirt, the next step in open virtual
machine management.
oVirt is:
* A small OS image that runs libvirt and hosts virtual machines
* A Web-based virtual machine management console
oVirt goals:
* Empower virtual machine owners without giving up control of
hardware
* Automate virtual machine clustering, load balancing, and SLA
maintenance
* Simplify management of large numbers of machines
* Work across platforms and architectures
oVirt uses:
* A kerberos/LDAP server for authentication and authorization
(oVirt ships with FreeIPA)
* DNS/DHCP services on the local LAN -- or provides them for oVirt
hosts over a private network if desired
* Libvirt for virtual machine management, storage management, and
secure remote communication
* collectd for stats gathering and monitoring
* Rails for rapid, flexible development
oVirt mailing list: http://www.redhat.com/mailman/listinfo/ovirt-devel
oVirt IRC: irc.freenode.net/#ovirt
oVirt website: http://ovirt.org
We encourage anyone interested to download the source (git clone
git://git.et.redhat.com/ovirt) or the prebuilt appliance
(http://ovirt.org/download). Let us know what you think!
Enjoy,
--Hugh Brock
hbrock(a)redhat.com
16 years, 10 months
[Libvir] [PATCH] autobuild.sh: Run "make syntax-check"
by Jim Meyering
Tiny change.
So the autobuilder runs these checks, too.
diff --git a/autobuild.sh b/autobuild.sh
index 623b33a..9e0c2ca 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -23,6 +23,7 @@ make install
set -o pipefail
make check 2>&1 | tee $RESULTS
+make syntax-check 2>&1 | tee -a $RESULTS
make cov
rm -f *.tar.gz
16 years, 10 months
[Libvir] [PATCH] Pull useless-if-before-free from gnulib, and update.
by Jim Meyering
I added a slightly improved useless-if-before-free to gnulib, so this
patch makes bootstrap pull the script from there. It also pulls in a
vasnprintf module improvement: it works around a just-discovered bug in
HPUX 10.20's printf(3) implementation:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12505/focus=12547
Here's the patch:
Pull useless-if-before-free from gnulib, and update.
* bootstrap (gnulib_tool): Add useless-if-before-free to
the list of modules.
* build-aux/useless-if-before-free: Update from gnulib.
* gnulib/lib/vasnprintf.c: Work around a bug in HPUX 10.20.
* gnulib/m4/vasnprintf.m4: Likewise.
---
bootstrap | 1 +
build-aux/useless-if-before-free | 96 +++++++++++++++++++++++++++++--------
gnulib/lib/Makefile.am | 9 +++-
gnulib/lib/vasnprintf.c | 37 ++++++++++-----
gnulib/m4/gnulib-cache.m4 | 4 +-
gnulib/m4/gnulib-comp.m4 | 1 +
gnulib/m4/vasnprintf.m4 | 20 +++++++-
7 files changed, 130 insertions(+), 38 deletions(-)
diff --git a/bootstrap b/bootstrap
index 1627086..d8b79d9 100755
--- a/bootstrap
+++ b/bootstrap
@@ -78,6 +78,7 @@ $gnulib_tool \
--import physmem getaddrinfo \
sys_stat vasprintf strndup \
strsep poll gettext getpass \
+ useless-if-before-free \
vc-list-files
rm -f \
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
index 57040a3..eb18483 100755
--- a/build-aux/useless-if-before-free
+++ b/build-aux/useless-if-before-free
@@ -1,24 +1,43 @@
#!/usr/bin/perl -T
# Detect instances of "if (p) free (p);".
-# Likewise for "if (p != NULL) free (p);".
+# Likewise for "if (p != NULL) free (p);". And with braces.
-my $VERSION = '2008-02-04 22:25'; # UTC
+my $VERSION = '2008-02-11 08:08'; # UTC
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
# do its job. Otherwise, update this string manually.
-# Exit status is like grep: 0 for no match. 1 for any number.
-# Note: giving line numbers isn't practical, since I've reset the
-# input record separator.
+# Copyright (C) 2008 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Written by Jim Meyering
+
use strict;
use warnings;
use Getopt::Long;
(my $ME = $0) =~ s|.*/||;
-my $debug = 0;
-my $verbose = 0;
+# use File::Coda; # http://meyering.net/code/Coda/
+END {
+ defined fileno STDOUT or return;
+ close STDOUT and return;
+ warn "$ME: failed to close standard output: $!\n";
+ $? ||= 1;
+}
sub usage ($)
{
@@ -33,18 +52,32 @@ sub usage ($)
print $STREAM <<EOF;
Usage: $ME [OPTIONS] FILE...
+Detect any instance in FILE of a useless "if" test before a free call, e.g.,
+"if (p) free (p);". Any such test may be safely removed without affecting
+the semantics of the C code in FILE. Use --name=FOO --name=BAR to also
+detect free-like functions named FOO and BAR.
+
OPTIONS:
+ --list print only the name of each matching FILE (\0-terminated)
--name=N add name N to the list of `free'-like functions to detect;
may be repeated
--help display this help and exit
--version output version information and exit
- --verbose generate verbose output
+
+Exit status:
+
+ 0 no match
+ 1 one or more matches
+ 2 an error
EXAMPLE:
- git ls-files -z |xargs -0 $ME
+For example, this command prints all removable "if" tests before "free"
+and "kfree" calls in the linux kernel sources:
+
+ git ls-files -z |xargs -0 $ME --name=kfree
EOF
}
@@ -52,32 +85,40 @@ EOF
}
{
+ sub EXIT_MATCH {0}
+ sub EXIT_NO_MATCH {1}
+ sub EXIT_ERROR {2}
+ my $err = EXIT_NO_MATCH;
+
+ my $list;
my @name = qw(free);
GetOptions
(
- debug => \$debug,
- verbose => \$verbose,
help => sub { usage 0 },
version => sub { print "$ME version $VERSION\n"; exit },
+ list => \$list,
'name=s@' => \@name,
) or usage 1;
# Make sure we have the right number of non-option arguments.
# Always tell the user why we fail.
@ARGV < 1
- and (warn "$ME: missing FILE argument\n"), usage 1;
+ and (warn "$ME: missing FILE argument\n"), usage EXIT_ERROR;
my $or = join '|', @name;
my $regexp = qr/(?:$or)/;
# Set the input record separator.
+ # Note: this makes it impractical to print line numbers.
$/ = '"';
my $found_match = 0;
+ FILE:
foreach my $file (@ARGV)
{
open FH, '<', $file
- or die "$ME: can't open `$file' for reading: $!\n";
+ or (warn "$ME: can't open `$file' for reading: $!\n"),
+ $err = EXIT_ERROR, next;
while (defined (my $line = <FH>))
{
if ($line =~
@@ -85,27 +126,40 @@ EOF
(?: \s*$regexp\s*\(\s*\2\s*\)|
\s*\{\s*$regexp\s*\(\s*\2\s*\)\s*;\s*\}))/sx)
{
- print "$file: $1\n";
$found_match = 1;
+ $list
+ and (print "$file\0"), next FILE;
+ print "$file: $1\n";
}
}
+ }
+ continue
+ {
close FH;
}
- exit !$found_match;
+
+ $found_match && $err == EXIT_NO_MATCH
+ and $err = EXIT_MATCH;
+
+ exit $err;
}
my $foo = <<'EOF';
# The above is to *find* them.
# This adjusts them, removing the unnecessary "if (p)" part.
-# FIXME: do something like this as an option.
-git ls-files -z --exclude=$ME |xargs -0 \
-perl -0x3b -pi -e 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+((?:sexpr_)?free\s*\(\s*\1\s*\))/$2/s'
+# FIXME: do something like this as an option (doesn't do braces):
+git ls-files -z |xargs -0 \
+perl -0x3b -pi -e 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+(k?free\s*\(\s*\1\s*\))/$2/s'
-When modifying files, refuse to process anything other than a regular file.
+useless-if-before-free -l $(lid -knone free) | xargs -0 \
+ perl -0x3b -pi -e \
+ 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+(free\s*\(\s*\1\s*\))/$2/s'
-# Or this one-liner to detect them:
-git ls-files -z |xargs -0 perl -00 -ne '/\b(if\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)(?:\s*(?:sexpr_)?free\s*\(\s*\2\s*\)|\s*\{\s*(?:sexpr_)?free\s*\(\s*\2\s*\)\s*;\s*\}))/sx and print "$1\n"'
+Be careful that the result of the above transformation is valid.
+If the matched string is followed by "else", then obviously, it won't be.
+
+When modifying files, refuse to process anything other than a regular file.
EOF
## Local Variables:
diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
index 8f545ca..9495caf 100644
--- a/gnulib/lib/Makefile.am
+++ b/gnulib/lib/Makefile.am
@@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl getaddrinfo getpass gettext physmem poll strndup strsep sys_stat vasprintf vc-list-files
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl getaddrinfo getpass gettext physmem poll strndup strsep sys_stat useless-if-before-free vasprintf vc-list-files
AUTOMAKE_OPTIONS = 1.5 gnits
@@ -701,6 +701,13 @@ EXTRA_DIST += unistd.in.h
## end gnulib module unistd
+## begin gnulib module useless-if-before-free
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/useless-if-before-free
+
+## end gnulib module useless-if-before-free
+
## begin gnulib module vasnprintf
diff --git a/gnulib/lib/vasnprintf.c b/gnulib/lib/vasnprintf.c
index 205a9bf..ed579d3 100644
--- a/gnulib/lib/vasnprintf.c
+++ b/gnulib/lib/vasnprintf.c
@@ -3566,7 +3566,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
{
arg_type type = a.arg[dp->arg_index].type;
int flags = dp->flags;
-#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
int has_width;
size_t width;
#endif
@@ -3579,7 +3579,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#else
# define prec_ourselves 0
#endif
-#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if NEED_PRINTF_FLAG_LEFTADJUST
+# define pad_ourselves 1
+#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
int pad_ourselves;
#else
# define pad_ourselves 0
@@ -3593,7 +3595,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
TCHAR_T *tmp;
#endif
-#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
has_width = 0;
width = 0;
if (dp->width_start != dp->width_end)
@@ -3883,7 +3885,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif
/* Decide whether to perform the padding ourselves. */
-#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
switch (dp->conversion)
{
# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
@@ -4008,7 +4010,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#endif
*fbp = dp->conversion;
#if USE_SNPRINTF
-# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))
+# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
fbp[1] = '%';
fbp[2] = 'n';
fbp[3] = '\0';
@@ -4021,6 +4023,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
in format strings in writable memory may crash the program
(if compiled with _FORTIFY_SOURCE=2), so we should avoid it
in this situation. */
+ /* On native Win32 systems (such as mingw), we can avoid using
+ %n because:
+ - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
+ snprintf does not write more than the specified number
+ of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes
+ '4', '5', '6' into buf, not '4', '5', '\0'.)
+ - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
+ allows us to recognize the case of an insufficient
+ buffer size: it returns -1 in this case.
+ On native Win32 systems (such as mingw) where the OS is
+ Windows Vista, the use of %n in format strings by default
+ crashes the program. See
+ <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
+ <http://msdn2.microsoft.com/en-us/library/ms175782(VS.80).aspx>
+ So we should avoid %n in this situation. */
fbp[1] = '\0';
# endif
#else
@@ -4494,7 +4511,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Here count <= allocated - length. */
/* Perform padding. */
-#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
if (pad_ourselves && has_width)
{
size_t w;
@@ -4535,15 +4552,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
# endif
DCHAR_T *p = rp + count;
DCHAR_T *end = p + pad;
-# if NEED_PRINTF_FLAG_ZERO
DCHAR_T *pad_ptr;
-# if !DCHAR_IS_TCHAR
+# if !DCHAR_IS_TCHAR
if (dp->conversion == 'c'
|| dp->conversion == 's')
/* No zero-padding for string directives. */
pad_ptr = NULL;
else
-# endif
+# endif
{
pad_ptr = (*rp == '-' ? rp + 1 : rp);
/* No zero-padding of "inf" and "nan". */
@@ -4551,7 +4567,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
|| (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
pad_ptr = NULL;
}
-# endif
/* The generated string now extends from rp to p,
with the zero padding insertion point being at
pad_ptr. */
@@ -4564,7 +4579,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
for (; pad > 0; pad--)
*p++ = ' ';
}
-# if NEED_PRINTF_FLAG_ZERO
else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
{
/* Pad with zeroes. */
@@ -4575,7 +4589,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
for (; pad > 0; pad--)
*p++ = '0';
}
-# endif
else
{
/* Pad with spaces on the left. */
diff --git a/gnulib/m4/gnulib-cache.m4 b/gnulib/m4/gnulib-cache.m4
index 357f170..50f743b 100644
--- a/gnulib/m4/gnulib-cache.m4
+++ b/gnulib/m4/gnulib-cache.m4
@@ -15,11 +15,11 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl getaddrinfo getpass gettext physmem poll strndup strsep sys_stat vasprintf vc-list-files
+# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl getaddrinfo getpass gettext physmem poll strndup strsep sys_stat useless-if-before-free vasprintf vc-list-files
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
-gl_MODULES([getaddrinfo getpass gettext physmem poll strndup strsep sys_stat vasprintf vc-list-files])
+gl_MODULES([getaddrinfo getpass gettext physmem poll strndup strsep sys_stat useless-if-before-free vasprintf vc-list-files])
gl_AVOID([])
gl_SOURCE_BASE([gnulib/lib])
gl_M4_BASE([gnulib/m4])
diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4
index 8896a38..0eeee9c 100644
--- a/gnulib/m4/gnulib-comp.m4
+++ b/gnulib/m4/gnulib-comp.m4
@@ -225,6 +225,7 @@ AC_DEFUN([gltests_LIBSOURCES], [
AC_DEFUN([gl_FILE_LIST], [
build-aux/config.rpath
build-aux/link-warning.h
+ build-aux/useless-if-before-free
build-aux/vc-list-files
lib/alloca.in.h
lib/asnprintf.c
diff --git a/gnulib/m4/vasnprintf.m4 b/gnulib/m4/vasnprintf.m4
index 6449a9c..c4d3f4f 100644
--- a/gnulib/m4/vasnprintf.m4
+++ b/gnulib/m4/vasnprintf.m4
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 23
-dnl Copyright (C) 2002-2004, 2006-2007 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 24
+dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -166,6 +166,21 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
esac
])
+# Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST],
+[
+ AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
+ case "$gl_cv_func_printf_flag_leftadjust" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1,
+ [Define if the vasnprintf implementation needs special code for the
+ '-' flag.])
+ ;;
+ esac
+])
+
# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag.
AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
[
@@ -234,6 +249,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
gl_PREREQ_VASNPRINTF_DIRECTIVE_A
gl_PREREQ_VASNPRINTF_DIRECTIVE_F
gl_PREREQ_VASNPRINTF_FLAG_GROUPING
+ gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
gl_PREREQ_VASNPRINTF_FLAG_ZERO
gl_PREREQ_VASNPRINTF_PRECISION
gl_PREREQ_VASNPRINTF_ENOMEM
--
1.5.4.1.35.g55477
16 years, 10 months
[Libvir] [PATCH] Enable another syntax-check rule.
by Jim Meyering
This one makes sure we don't use the "#ifdef HAVE_CONFIG_H" meme:
Enable another syntax-check rule.
* Makefile.cfg (local-checks-to-skip): Remove sc_no_have_config_h.
* qemud/mdns.c: Remove "#ifdef HAVE_CONFIG_H".
* Makefile.maint (sc_no_have_config_h): Tighten up regexp,
so that the above mention of "HAVE_CONFIG_H" doesn't match.
* .x-sc_no_have_config_h: New file, to exempt gnulib/ straggler.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
.x-sc_no_have_config_h | 1 +
Makefile.cfg | 1 -
Makefile.maint | 2 +-
qemud/mdns.c | 2 --
4 files changed, 2 insertions(+), 4 deletions(-)
create mode 100644 .x-sc_no_have_config_h
diff --git a/.x-sc_no_have_config_h b/.x-sc_no_have_config_h
new file mode 100644
index 0000000..f106267
--- /dev/null
+++ b/.x-sc_no_have_config_h
@@ -0,0 +1 @@
+^gnulib/lib/strsep\.c$
diff --git a/Makefile.cfg b/Makefile.cfg
index 4543ebd..7e8ddcf 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -28,7 +28,6 @@ url_dir_list = \
local-checks-to-skip = \
makefile_path_separator_check \
makefile-check \
- sc_no_have_config_h \
sc_tight_scope \
sc_GPL_version \
sc_always_defined_macros \
diff --git a/Makefile.maint b/Makefile.maint
index 8624328..4b54baf 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -96,7 +96,7 @@ sc_file_system:
exit 1; } || :
sc_no_have_config_h:
- @grep -n 'HAVE''_CONFIG_H' $$($(CVS_LIST_EXCEPT)) && \
+ @grep -n '^# *if.*HAVE''_CONFIG_H' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found use of HAVE''_CONFIG_H; remove' \
1>&2; exit 1; } || :
diff --git a/qemud/mdns.c b/qemud/mdns.c
index deebd07..d47d18e 100644
--- a/qemud/mdns.c
+++ b/qemud/mdns.c
@@ -22,9 +22,7 @@
* Author: Daniel P. Berrange <berrange(a)redhat.com>
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include <time.h>
#include <stdio.h>
--
1.5.4.35.g3cfc
16 years, 10 months
[Libvir] New XML attributes for virtio
by Soren Hansen
Hi!
I filed https://bugzilla.redhat.com/show_bug.cgi?id=431063 yesterday to
track this issue.
Quoting the bug report:
"To use the new virtio capabilites available in kvm 60, special command
line paramaters need to be passed to kvm. There should be a way to
specify that a device should use virtio in the libvirt xml.
I propose adding a "model" attribute to the interface element in the XML
to be able to specify the type of NIC to emulate, e.g. 'virtio'.
For the disk virtio I propose adding an 'interface' attribute to target
element (inside the disk element). This interface could then be set to
'virtio', 'ide', 'scsi', etc.."
Since I wrote the bug report, I noticed there's no way to specify which
graphics card, you'd like to emulate. A 'model' attribute could probably
be added to the graphics element as well.
Comments?
--
Soren Hansen
Ubuntu Server Team
http://www.ubuntu.com/
16 years, 10 months
[Libvir] dumpxml define not idempotent due to <bootlader/> tag
by Guido Guenther
Hi,
when using "virsh dumpxml <domain> > xmlfile" on a running paravirt xen
domain that has no bootloader entry whatsoever I get:
...
<bootloader/>
<os>
<type>linux</type>
<kernel>/boot/vmlinuz-vm</kernel>
<initrd>/boot/initrd.img-vm</initrd>
<cmdline>root=/dev/sda1 ro </cmdline>
</os>
...
reimporting this via "virsh define xmlfile" and then dumping again gives
something like:
...
<bootloader/>
<os>
<type>linux</type>
</os>
...
since a bootloader tag is found the kernel and initrd entries are being
dropped. My hack is to ignore empty bootloader statements for the
moment:
diff --git a/src/xend_internal.c b/src/xend_internal.c
index fd38a61..5428cd7 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -1438,9 +1438,6 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root,
if (tmp != NULL) {
bootloader = 1;
virBufferVSprintf(&buf, " <bootloader>%s</bootloader>\n", tmp);
- } else if (sexpr_has(root, "domain/bootloader")) {
- bootloader = 1;
- virBufferVSprintf(&buf, " <bootloader/>\n");
}
tmp = sexpr_node(root, "domain/bootloader_args");
if (tmp != NULL && bootloader) {
Would that be the right place to fix this?
Cheers,
-- Guido
16 years, 10 months