Devel
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
May 2008
- 32 participants
- 114 discussions
The documentation on the new storage feature is either a little short,
or I totally missed it. Anyway, I am looking for some help on how to
use it. If anyone could maybe give me an example xml file that would
be incredibly helpful, because based on the format description I can't
exactly figure out what information I am supposed to put where (for
ISCSI).
Thanks!
--
$ ./Mark
4
17
24 May '08
I got fed up trying to figure out how to fix the coverage reports to merge
data from multiple runs correctly, so this patch rips out all our test
coverage support. In its place is a makefile rule which just calls out to
the lcov program. It requires lcov >= 1.6 since earlier versions were
too dumb to deal with .libs/ directories properly. This version has just
been submitted to Fedora updates repos.
Makefile.am | 26 +---
a/scripts/.cvsignore | 2
a/scripts/Makefile.am | 4
a/scripts/README | 3
a/scripts/coverage-report-entry.pl | 77 -------------
a/scripts/coverage-report.pl | 167 ----------------------------
a/scripts/coverage-report.xsl | 217 -------------------------------------
configure.in | 2
src/Makefile.am | 20 ---
9 files changed, 12 insertions(+), 506 deletions(-)
Dan.
diff -r ddd05d94cc2d Makefile.am
--- a/Makefile.am Thu May 22 17:13:05 2008 -0400
+++ b/Makefile.am Thu May 22 17:27:30 2008 -0400
@@ -1,7 +1,10 @@
## Process this file with automake to produce Makefile.in
+LCOV = lcov
+GENHTML = genhtml
+
SUBDIRS = gnulib/lib include src qemud proxy docs gnulib/tests \
- python tests po scripts
+ python tests po
ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4
@@ -28,24 +31,15 @@
@(if [ "$(pythondir)" != "" ] ; then cd python ; \
$(MAKE) MAKEFLAGS+=--silent tests ; fi)
-cov: cov-recursive cov-am
+cov: clean-cov
+ mkdir $(top_builddir)/coverage
+ $(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp -d $(top_srcdir)/src -d $(top_srcdir)/qemud -d $(top_srcdir)/tests
+ $(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp -o $(top_builddir)/coverage/libvirt.info *usr*
+ rm $(top_builddir)/coverage/libvirt.info.tmp
+ $(GENHTML) -s -t "libvirt" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libvirt.info
clean-cov:
rm -rf $(top_builddir)/coverage
- cd src && $(MAKE) $(AM_MAKEFLAGS) clean-cov
-
-cov-recursive:
- cd src && $(MAKE) $(AM_MAKEFLAGS) cov
-
-cov-am:
- rm -rf $(top_builddir)/coverage
- mkdir $(top_builddir)/coverage
- perl $(srcdir)/scripts/coverage-report.pl src/*.cov > $(top_builddir)/coverage/index.xml
- xsltproc $(srcdir)/scripts/coverage-report.xsl \
- $(top_builddir)/coverage/index.xml \
- > $(top_builddir)/coverage/index.html
- for i in $(top_builddir)/src/*.gcov ; do o=`echo $$i | sed -e 's,$(top_builddir)/src,coverage,'` ; \
- perl $(srcdir)/scripts/coverage-report-entry.pl $$i > $$o.html ; done
# disable this check
distuninstallcheck:
diff -r ddd05d94cc2d configure.in
--- a/configure.in Thu May 22 17:13:05 2008 -0400
+++ b/configure.in Thu May 22 17:27:30 2008 -0400
@@ -1001,7 +1001,7 @@
gnulib/lib/Makefile \
gnulib/tests/Makefile \
libvirt.pc libvirt.spec \
- po/Makefile.in scripts/Makefile \
+ po/Makefile.in \
include/libvirt/Makefile include/libvirt/libvirt.h \
python/Makefile python/tests/Makefile \
qemud/Makefile \
diff -r ddd05d94cc2d scripts/.cvsignore
--- a/scripts/.cvsignore Thu May 22 17:13:05 2008 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff -r ddd05d94cc2d scripts/Makefile.am
--- a/scripts/Makefile.am Thu May 22 17:13:05 2008 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-
-EXTRA_DIST = coverage-report.pl \
- coverage-report-entry.pl \
- coverage-report.xsl
diff -r ddd05d94cc2d scripts/README
--- a/scripts/README Thu May 22 17:13:05 2008 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-This directory provides a collection of tools used in the
-build / test process. They are not installed / used after
-deployment.
diff -r ddd05d94cc2d scripts/coverage-report-entry.pl
--- a/scripts/coverage-report-entry.pl Thu May 22 17:13:05 2008 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-#!/usr/bin/perl
-#
-# Copyright (C) 2006-2007 Daniel P. Berrange
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Daniel P. Berrange <berrange(a)redhat.com>
-#
-# coverage-report-entry.pl: convert gcov annotated source into HTML
-#
-# This script takes a gcov annotated source code files on STDIN
-# converts it to HTML, coloured according to coverage, and sends
-# it to STDOUT
-
-print <<EOF;
-<html>
-<head>
-<title>Coverage report for $ARGV[0]</title>
-<style type="text/css">
- span.perfect {
- background: rgb(0,255,0);
- }
- span.terrible {
- background: rgb(255,0,0);
- }
-</style>
-</head>
-<body>
-<h1>Coverage report for $ARGV[0]</h1>
-
-<pre>
-EOF
-
-
-while (<>) {
- s/&/&/g;
- s/</</g;
- s/>/>/g;
-
- if (/^\s*function (\S+) called (\d+) returned \d+% blocks executed \d+%/) {
- my $class = $2 > 0 ? "perfect" : "terrible";
- $_ = "<span class=\"$class\" id=\"" . $1 . "\">$_</span>";
- } elsif (/^\s*branch\s+\d+\s+taken\s+(\d+)%\s+.*$/) {
- my $class = $1 > 0 ? "perfect" : "terrible";
- $_ = "<span class=\"$class\">$_</span>";
- } elsif (/^\s*branch\s+\d+\s+never executed.*$/) {
- my $class = "terrible";
- $_ = "<span class=\"$class\">$_</span>";
- } elsif (/^\s*call\s+\d+\s+never executed.*$/) {
- my $class = "terrible";
- $_ = "<span class=\"$class\">$_</span>";
- } elsif (/^\s*call\s+\d+\s+returned\s+(\d+)%.*$/) {
- my $class = $1 > 0 ? "perfect" : "terrible";
- $_ = "<span class=\"$class\">$_</span>";
- }
-
-
- print;
-}
-
-print <<EOF;
-</pre>
-</body>
-</html>
-EOF
diff -r ddd05d94cc2d scripts/coverage-report.pl
--- a/scripts/coverage-report.pl Thu May 22 17:13:05 2008 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-#!/usr/bin/perl
-#
-# Copyright (C) 2006-2007 Daniel P. Berrange
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Daniel P. Berrange <berrange(a)redhat.com>
-#
-# coverage-report.pl: generate XML coverage summary report
-#
-# This script takes a listof gcov .cov files as args, and generates
-# an XML document summarizing the coverage per function and per
-# source file.
-
-use warnings;
-use strict;
-
-my %coverage = ( function => {}, file => {} );
-
-my @functionBlackList = (
- "__memcpy",
- "__memmove",
- "__memset",
- "__strcat",
- "__strcpy",
- "__strncpy",
- "__strsep",
- "__strtok"
- );
-
-my %filemap;
-
-my $type;
-my $name;
-
-my @functions;
-
-while (<>) {
- if (/^Function '(.*)'\s*$/) {
- $type = "function";
- $name = $1;
- $coverage{$type}->{$name} = {};
- push @functions, $name;
- } elsif (/^File '(.*?)'\s*$/) {
- $type = "file";
- $name = $1;
- $coverage{$type}->{$name} = {};
-
- foreach my $func (@functions) {
- $coverage{"function"}->{$func}->{file} = $name;
- }
- @functions = ();
- } elsif (/^Lines executed:(.*)%\s*of\s*(\d+)\s*$/) {
- $coverage{$type}->{$name}->{lines} = $2;
- $coverage{$type}->{$name}->{linesCoverage} = $1;
- } elsif (/^No executable lines\s*$/) {
- $coverage{$type}->{$name}->{lines} = 0;
- $coverage{$type}->{$name}->{linesCoverage} = "100.00";
- } elsif (/^Branches executed:(.*)%\s*of\s*(\d+)\s*$/) {
- $coverage{$type}->{$name}->{branches} = $2;
- $coverage{$type}->{$name}->{branchesCoverage} = $1;
- } elsif (/^Taken at least once:(.*)%\s*of\s*(\d+)\s*$/) {
- $coverage{$type}->{$name}->{conds} = $2;
- $coverage{$type}->{$name}->{condsCoverage} = $1;
- } elsif (/^Calls executed:(.*)%\s*of\s*(\d+)\s*$/) {
- $coverage{$type}->{$name}->{calls} = $2;
- $coverage{$type}->{$name}->{callsCoverage} = $1;
- } elsif (/^No branches$/) {
- $coverage{$type}->{$name}->{branches} = 0;
- $coverage{$type}->{$name}->{branchesCoverage} = "100.00";
- $coverage{$type}->{$name}->{conds} = 0;
- $coverage{$type}->{$name}->{condsCoverage} = "100.00";
- } elsif (/^No calls$/) {
- $coverage{$type}->{$name}->{calls} = 0;
- $coverage{$type}->{$name}->{callsCoverage} = "100.00";
- } elsif (/^\s*(.*):creating '(.*)'\s*$/) {
- $filemap{$1} = $2;
- } elsif (/^\s*$/) {
- # nada
- } else {
- warn "unexpected input [$_]\n";
- }
-}
-
-my %summary;
-foreach my $type ("function", "file") {
- $summary{$type} = {};
- foreach my $m ("lines", "branches", "conds", "calls") {
- my $totalGot = 0;
- my $totalMiss = 0;
- my $count = 0;
- foreach my $func (keys %{$coverage{function}}) {
- my $blacklisted = 0;
- foreach my $blackName (@functionBlackList) {
- $blacklisted = 1 if $func =~ /^$blackName/;
- }
- next if $blacklisted;
-
- $count++;
- my $got = $coverage{function}->{$func}->{$m};
- $totalGot += $got;
- my $miss = $got * $coverage{function}->{$func}->{$m ."Coverage"} / 100;
- $totalMiss += $miss;
- }
- $summary{$type}->{$m} = sprintf("%d", $totalGot);
- if ($totalGot == 0) {
- $summary{$type}->{$m . "Coverage"} = "100.00";
- } else {
- $summary{$type}->{$m . "Coverage"} = sprintf("%.2f", $totalMiss / $totalGot * 100);
- }
- }
-}
-
-
-
-print "<coverage>\n";
-
-foreach my $type ("function", "file") {
- printf "<%ss>\n", $type;
- foreach my $name (sort { $a cmp $b } keys %{$coverage{$type}}) {
- if ($type eq "file") {
- next if $name =~ m,^/usr,;
- } else {
- my $blacklisted = 0;
- foreach my $blackName (@functionBlackList) {
- $blacklisted = 1 if $name =~ /^$blackName/;
- }
- next if $blacklisted;
- }
-
- my $rec = $coverage{$type}->{$name};
- printf " <entry name=\"%s\" details=\"%s\">\n", $name, ($type eq "file" ? $filemap{$name} : $filemap{$rec->{file}});
- printf " <lines count=\"%s\" coverage=\"%s\"/>\n", $rec->{lines}, $rec->{linesCoverage};
- if (exists $rec->{branches}) {
- printf " <branches count=\"%s\" coverage=\"%s\"/>\n", $rec->{branches}, $rec->{branchesCoverage};
- }
- if (exists $rec->{conds}) {
- printf " <conditions count=\"%s\" coverage=\"%s\"/>\n", $rec->{conds}, $rec->{condsCoverage};
- }
- if (exists $rec->{calls}) {
- printf " <calls count=\"%s\" coverage=\"%s\"/>\n", $rec->{calls}, $rec->{callsCoverage};
- }
- print " </entry>\n";
- }
-
- printf " <summary>\n";
- printf " <lines count=\"%s\" coverage=\"%s\"/>\n", $summary{$type}->{lines}, $summary{$type}->{linesCoverage};
- printf " <branches count=\"%s\" coverage=\"%s\"/>\n", $summary{$type}->{branches}, $summary{$type}->{branchesCoverage};
- printf " <conditions count=\"%s\" coverage=\"%s\"/>\n", $summary{$type}->{conds}, $summary{$type}->{condsCoverage};
- printf " <calls count=\"%s\" coverage=\"%s\"/>\n", $summary{$type}->{calls}, $summary{$type}->{callsCoverage};
- printf " </summary>\n";
- printf "</%ss>\n", $type;
-}
-
-print "</coverage>\n";
diff -r ddd05d94cc2d scripts/coverage-report.xsl
--- a/scripts/coverage-report.xsl Thu May 22 17:13:05 2008 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
- <xsl:output method="html"/>
-
- <xsl:template match="coverage">
- <html>
- <head>
- <title>Coverage report</title>
- <style type="text/css">
- tbody tr.odd td.label {
- border-top: 1px solid rgb(128,128,128);
- border-bottom: 1px solid rgb(128,128,128);
- }
- tbody tr.odd td.label {
- background: rgb(200,200,200);
- }
-
- thead, tfoot {
- background: rgb(60,60,60);
- color: white;
- font-weight: bold;
- }
-
- tr td.perfect {
- background: rgb(0,255,0);
- color: black;
- }
- tr td.excellant {
- background: rgb(140,255,140);
- color: black;
- }
- tr td.good {
- background: rgb(160,255,0);
- color: black;
- }
- tr td.poor {
- background: rgb(255,160,0);
- color: black;
- }
- tr td.bad {
- background: rgb(255,140,140);
- color: black;
- }
- tr td.terrible {
- background: rgb(255,0,0);
- color: black;
- }
- </style>
- </head>
- <body>
- <h1>Coverage report</h1>
- <xsl:apply-templates/>
- </body>
- </html>
- </xsl:template>
-
- <xsl:template match="functions">
- <h2>Function coverage</h2>
- <xsl:call-template name="content">
- <xsl:with-param name="type" select="'function'"/>
- </xsl:call-template>
- </xsl:template>
-
-
- <xsl:template match="files">
- <h2>File coverage</h2>
- <xsl:call-template name="content">
- <xsl:with-param name="type" select="'file'"/>
- </xsl:call-template>
- </xsl:template>
-
- <xsl:template name="content">
- <xsl:param name="type"/>
- <table>
- <thead>
- <tr>
- <th>Name</th>
- <th>Lines</th>
- <th>Branches</th>
- <th>Conditions</th>
- <th>Calls</th>
- </tr>
- </thead>
- <tbody>
- <xsl:for-each select="entry">
- <xsl:call-template name="entry">
- <xsl:with-param name="type" select="$type"/>
- <xsl:with-param name="class">
- <xsl:choose>
- <xsl:when test="position() mod 2">
- <xsl:text>odd</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>even</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:for-each>
- </tbody>
- <tfoot>
- <xsl:for-each select="summary">
- <xsl:call-template name="entry">
- <xsl:with-param name="type" select="'summary'"/>
- <xsl:with-param name="class">
- <xsl:choose>
- <xsl:when test="position() mod 2">
- <xsl:text>odd</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>even</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:for-each>
- </tfoot>
- </table>
- </xsl:template>
-
- <xsl:template name="entry">
- <xsl:param name="type"/>
- <xsl:param name="class"/>
- <tr class="{$class}">
- <xsl:choose>
- <xsl:when test="$type = 'function'">
- <td class="label"><a href="{@details}.html#{@name}"><xsl:value-of select="@name"/></a></td>
- </xsl:when>
- <xsl:when test="$type = 'file'">
- <td class="label"><a href="{(a)details}.html"><xsl:value-of select="@name"/></a></td>
- </xsl:when>
- <xsl:otherwise>
- <td class="label">Summary</td>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:if test="count(lines)">
- <xsl:apply-templates select="lines"/>
- </xsl:if>
- <xsl:if test="not(count(lines))">
- <xsl:call-template name="missing"/>
- </xsl:if>
-
- <xsl:if test="count(branches)">
- <xsl:apply-templates select="branches"/>
- </xsl:if>
- <xsl:if test="not(count(branches))">
- <xsl:call-template name="missing"/>
- </xsl:if>
-
- <xsl:if test="count(conditions)">
- <xsl:apply-templates select="conditions"/>
- </xsl:if>
- <xsl:if test="not(count(conditions))">
- <xsl:call-template name="missing"/>
- </xsl:if>
-
- <xsl:if test="count(calls)">
- <xsl:apply-templates select="calls"/>
- </xsl:if>
- <xsl:if test="not(count(calls))">
- <xsl:call-template name="missing"/>
- </xsl:if>
-
- </tr>
- </xsl:template>
-
- <xsl:template match="lines">
- <xsl:call-template name="row"/>
- </xsl:template>
-
- <xsl:template match="branches">
- <xsl:call-template name="row"/>
- </xsl:template>
-
- <xsl:template match="conditions">
- <xsl:call-template name="row"/>
- </xsl:template>
-
- <xsl:template match="calls">
- <xsl:call-template name="row"/>
- </xsl:template>
-
- <xsl:template name="missing">
- <td></td>
- </xsl:template>
-
- <xsl:template name="row">
- <xsl:variable name="quality">
- <xsl:choose>
- <xsl:when test="@coverage = 100">
- <xsl:text>perfect</xsl:text>
- </xsl:when>
- <xsl:when test="@coverage >= 80.0">
- <xsl:text>excellant</xsl:text>
- </xsl:when>
- <xsl:when test="@coverage >= 60.0">
- <xsl:text>good</xsl:text>
- </xsl:when>
- <xsl:when test="@coverage >= 40.0">
- <xsl:text>poor</xsl:text>
- </xsl:when>
- <xsl:when test="@coverage >= 20.0">
- <xsl:text>bad</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>terrible</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <td class="{$quality}"><xsl:value-of select="@coverage"/>% of <xsl:value-of select="@count"/></td>
- </xsl:template>
-
-</xsl:stylesheet>
diff -r ddd05d94cc2d src/Makefile.am
--- a/src/Makefile.am Thu May 22 17:13:05 2008 -0400
+++ b/src/Makefile.am Thu May 22 17:27:30 2008 -0400
@@ -149,22 +149,4 @@
EXTRA_DIST += parthelper.c
endif
-cov: clean-cov
- for i in $(CLIENT_SOURCES); do \
- case $$i in *.c) ;; *) continue;; esac; \
- b=$$(basename $$i .c); \
- o_files=; \
- for i in '' _test; do \
- g="$(LV_LIBTOOL_OBJDIR)/libvirt$${i}_la-$$b.gcda"; \
- o="$(LV_LIBTOOL_OBJDIR)/libvirt$${i}_la-$$b.o"; \
- test -f "$$o" -a -f "$$g" \
- && o_files="$$o_files $$o"; \
- done; \
- test -n "$$o_files" \
- && gcov -o $(LV_LIBTOOL_OBJDIR) -b -f $$o_files > $$b.cov; \
- done
-
-clean-cov:
- rm -f *.cov *.gcov
-
-CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
+CLEANFILES = *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
--
|: Red Hat, Engineering, Boston -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 :|
2
1
[libvirt] How to solve the runtime error: "libvir: Remote error : unknown procedure: 72"?
by Amudhan Gunasekaran 24 May '08
by Amudhan Gunasekaran 24 May '08
24 May '08
Hi,
I am getting the above said runtime error (libvir: Remote error : unknown procedure: 72) when I ran a program using the api virConnectListStoragePools. I googled but I could not get any solution. Please help me solve the issue.
Thanks and Regards,
Amudhan.
3
2
Hi,
I am just trying to use libvirt storage api from python terminal, and i am
getting the following error.
>>> import libvirt
>>> con = libvirt.open(<my uri using ssh>)
>>> con.numOfDefinedStoragePools()
libvir: Remote error : Broken pipe
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/libvirt.py", line 1022, in
numOfDefinedStoragePools
ret = libvirtmod.virConnectNumOfDefinedStoragePools(self._o)
AttributeError: 'module' object has no attribute
'virConnectNumOfDefinedStoragePools'
>>>
I have checked in the libvirt.c file and the function
"virConnectNumOfDefinedStoragePools(virConnectPtr conn)" is implemented.
Thanks,
3
2
23 May '08
There's a warning about type-punning in CVS libvirt.
We normally rewrite the code generated by glibc rpcgen to avoid these
warnings, but because the variable in question has a name containing
an uppercase letter, and because the regexp we're using is
case-sensitive and only matches lowercase identifiers, the rewrite
wasn't happening.
Attached patch fixes this.
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
3
2
I found a couple more small bugs in the qparams code
- In the qparam_query_parse() method, after appending each (name,value)
pair of params, it failed to free the temporary buffers for the
(name,value) pair.
- Did not allow for ';' as a valid query parameter separator
- In a couple of OOM cleanup scenarios it failed to free buffers allocated
earlier on
In looking at this I decide we ought to have a test suite for this code
so I'm also including one. It has 100% coverage of all the non-OOM code
paths. The test case now passes when run under valgrind
[berrange@t60wlan libvirt-numa]$ diffstat .hg/patches/qparam-test
b/tests/qparamtest.c | 224 +++++++++++++++++++++++++++++++++++++++++++++
scripts/coverage-report.pl | 3
src/qparams.c | 26 ++++-
tests/Makefile.am | 8 +
4 files changed, 253 insertions(+), 8 deletions(-)
Dan.
diff -r aa244ae10e9e scripts/coverage-report.pl
--- a/scripts/coverage-report.pl Wed May 21 19:13:06 2008 -0400
+++ b/scripts/coverage-report.pl Wed May 21 19:42:55 2008 -0400
@@ -65,6 +65,9 @@
} elsif (/^Lines executed:(.*)%\s*of\s*(\d+)\s*$/) {
$coverage{$type}->{$name}->{lines} = $2;
$coverage{$type}->{$name}->{linesCoverage} = $1;
+ } elsif (/^No executable lines\s*$/) {
+ $coverage{$type}->{$name}->{lines} = 0;
+ $coverage{$type}->{$name}->{linesCoverage} = "100.00";
} elsif (/^Branches executed:(.*)%\s*of\s*(\d+)\s*$/) {
$coverage{$type}->{$name}->{branches} = $2;
$coverage{$type}->{$name}->{branchesCoverage} = $1;
diff -r aa244ae10e9e src/qparams.c
--- a/src/qparams.c Wed May 21 19:13:06 2008 -0400
+++ b/src/qparams.c Wed May 21 19:42:55 2008 -0400
@@ -166,7 +166,7 @@
qparam_query_parse (const char *query)
{
struct qparam_set *ps;
- const char *name, *value, *end, *eq;
+ const char *end, *eq;
ps = new_qparam_set (0, NULL);
if (!ps) return NULL;
@@ -174,9 +174,14 @@
if (!query || query[0] == '\0') return ps;
while (*query) {
+ char *name = NULL, *value = NULL;
+
/* Find the next separator, or end of the string. */
end = strchr (query, '&');
- if (!end) end = query + strlen (query);
+ if (!end)
+ end = strchr (query, ';');
+ if (!end)
+ end = query + strlen (query);
/* Find the first '=' character between here and end. */
eq = strchr (query, '=');
@@ -191,7 +196,6 @@
*/
else if (!eq) {
name = xmlURIUnescapeString (query, end - query, NULL);
- value = "";
if (!name) goto out_of_memory;
}
/* Or if we have "name=" here (works around annoying
@@ -199,7 +203,6 @@
*/
else if (eq+1 == end) {
name = xmlURIUnescapeString (query, eq - query, NULL);
- value = "";
if (!name) goto out_of_memory;
}
/* If the '=' character is at the beginning then we have
@@ -211,12 +214,23 @@
/* Otherwise it's "name=value". */
else {
name = xmlURIUnescapeString (query, eq - query, NULL);
+ if (!name)
+ goto out_of_memory;
value = xmlURIUnescapeString (eq+1, end - (eq+1), NULL);
- if (!name || !value) goto out_of_memory;
+ if (!value) {
+ VIR_FREE(name);
+ goto out_of_memory;
+ }
}
/* Append to the parameter set. */
- if (append_qparam (ps, name, value) == -1) goto out_of_memory;
+ if (append_qparam (ps, name, value ? value : "") == -1) {
+ VIR_FREE(name);
+ VIR_FREE(value);
+ goto out_of_memory;
+ }
+ VIR_FREE(name);
+ VIR_FREE(value);
next:
query = end;
diff -r aa244ae10e9e tests/Makefile.am
--- a/tests/Makefile.am Wed May 21 19:13:06 2008 -0400
+++ b/tests/Makefile.am Wed May 21 19:42:55 2008 -0400
@@ -41,7 +41,7 @@
noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \
reconnect xmconfigtest xencapstest qemuxml2argvtest qemuxml2xmltest \
- nodeinfotest statstest
+ nodeinfotest statstest qparamtest
test_scripts = \
daemon-conf \
@@ -53,7 +53,7 @@
TESTS = xml2sexprtest sexpr2xmltest virshtest test_conf.sh xmconfigtest \
xencapstest qemuxml2argvtest qemuxml2xmltest nodeinfotest \
- statstest $(test_scripts)
+ statstest qparamtest $(test_scripts)
if ENABLE_XEN_TESTS
TESTS += reconnect
endif
@@ -130,6 +130,10 @@
statstest.c testutils.h testutils.c
statstest_LDADD = $(LDADDS)
+qparamtest_SOURCES = \
+ qparamtest.c testutils.h testutils.c
+qparamtest_LDADD = $(LDADDS)
+
reconnect_SOURCES = \
reconnect.c
reconnect_LDADD = $(LDADDS)
diff -r aa244ae10e9e tests/qparamtest.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/qparamtest.c Wed May 21 19:42:55 2008 -0400
@@ -0,0 +1,224 @@
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "testutils.h"
+#include "qparams.h"
+#include "util.h"
+
+struct qparamParseDataEntry {
+ const char *name;
+ const char *value;
+};
+
+struct qparamParseData {
+ const char *queryIn;
+ const char *queryOut;
+ int nparams;
+ const struct qparamParseDataEntry *params;
+};
+
+static int
+qparamParseTest(const void *data)
+{
+ const struct qparamParseData *expect = data;
+ struct qparam_set *actual = qparam_query_parse(expect->queryIn);
+ int ret = -1, i;
+ if (!actual)
+ return -1;
+
+ if (actual->n != expect->nparams)
+ goto fail;
+
+ for (i = 0 ; i < actual->n ; i++) {
+ if (!STREQ(expect->params[i].name,
+ actual->p[i].name))
+ goto fail;
+ if (!STREQ(expect->params[i].value,
+ actual->p[i].value))
+ goto fail;
+ }
+
+ ret = 0;
+
+fail:
+ free_qparam_set(actual);
+ return ret;
+}
+
+static int
+qparamFormatTest(const void *data)
+{
+ const struct qparamParseData *expect = data;
+ struct qparam_set *actual = qparam_query_parse(expect->queryIn);
+ char *output = NULL;
+ int ret = -1;
+
+ if (!actual)
+ return -1;
+
+ output = qparam_get_query(actual);
+ if (!output)
+ goto fail;
+
+ if (!STREQ(output, expect->queryOut))
+ goto fail;
+
+ ret = 0;
+
+fail:
+ free(output);
+ free_qparam_set(actual);
+ return ret;
+}
+
+static int
+qparamBuildTest(const void *data)
+{
+ const struct qparamParseData *expect = data;
+ struct qparam_set *actual = new_qparam_set(0, NULL);
+ int ret = -1, i;
+ if (!actual)
+ return -1;
+
+ for (i = 0 ; i < expect->nparams ; i++) {
+ if (append_qparam(actual,
+ expect->params[i].name,
+ expect->params[i].value) < 0)
+ goto fail;
+ }
+
+ if (actual->n != expect->nparams)
+ goto fail;
+
+ for (i = 0 ; i < actual->n ; i++) {
+ if (!STREQ(expect->params[i].name,
+ actual->p[i].name))
+ goto fail;
+ if (!STREQ(expect->params[i].value,
+ actual->p[i].value))
+ goto fail;
+ }
+
+ ret = 0;
+
+fail:
+ free_qparam_set(actual);
+ return ret;
+}
+
+
+static int
+qparamTestNewVargs(const void *data ATTRIBUTE_UNUSED)
+{
+ struct qparam_set *actual = new_qparam_set(0, "foo", "one", "bar", "two", NULL);
+ int ret = -1;
+ if (!actual)
+ return -1;
+
+ if (actual->n != 2)
+ goto fail;
+
+ if (!STREQ(actual->p[0].name, "foo"))
+ goto fail;
+
+ if (!STREQ(actual->p[0].value, "one"))
+ goto fail;
+
+ if (!STREQ(actual->p[1].name, "bar"))
+ goto fail;
+
+ if (!STREQ(actual->p[1].value, "two"))
+ goto fail;
+
+ ret = 0;
+
+fail:
+ free_qparam_set(actual);
+ return ret;
+}
+
+static int
+qparamTestAddVargs(const void *data ATTRIBUTE_UNUSED)
+{
+ struct qparam_set *actual = new_qparam_set(0, NULL);
+ int ret = -1;
+ if (!actual)
+ return -1;
+
+ if (append_qparams(actual, "foo", "one", "bar", "two", NULL) < 0)
+ goto fail;
+
+ if (actual->n != 2)
+ goto fail;
+
+ if (!STREQ(actual->p[0].name, "foo"))
+ goto fail;
+
+ if (!STREQ(actual->p[0].value, "one"))
+ goto fail;
+
+ if (!STREQ(actual->p[1].name, "bar"))
+ goto fail;
+
+ if (!STREQ(actual->p[1].value, "two"))
+ goto fail;
+
+ ret = 0;
+
+fail:
+ free_qparam_set(actual);
+ return ret;
+}
+
+static const struct qparamParseDataEntry params1[] = { { "foo", "one" }, { "bar", "two" } };
+static const struct qparamParseDataEntry params2[] = { { "foo", "one" }, { "foo", "two" } };
+static const struct qparamParseDataEntry params3[] = { { "foo", "&one" }, { "bar", "&two" } };
+static const struct qparamParseDataEntry params4[] = { { "foo", "" } };
+static const struct qparamParseDataEntry params5[] = { { "foo", "one two" } };
+static const struct qparamParseDataEntry params6[] = { { "foo", "one" } };
+
+int
+main(void)
+{
+ int ret = 0;
+
+#define DO_TEST(queryIn,queryOut,params) \
+ do { \
+ struct qparamParseData info = { \
+ queryIn, \
+ queryOut ? queryOut : queryIn, \
+ sizeof(params)/sizeof(params[0]), \
+ params }; \
+ if (virtTestRun("Parse " queryIn, \
+ 1, qparamParseTest, &info) < 0) \
+ ret = -1; \
+ if (virtTestRun("Format " queryIn, \
+ 1, qparamFormatTest, &info) < 0) \
+ ret = -1; \
+ if (virtTestRun("Build " queryIn, \
+ 1, qparamBuildTest, &info) < 0) \
+ ret = -1; \
+ } while (0)
+
+
+ DO_TEST("foo=one&bar=two", NULL, params1);
+ DO_TEST("foo=one&foo=two", NULL, params2);
+ DO_TEST("foo=one&&foo=two", "foo=one&foo=two", params2);
+ DO_TEST("foo=one;foo=two", "foo=one&foo=two", params2);
+ DO_TEST("foo", "foo=", params4);
+ DO_TEST("foo=", NULL, params4);
+ DO_TEST("foo=&", "foo=", params4);
+ DO_TEST("foo=&&", "foo=", params4);
+ DO_TEST("foo=one%20two", NULL, params5);
+ DO_TEST("=bogus&foo=one", "foo=one", params6);
+
+ if (virtTestRun("New vargs", 1, qparamTestNewVargs, NULL) < 0)
+ ret = -1;
+ if (virtTestRun("Add vargs", 1, qparamTestAddVargs, NULL) < 0)
+ ret = -1;
+
+ exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
+}
--
|: Red Hat, Engineering, Boston -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 :|
4
5
Daniel pointed out that the way we build up the QEMU argv strnig is becoming
rather unscalable / error prone. This patch refactors it into to use a short
macro to do memory allocation/reallocation, which clears it up quite nicely
qemu_conf.c | 293 +++++++++++++++++++++++-------------------------------------
1 file changed, 116 insertions(+), 177 deletions(-)
Regards,
Daniel
diff -r 7c1231eebae9 src/qemu_conf.c
--- a/src/qemu_conf.c Thu May 22 12:31:13 2008 -0400
+++ b/src/qemu_conf.c Thu May 22 12:31:46 2008 -0400
@@ -2411,8 +2419,8 @@
int qemudBuildCommandLine(virConnectPtr conn,
struct qemud_driver *driver,
struct qemud_vm *vm,
- char ***argv) {
- int len, n = -1, i;
+ char ***retargv) {
+ int i;
char memory[50];
char vcpus[50];
char boot[QEMUD_MAX_BOOT_DEVS+1];
@@ -2424,6 +2432,8 @@
struct qemud_vm_chr_def *parallel = vm->def->parallels;
struct utsname ut;
int disableKQEMU = 0;
+ int qargc = 0, qarga = 0;
+ char **qargv = NULL;
if (vm->qemuVersion == 0) {
if (qemudExtractVersionInfo(vm->def->os.binary,
@@ -2451,65 +2461,46 @@
vm->def->virtType == QEMUD_VIRT_QEMU)
disableKQEMU = 1;
- len = 1 + /* qemu */
- 1 + /* Stopped */
- 2 + /* machine type */
- disableKQEMU + /* Disable kqemu */
- (vm->qemuCmdFlags & QEMUD_CMD_FLAG_NAME ? 2 : 0) + /* -name XXX */
- 2 * vm->def->ndisks + /* disks*/
- (vm->def->nnets > 0 ? (4 * vm->def->nnets) : 2) + /* networks */
- 1 + /* usb */
- 2 * vm->def->ninputs + /* input devices */
- ((vm->def->nsounds > 0) ? 2 : 0) + /* sound */
- (vm->def->nserials > 0 ? (2 * vm->def->nserials) : 2) + /* character devices */
- (vm->def->nparallels > 0 ? (2 * vm->def->nparallels) : 2) + /* character devices */
- 2 + /* memory*/
- 2 + /* cpus */
- 2 + /* boot device */
- 2 + /* monitor */
- (vm->def->localtime ? 1 : 0) + /* localtime */
- (vm->qemuCmdFlags & QEMUD_CMD_FLAG_NO_REBOOT &&
- vm->def->noReboot ? 1 : 0) + /* no-reboot */
- (vm->def->features & QEMUD_FEATURE_ACPI ? 0 : 1) + /* acpi */
- (vm->def->os.kernel[0] ? 2 : 0) + /* kernel */
- (vm->def->os.initrd[0] ? 2 : 0) + /* initrd */
- (vm->def->os.cmdline[0] ? 2 : 0) + /* cmdline */
- (vm->def->os.bootloader[0] ? 2 : 0) + /* bootloader */
- (vm->def->graphicsType == QEMUD_GRAPHICS_VNC ? 2 :
- (vm->def->graphicsType == QEMUD_GRAPHICS_SDL ? 0 : 1)) + /* graphics */
- (vm->migrateFrom[0] ? 2 : 0); /* migrateFrom */
+#define ADD_ARG_SPACE \
+ do { \
+ if (qargc == qarga) { \
+ qarga += 10; \
+ if (VIR_REALLOC_N(qargv, qarga) < 0) \
+ goto no_memory; \
+ } \
+ } while (0)
+
+#define ADD_ARG(thisarg) \
+ do { \
+ ADD_ARG_SPACE; \
+ qargv[qargc++] = thisarg; \
+ } while (0)
+
+#define ADD_ARG_LIT(thisarg) \
+ do { \
+ ADD_ARG_SPACE; \
+ if ((qargv[qargc++] = strdup(thisarg)) == NULL) \
+ goto no_memory; \
+ } while (0)
snprintf(memory, sizeof(memory), "%lu", vm->def->memory/1024);
snprintf(vcpus, sizeof(vcpus), "%d", vm->def->vcpus);
- if (!(*argv = calloc(len+1, sizeof(**argv))))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vm->def->os.binary)))
- goto no_memory;
- if (!((*argv)[++n] = strdup("-S")))
- goto no_memory;
- if (!((*argv)[++n] = strdup("-M")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vm->def->os.machine)))
- goto no_memory;
- if (disableKQEMU) {
- if (!((*argv)[++n] = strdup("-no-kqemu")))
- goto no_memory;
- }
- if (!((*argv)[++n] = strdup("-m")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(memory)))
- goto no_memory;
- if (!((*argv)[++n] = strdup("-smp")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vcpus)))
- goto no_memory;
+
+ ADD_ARG_LIT(vm->def->os.binary);
+ ADD_ARG_LIT("-S");
+ ADD_ARG_LIT("-M");
+ ADD_ARG_LIT(vm->def->os.machine);
+ if (disableKQEMU)
+ ADD_ARG_LIT("-no-kqemu");
+ ADD_ARG_LIT("-m");
+ ADD_ARG_LIT(memory);
+ ADD_ARG_LIT("-smp");
+ ADD_ARG_LIT(vcpus);
if (vm->qemuCmdFlags & QEMUD_CMD_FLAG_NAME) {
- if (!((*argv)[++n] = strdup("-name")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vm->def->name)))
- goto no_memory;
+ ADD_ARG_LIT("-name");
+ ADD_ARG_LIT(vm->def->name);
}
/*
* NB, -nographic *MUST* come before any serial, or monitor
@@ -2518,31 +2509,21 @@
* if you ask for nographic. So we have to make sure we override
* these defaults ourselves...
*/
- if (vm->def->graphicsType == QEMUD_GRAPHICS_NONE) {
- if (!((*argv)[++n] = strdup("-nographic")))
- goto no_memory;
- }
-
- if (!((*argv)[++n] = strdup("-monitor")))
- goto no_memory;
- if (!((*argv)[++n] = strdup("pty")))
- goto no_memory;
-
- if (vm->def->localtime) {
- if (!((*argv)[++n] = strdup("-localtime")))
- goto no_memory;
- }
-
- if (vm->qemuCmdFlags & QEMUD_CMD_FLAG_NO_REBOOT &&
- vm->def->noReboot) {
- if (!((*argv)[++n] = strdup("-no-reboot")))
- goto no_memory;
- }
-
- if (!(vm->def->features & QEMUD_FEATURE_ACPI)) {
- if (!((*argv)[++n] = strdup("-no-acpi")))
- goto no_memory;
- }
+ if (vm->def->graphicsType == QEMUD_GRAPHICS_NONE)
+ ADD_ARG_LIT("-nographic");
+
+ ADD_ARG_LIT("-monitor");
+ ADD_ARG_LIT("pty");
+
+ if (vm->def->localtime)
+ ADD_ARG_LIT("-localtime");
+
+ if ((vm->qemuCmdFlags & QEMUD_CMD_FLAG_NO_REBOOT) &&
+ vm->def->noReboot)
+ ADD_ARG_LIT("-no-reboot");
+
+ if (!(vm->def->features & QEMUD_FEATURE_ACPI))
+ ADD_ARG_LIT("-no-acpi");
if (!vm->def->os.bootloader[0]) {
for (i = 0 ; i < vm->def->os.nBootDevs ; i++) {
@@ -2565,34 +2546,24 @@
}
}
boot[vm->def->os.nBootDevs] = '\0';
- if (!((*argv)[++n] = strdup("-boot")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(boot)))
- goto no_memory;
+ ADD_ARG_LIT("-boot");
+ ADD_ARG_LIT(boot);
if (vm->def->os.kernel[0]) {
- if (!((*argv)[++n] = strdup("-kernel")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vm->def->os.kernel)))
- goto no_memory;
+ ADD_ARG_LIT("-kernel");
+ ADD_ARG_LIT(vm->def->os.kernel);
}
if (vm->def->os.initrd[0]) {
- if (!((*argv)[++n] = strdup("-initrd")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vm->def->os.initrd)))
- goto no_memory;
+ ADD_ARG_LIT("-initrd");
+ ADD_ARG_LIT(vm->def->os.initrd);
}
if (vm->def->os.cmdline[0]) {
- if (!((*argv)[++n] = strdup("-append")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vm->def->os.cmdline)))
- goto no_memory;
- }
- } else {
- if (!((*argv)[++n] = strdup("-bootloader")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vm->def->os.bootloader)))
- goto no_memory;
+ ADD_ARG_LIT("-append");
+ ADD_ARG_LIT(vm->def->os.cmdline);
+ }
+ } else {
+ ADD_ARG_LIT("-bootloader");
+ ADD_ARG_LIT(vm->def->os.bootloader);
}
/* If QEMU supports -drive param instead of old -hda, -hdb, -cdrom .. */
@@ -2621,8 +2592,6 @@
const char *media = NULL;
int bootable = 0;
int idx = virDiskNameToIndex(disk->dst);
- if (!((*argv)[++n] = strdup("-drive")))
- goto no_memory;
if (idx < 0) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
@@ -2654,8 +2623,8 @@
idx,
bootable ? ",boot=on" : "");
- if (!((*argv)[++n] = strdup(opt)))
- goto no_memory;
+ ADD_ARG_LIT("-drive");
+ ADD_ARG_LIT(opt);
disk = disk->next;
}
} else {
@@ -2684,20 +2653,16 @@
snprintf(file, PATH_MAX, "%s", disk->src);
- if (!((*argv)[++n] = strdup(dev)))
- goto no_memory;
- if (!((*argv)[++n] = strdup(file)))
- goto no_memory;
+ ADD_ARG_LIT(dev);
+ ADD_ARG_LIT(file);
disk = disk->next;
}
}
if (!net) {
- if (!((*argv)[++n] = strdup("-net")))
- goto no_memory;
- if (!((*argv)[++n] = strdup("none")))
- goto no_memory;
+ ADD_ARG_LIT("-net");
+ ADD_ARG_LIT("none");
} else {
int vlan = 0;
while (net) {
@@ -2712,19 +2677,14 @@
(net->model[0] ? ",model=" : ""), net->model) >= sizeof(nic))
goto error;
- if (!((*argv)[++n] = strdup("-net")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(nic)))
- goto no_memory;
-
- if (!((*argv)[++n] = strdup("-net")))
- goto no_memory;
+ ADD_ARG_LIT("-net");
+ ADD_ARG_LIT(nic);
+ ADD_ARG_LIT("-net");
switch (net->type) {
case QEMUD_NET_NETWORK:
case QEMUD_NET_BRIDGE:
- if (!((*argv)[++n] = qemudNetworkIfaceConnect(conn, driver, vm, net, vlan)))
- goto error;
+ ADD_ARG(qemudNetworkIfaceConnect(conn, driver, vm, net, vlan));
break;
case QEMUD_NET_ETHERNET:
@@ -2736,8 +2696,7 @@
vlan) >= (PATH_MAX-1))
goto error;
- if (!((*argv)[++n] = strdup(arg)))
- goto no_memory;
+ ADD_ARG_LIT(arg);
}
break;
@@ -2765,8 +2724,7 @@
vlan) >= (PATH_MAX-1))
goto error;
- if (!((*argv)[++n] = strdup(arg)))
- goto no_memory;
+ ADD_ARG_LIT(arg);
}
break;
@@ -2777,8 +2735,7 @@
if (snprintf(arg, PATH_MAX-1, "user,vlan=%d", vlan) >= (PATH_MAX-1))
goto error;
- if (!((*argv)[++n] = strdup(arg)))
- goto no_memory;
+ ADD_ARG_LIT(arg);
}
}
@@ -2788,10 +2745,8 @@
}
if (!serial) {
- if (!((*argv)[++n] = strdup("-serial")))
- goto no_memory;
- if (!((*argv)[++n] = strdup("none")))
- goto no_memory;
+ ADD_ARG_LIT("-serial");
+ ADD_ARG_LIT("none");
} else {
while (serial) {
char buf[4096];
@@ -2799,20 +2754,16 @@
if (qemudBuildCommandLineChrDevStr(serial, buf, sizeof(buf)) < 0)
goto error;
- if (!((*argv)[++n] = strdup("-serial")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(buf)))
- goto no_memory;
+ ADD_ARG_LIT("-serial");
+ ADD_ARG_LIT(buf);
serial = serial->next;
}
}
if (!parallel) {
- if (!((*argv)[++n] = strdup("-parallel")))
- goto no_memory;
- if (!((*argv)[++n] = strdup("none")))
- goto no_memory;
+ ADD_ARG_LIT("-parallel");
+ ADD_ARG_LIT("none");
} else {
while (parallel) {
char buf[4096];
@@ -2820,23 +2771,18 @@
if (qemudBuildCommandLineChrDevStr(parallel, buf, sizeof(buf)) < 0)
goto error;
- if (!((*argv)[++n] = strdup("-parallel")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(buf)))
- goto no_memory;
+ ADD_ARG_LIT("-parallel");
+ ADD_ARG_LIT(buf);
parallel = parallel->next;
}
}
- if (!((*argv)[++n] = strdup("-usb")))
- goto no_memory;
+ ADD_ARG_LIT("-usb");
while (input) {
if (input->bus == QEMU_INPUT_BUS_USB) {
- if (!((*argv)[++n] = strdup("-usbdevice")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(input->type == QEMU_INPUT_TYPE_MOUSE ? "mouse" : "tablet")))
- goto no_memory;
+ ADD_ARG_LIT("-usbdevice");
+ ADD_ARG_LIT(input->type == QEMU_INPUT_TYPE_MOUSE ? "mouse" : "tablet");
}
input = input->next;
@@ -2870,15 +2816,11 @@
if (ret < 0 || ret >= (int)sizeof(vncdisplay))
goto error;
- if (!((*argv)[++n] = strdup("-vnc")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vncdisplay)))
- goto no_memory;
+ ADD_ARG_LIT("-vnc");
+ ADD_ARG_LIT(vncdisplay);
if (vm->def->keymap) {
- if (!((*argv)[++n] = strdup("-k")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vm->def->keymap)))
- goto no_memory;
+ ADD_ARG_LIT("-k");
+ ADD_ARG_LIT(vm->def->keymap);
}
} else if (vm->def->graphicsType == QEMUD_GRAPHICS_NONE) {
/* Nada - we added -nographic earlier in this function */
@@ -2892,12 +2834,11 @@
char *modstr = calloc(1, size+1);
if (!modstr)
goto no_memory;
- if (!((*argv)[++n] = strdup("-soundhw")))
- goto no_memory;
while(sound && size > 0) {
const char *model = qemudSoundModelToString(sound->model);
if (!model) {
+ free(modstr);
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"%s", _("invalid sound model"));
goto error;
@@ -2908,19 +2849,18 @@
if (sound)
strncat(modstr, ",", size--);
}
- if (!((*argv)[++n] = modstr))
- goto no_memory;
+ ADD_ARG_LIT("-soundhw");
+ ADD_ARG(modstr);
}
if (vm->migrateFrom[0]) {
- if (!((*argv)[++n] = strdup("-incoming")))
- goto no_memory;
- if (!((*argv)[++n] = strdup(vm->migrateFrom)))
- goto no_memory;
- }
-
- (*argv)[++n] = NULL;
-
+ ADD_ARG_LIT("-incoming");
+ ADD_ARG_LIT(vm->migrateFrom);
+ }
+
+ ADD_ARG(NULL);
+
+ *retargv = qargv;
return 0;
no_memory:
@@ -2934,11 +2874,10 @@
vm->tapfds = NULL;
vm->ntapfds = 0;
}
- if (argv) {
- for (i = 0 ; i < n ; i++)
- free((*argv)[i]);
- free(*argv);
- *argv = NULL;
+ if (qargv) {
+ for (i = 0 ; i < qargc ; i++)
+ free((qargv)[i]);
+ free(qargv);
}
return -1;
}
--
|: Red Hat, Engineering, Boston -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 :|
3
3
./configure --prefix=/usr --with-xen --without-sasl --without-avahi
--without-test --without-libvirtd --sysconfdir=/etc --localstatedir=/var
--without-qemu --without-storage-lvm --without-storage-iscsi
gcc -DUSE_READLINE -g -O2 -Wall -Wformat -Wformat-security
-Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow
-Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes
-Winline -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fasynchronous-unwind-tables -o .libs/virsh virsh-virsh.o
virsh-console.o virsh-util-lib.o -Wall -Wformat -Wformat-security
-Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow
-Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes
-Winline -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fasynchronous-unwind-tables ./.libs/libvirt.so
/usr/lib64/libxml2.so -ldl -lm /usr/lib64/libgnutls.so -L/usr/lib64
/usr/lib64/libtasn1.so -lz /usr/lib64/libgcrypt.so
/usr/lib64/libgpg-error.so ../gnulib/lib/.libs/libgnu.a -lreadline
-lxenstore
./.libs/libvirt.so: undefined reference to `storageRegister'
collect2: ld returned 1 exit status
make[2]: *** [virsh] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/libvirt_test_la-remote_internal.Tpo
.deps/libvirt_test_la-remote_internal.Plo
make[2]: Leaving directory `/home/skinkie/external/libvirt/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/skinkie/external/libvirt'
make: *** [all] Error 2
2
2
23 May '08
Would it be possible to enable fetch of the interface stats of the dom0
via the API?
Stefan
4
4
23 May '08
The XML format allows for an initial CPU mask to be specified for a guests
vCPUs. eg with this XML:
<vcpu cpuset='1-4,8-20,525'>1</vcpu>
Since we have CPU pinning support from my previous patch, adding in the
initial pinning is fairly easy. We first pass the '-S' arg to QEMU when
forking it. This causes it to initialize, but not start the CPUs in the
guest. We then set the affinity mask for all its CPUs, and then send
the 'cont' command to the monitor to start execution.
src/qemu_conf.c | 44 +++++++
src/qemu_conf.h | 3
src/qemu_driver.c | 77 +++++++++----
src/xml.c | 5
src/xml.h | 4
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args | 2
tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args | 2
tests/qemuxml2argvdata/qemuxml2argv-boot-network.args | 2
tests/qemuxml2argvdata/qemuxml2argv-bootloader.args | 2
tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args | 2
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args | 2
tests/qemuxml2argvdata/qemuxml2argv-console-compat.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-many.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args | 2
tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args | 2
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args | 2
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args | 2
tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args | 2
tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args | 2
tests/qemuxml2argvdata/qemuxml2argv-input-xen.args | 2
tests/qemuxml2argvdata/qemuxml2argv-minimal.args | 2
tests/qemuxml2argvdata/qemuxml2argv-minimal.xml | 2
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args | 2
tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args | 2
tests/qemuxml2argvdata/qemuxml2argv-net-user.args | 2
tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args | 2
tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-file.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-many.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args | 2
tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args | 2
tests/qemuxml2argvdata/qemuxml2argv-sound.args | 2
39 files changed, 140 insertions(+), 61 deletions(-)
Dan.
diff -r 3bbea433803f src/qemu_conf.c
--- a/src/qemu_conf.c Fri May 16 17:39:29 2008 -0400
+++ b/src/qemu_conf.c Fri May 16 17:40:39 2008 -0400
@@ -56,6 +56,7 @@
#include "memory.h"
#include "verify.h"
#include "c-ctype.h"
+#include "xml.h"
#define qemudLog(level, msg...) fprintf(stderr, msg)
@@ -1743,6 +1744,25 @@
}
xmlXPathFreeObject(obj);
+ /* Extract domain vcpu info */
+ obj = xmlXPathEval(BAD_CAST "string(/domain/vcpu[1]/@cpuset)", ctxt);
+ if ((obj == NULL) || (obj->type != XPATH_STRING) ||
+ (obj->stringval == NULL) || (obj->stringval[0] == 0)) {
+ /* Allow use on all CPUS */
+ memset(def->cpumask, 1, QEMUD_CPUMASK_LEN);
+ } else {
+ char *set = (char *)obj->stringval;
+ memset(def->cpumask, 0, QEMUD_CPUMASK_LEN);
+ if (virParseCpuSet(conn, (const char **)&set,
+ 0, def->cpumask,
+ QEMUD_CPUMASK_LEN) < 0) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("malformed vcpu mask information"));
+ goto error;
+ }
+ }
+ xmlXPathFreeObject(obj);
+
/* See if ACPI feature is requested */
obj = xmlXPathEval(BAD_CAST "/domain/features/acpi", ctxt);
if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
@@ -2431,6 +2451,7 @@
disableKQEMU = 1;
len = 1 + /* qemu */
+ 1 + /* Stopped */
2 + /* machine type */
disableKQEMU + /* Disable kqemu */
(vm->qemuCmdFlags & QEMUD_CMD_FLAG_NAME ? 2 : 0) + /* -name XXX */
@@ -2464,6 +2485,8 @@
goto no_memory;
if (!((*argv)[++n] = strdup(vm->def->os.binary)))
goto no_memory;
+ if (!((*argv)[++n] = strdup("-S")))
+ goto no_memory;
if (!((*argv)[++n] = strdup("-M")))
goto no_memory;
if (!((*argv)[++n] = strdup(vm->def->os.machine)))
@@ -3876,7 +3899,7 @@
const struct qemud_vm_sound_def *sound;
const struct qemud_vm_chr_def *chr;
const char *type = NULL;
- int n;
+ int n, allones = 1;
if (!(type = qemudVirtTypeToString(def->virtType))) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
@@ -3897,7 +3920,24 @@
virBufferVSprintf(&buf, " <memory>%lu</memory>\n", def->maxmem);
virBufferVSprintf(&buf, " <currentMemory>%lu</currentMemory>\n", def->memory);
- virBufferVSprintf(&buf, " <vcpu>%d</vcpu>\n", def->vcpus);
+
+ for (n = 0 ; n < QEMUD_CPUMASK_LEN ; n++)
+ if (def->cpumask[n] != 1)
+ allones = 0;
+
+ if (allones) {
+ virBufferVSprintf(&buf, " <vcpu>%d</vcpu>\n", def->vcpus);
+ } else {
+ char *cpumask = NULL;
+ if ((cpumask = virSaveCpuSet(conn, def->cpumask, QEMUD_CPUMASK_LEN)) == NULL) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY,
+ "%s", _("allocating cpu mask"));
+ goto cleanup;
+ }
+ virBufferVSprintf(&buf, " <vcpu cpuset='%s'>%d</vcpu>\n", cpumask, def->vcpus);
+ free(cpumask);
+ }
+
if (def->os.bootloader[0])
virBufferVSprintf(&buf, " <bootloader>%s</bootloader>\n", def->os.bootloader);
virBufferAddLit(&buf, " <os>\n");
diff -r 3bbea433803f src/qemu_conf.h
--- a/src/qemu_conf.h Fri May 16 17:39:29 2008 -0400
+++ b/src/qemu_conf.h Fri May 16 17:40:39 2008 -0400
@@ -33,6 +33,7 @@
#include "iptables.h"
#include "capabilities.h"
#include <netinet/in.h>
+#include <sched.h>
#define qemudDebug(fmt, ...) do {} while(0)
@@ -104,6 +105,7 @@
#define QEMUD_MAX_NAME_LEN 50
#define QEMUD_MAX_XML_LEN 4096
#define QEMUD_MAX_ERROR_LEN 1024
+#define QEMUD_CPUMASK_LEN CPU_SETSIZE
/* Stores the virtual network interface configuration */
struct qemud_vm_net_def {
@@ -282,6 +284,7 @@
unsigned long memory;
unsigned long maxmem;
int vcpus;
+ char cpumask[QEMUD_CPUMASK_LEN];
int noReboot;
diff -r 3bbea433803f src/qemu_driver.c
--- a/src/qemu_driver.c Fri May 16 17:39:29 2008 -0400
+++ b/src/qemu_driver.c Fri May 16 17:40:39 2008 -0400
@@ -713,6 +713,50 @@
return 0;
}
+static int
+qemudInitCpus(virConnectPtr conn,
+ struct qemud_driver *driver,
+ struct qemud_vm *vm) {
+ char *info = NULL;
+ cpu_set_t mask;
+ int i, maxcpu = QEMUD_CPUMASK_LEN;
+ virNodeInfo nodeinfo;
+
+ if (virNodeInfoPopulate(conn, &nodeinfo) < 0)
+ return -1;
+
+ /* setaffinity fails if you set bits for CPUs which
+ * aren't present, so we have to limit ourselves */
+ if (maxcpu > nodeinfo.cpus)
+ maxcpu = nodeinfo.cpus;
+
+ CPU_ZERO(&mask);
+ for (i = 0 ; i < maxcpu ; i++)
+ if (vm->def->cpumask[i])
+ CPU_SET(i, &mask);
+
+ for (i = 0 ; i < vm->nvcpupids ; i++) {
+ if (sched_setaffinity(vm->vcpupids[i],
+ sizeof(mask), &mask) < 0) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("failed to set CPU affinity %s"),
+ strerror(errno));
+ return -1;
+ }
+ }
+
+ /* Allow the CPUS to start executing */
+ if (qemudMonitorCommand(driver, vm, "cont", &info) < 0) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("resume operation failed"));
+ return -1;
+ }
+ free(info);
+
+ return 0;
+}
+
+
static int qemudNextFreeVNCPort(struct qemud_driver *driver ATTRIBUTE_UNUSED) {
int i;
@@ -870,28 +914,17 @@
}
if (ret == 0) {
- if (virEventAddHandle(vm->stdout,
- POLLIN | POLLERR | POLLHUP,
- qemudDispatchVMEvent,
- driver) < 0) {
- qemudShutdownVMDaemon(conn, driver, vm);
- return -1;
- }
-
- if (virEventAddHandle(vm->stderr,
- POLLIN | POLLERR | POLLHUP,
- qemudDispatchVMEvent,
- driver) < 0) {
- qemudShutdownVMDaemon(conn, driver, vm);
- return -1;
- }
-
- if (qemudWaitForMonitor(conn, driver, vm) < 0) {
- qemudShutdownVMDaemon(conn, driver, vm);
- return -1;
- }
-
- if (qemudDetectVcpuPIDs(conn, driver, vm) < 0) {
+ if ((virEventAddHandle(vm->stdout,
+ POLLIN | POLLERR | POLLHUP,
+ qemudDispatchVMEvent,
+ driver) < 0) ||
+ (virEventAddHandle(vm->stderr,
+ POLLIN | POLLERR | POLLHUP,
+ qemudDispatchVMEvent,
+ driver) < 0) ||
+ (qemudWaitForMonitor(conn, driver, vm) < 0) ||
+ (qemudDetectVcpuPIDs(conn, driver, vm) < 0) ||
+ (qemudInitCpus(conn, driver, vm) < 0)) {
qemudShutdownVMDaemon(conn, driver, vm);
return -1;
}
diff -r 3bbea433803f src/xml.c
--- a/src/xml.c Fri May 16 17:39:29 2008 -0400
+++ b/src/xml.c Fri May 16 17:40:39 2008 -0400
@@ -60,7 +60,7 @@
* Parser and converter for the CPUset strings used in libvirt *
* *
************************************************************************/
-#if WITH_XEN
+#if WITH_XEN || WITH_QEMU
/**
* parseCpuNumber:
* @str: pointer to the char pointer used
@@ -249,8 +249,9 @@
_("topology cpuset syntax error"), 0);
return (-1);
}
+#endif
-
+#if WITH_XEN
/**
* virConvertCpuSet:
* @conn: connection
diff -r 3bbea433803f src/xml.h
--- a/src/xml.h Fri May 16 17:39:29 2008 -0400
+++ b/src/xml.h Fri May 16 17:40:39 2008 -0400
@@ -32,7 +32,7 @@
xmlXPathContextPtr ctxt,
xmlNodePtr **list);
-#if WITH_XEN
+#if WITH_XEN || WITH_QEMU
int virParseCpuSet (virConnectPtr conn,
const char **str,
char sep,
@@ -41,6 +41,8 @@
char * virSaveCpuSet (virConnectPtr conn,
char *cpuset,
int maxcpu);
+#endif
+#if WITH_XEN
char * virConvertCpuSet(virConnectPtr conn,
const char *str,
int maxcpu);
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot d -cdrom /dev/cdrom -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot d -cdrom /dev/cdrom -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot a -hda /dev/HostVG/QEMUGuest1 -fda /tmp/firmware.img -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot a -hda /dev/HostVG/QEMUGuest1 -fda /tmp/firmware.img -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-boot-network.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot n -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot n -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-bootloader.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-bootloader.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-bootloader.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu-kvm -M xenner -m 214 -smp 1 -nographic -monitor pty -no-acpi -bootloader /usr/bin/pygrub -cdrom /dev/cdrom -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu-kvm -S -M xenner -m 214 -smp 1 -nographic -monitor pty -no-acpi -bootloader /usr/bin/pygrub -cdrom /dev/cdrom -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -localtime -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -localtime -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-console-compat.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -cdrom /root/boot.iso -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -cdrom /root/boot.iso -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -fda /dev/fd0 -fdb /tmp/firmware.img -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -fda /dev/fd0 -fdb /tmp/firmware.img -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-disk-many.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -hdb /dev/HostVG/QEMUGuest2 -hdc /tmp/data.img -hdd /tmp/logs.img -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -hdb /dev/HostVG/QEMUGuest2 -hdc /tmp/data.img -hdd /tmp/logs.img -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -drive file=/tmp/data.img,if=virtio,index=0 -drive file=/tmp/logs.img,if=virtio,index=6 -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -drive file=/tmp/data.img,if=virtio,index=0 -drive file=/tmp/logs.img,if=virtio,index=6 -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -drive file=/tmp/data.img,if=xen,index=0 -drive file=/tmp/logs.img,if=xen,index=6 -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0,boot=on -drive file=/dev/HostVG/QEMUGuest2,if=ide,media=cdrom,index=2 -drive file=/tmp/data.img,if=xen,index=0 -drive file=/tmp/logs.img,if=xen,index=6 -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice mouse
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice mouse
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice tablet
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -usbdevice tablet
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-input-xen.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-input-xen.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-xen.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/xenner -M xenner -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc :-5901
\ No newline at end of file
+/usr/bin/xenner -S -M xenner -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc :-5901
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-minimal.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-minimal.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-minimal.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -name QEMUGuest1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -name QEMUGuest1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
--- a/tests/qemuxml2argvdata/qemuxml2argv-minimal.xml Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-minimal.xml Fri May 16 17:40:39 2008 -0400
@@ -3,7 +3,7 @@
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory>219200</memory>
<currentMemory>219200</currentMemory>
- <vcpu>1</vcpu>
+ <vcpu cpuset='1-4,8-20,525'>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<boot dev='hd'/>
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-reboot -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-reboot -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-net-user.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-user.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-user.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0 -net user,vlan=0 -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0 -net user,vlan=0 -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0,model=virtio -net user,vlan=0 -serial none -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0,model=virtio -net user,vlan=0 -serial none -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel tcp:127.0.0.1:9999,listen -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel tcp:127.0.0.1:9999,listen -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial /dev/ttyS2 -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial /dev/ttyS2 -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-serial-file.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-file.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial file:/tmp/serial.log -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial file:/tmp/serial.log -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-serial-many.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-many.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -serial file:/tmp/serial.log -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -serial file:/tmp/serial.log -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial pty -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial telnet:127.0.0.1:9999,listen -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial telnet:127.0.0.1:9999,listen -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial tcp:127.0.0.1:9999 -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial tcp:127.0.0.1:9999 -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial udp:127.0.0.1:9998@127.0.0.1:9999 -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial udp:127.0.0.1:9998@127.0.0.1:9999 -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial unix:/tmp/serial.sock -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial unix:/tmp/serial.sock -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial vc -parallel none -usb
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial vc -parallel none -usb
\ No newline at end of file
diff -r 3bbea433803f tests/qemuxml2argvdata/qemuxml2argv-sound.args
--- a/tests/qemuxml2argvdata/qemuxml2argv-sound.args Fri May 16 17:39:29 2008 -0400
+++ b/tests/qemuxml2argvdata/qemuxml2argv-sound.args Fri May 16 17:40:39 2008 -0400
@@ -1,1 +1,1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -soundhw pcspk,es1370,sb16
\ No newline at end of file
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -soundhw pcspk,es1370,sb16
\ No newline at end of file
--
|: Red Hat, Engineering, Boston -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 :|
5
5
KVM added ability to get the thread ID for vCPUs via the monitor
(qemu) info cpus
* CPU #0: pc=0x00000000000ffff0 thread_id=11463
CPU #1: pc=0x00000000fffffff0 thread_id=11464
CPU #2: pc=0x00000000fffffff0 thread_id=11465
With this we have enough information to be able to support vCPU pinning in
the QEMU driver for KVM. For QEMU/KQEMU it is trivial, since they have a
single thread.
The following patch implements CPU pinning and fetching of CPU affinity
information. In this example I pin one of the 2 cpus in a guest:
[berrange@t60wlan libvirt-numa]$ ./src/virsh --connect qemu:///system start VirtTest
Domain VirtTest started
[berrange@t60wlan libvirt-numa]$ ./src/virsh --connect qemu:///system vcpuinfo VirtTest
VCPU: 0
CPU: 0
State: running
CPU Affinity: yy
VCPU: 1
CPU: 0
State: running
CPU Affinity: yy
[berrange@t60wlan libvirt-numa]$ ./src/virsh --connect qemu:///system vcpupin VirtTest 1 0
[berrange@t60wlan libvirt-numa]$ ./src/virsh --connect qemu:///system vcpuinfo VirtTest
VCPU: 0
CPU: 0
State: running
CPU Affinity: yy
VCPU: 1
CPU: 0
State: running
CPU Affinity: y-
This is implemented using sched_setaffinity/sched_getaffinity which are
Linux specific. There doesn't appear to be a portable process affinity
API in POSIX.
If the KVM instance does not support the 'thread_id' data in 'info cpus',
we simply print out a suitable error message. We detect the mapping at
startup and cache it thereafter.
Dan.
diff -r 0f537442ce97 src/qemu_conf.h
--- a/src/qemu_conf.h Fri May 16 16:09:57 2008 -0400
+++ b/src/qemu_conf.h Fri May 16 17:39:29 2008 -0400
@@ -328,6 +328,9 @@
int *tapfds;
int ntapfds;
+ int nvcpupids;
+ int *vcpupids;
+
int qemuVersion;
int qemuCmdFlags; /* values from enum qemud_cmd_flags */
diff -r 0f537442ce97 src/qemu_driver.c
--- a/src/qemu_driver.c Fri May 16 16:09:57 2008 -0400
+++ b/src/qemu_driver.c Fri May 16 17:39:29 2008 -0400
@@ -61,6 +61,7 @@
#include "nodeinfo.h"
#include "stats_linux.h"
#include "capabilities.h"
+#include "memory.h"
static int qemudShutdown(void);
@@ -118,6 +119,10 @@
struct qemud_network *network);
static int qemudDomainGetMaxVcpus(virDomainPtr dom);
+static int qemudMonitorCommand (const struct qemud_driver *driver,
+ const struct qemud_vm *vm,
+ const char *cmd,
+ char **reply);
static struct qemud_driver *qemu_driver = NULL;
@@ -608,6 +613,106 @@
return ret;
}
+static int
+qemudDetectVcpuPIDs(virConnectPtr conn,
+ struct qemud_driver *driver,
+ struct qemud_vm *vm) {
+ char *qemucpus = NULL;
+ char *line;
+ int lastVcpu = -1;
+
+ /* Only KVM has seperate threads for CPUs,
+ others just use main QEMU process for CPU */
+ if (vm->def->virtType != QEMUD_VIRT_KVM)
+ vm->nvcpupids = 1;
+ else
+ vm->nvcpupids = vm->def->vcpus;
+
+ if (VIR_ALLOC_N(vm->vcpupids, vm->nvcpupids) < 0) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY,
+ "%s", _("allocate cpumap"));
+ return -1;
+ }
+
+ if (vm->def->virtType != QEMUD_VIRT_KVM) {
+ vm->vcpupids[0] = vm->pid;
+ return 0;
+ }
+
+ if (qemudMonitorCommand(driver, vm, "info cpus", &qemucpus) < 0) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot run monitor command to fetch CPU thread info"));
+ VIR_FREE(vm->vcpupids);
+ vm->nvcpupids = 0;
+ return -1;
+ }
+
+ /*
+ * This is the gross format we're about to parse :-{
+ *
+ * (qemu) info cpus
+ * * CPU #0: pc=0x00000000000f0c4a thread_id=30019
+ * CPU #1: pc=0x00000000fffffff0 thread_id=30020
+ * CPU #2: pc=0x00000000fffffff0 thread_id=30021
+ *
+ */
+ line = qemucpus;
+ do {
+ char *offset = strchr(line, '#');
+ char *end = NULL;
+ int vcpu = 0, tid = 0;
+
+ /* See if we're all done */
+ if (offset == NULL)
+ break;
+
+ /* Extract VCPU number */
+ if (virStrToLong_i(offset + 1, &end, 10, &vcpu) < 0)
+ goto error;
+ if (end == NULL || *end != ':')
+ goto error;
+
+ /* Extract host Thread ID */
+ if ((offset = strstr(line, "thread_id=")) == NULL)
+ goto error;
+ if (virStrToLong_i(offset + strlen("thread_id="), &end, 10, &tid) < 0)
+ goto error;
+ if (end == NULL || !c_isspace(*end))
+ goto error;
+
+ /* Validate the VCPU is in expected range & order */
+ if (vcpu > vm->nvcpupids ||
+ vcpu != (lastVcpu + 1))
+ goto error;
+
+ lastVcpu = vcpu;
+ vm->vcpupids[vcpu] = tid;
+
+ /* Skip to next data line */
+ line = strchr(offset, '\r');
+ if (line == NULL)
+ line = strchr(offset, '\n');
+ } while (line != NULL);
+
+ /* Validate we got data for all VCPUs we expected */
+ if (lastVcpu != (vm->def->vcpus - 1))
+ goto error;
+
+ free(qemucpus);
+ return 0;
+
+error:
+ VIR_FREE(vm->vcpupids);
+ vm->vcpupids = 0;
+ free(qemucpus);
+
+ /* Explicitly return success, not error. Older KVM does
+ not have vCPU -> Thread mapping info and we don't
+ want to break its use. This merely disables ability
+ to pin vCPUS with libvirt */
+ return 0;
+}
+
static int qemudNextFreeVNCPort(struct qemud_driver *driver ATTRIBUTE_UNUSED) {
int i;
@@ -785,6 +890,11 @@
qemudShutdownVMDaemon(conn, driver, vm);
return -1;
}
+
+ if (qemudDetectVcpuPIDs(conn, driver, vm) < 0) {
+ qemudShutdownVMDaemon(conn, driver, vm);
+ return -1;
+ }
}
return ret;
@@ -857,6 +967,9 @@
vm->pid = -1;
vm->id = -1;
vm->state = VIR_DOMAIN_SHUTOFF;
+ free(vm->vcpupids);
+ vm->vcpupids = NULL;
+ vm->nvcpupids = 0;
if (vm->newDef) {
qemudFreeVMDef(vm->def);
@@ -2271,6 +2384,127 @@
vm->def->vcpus = nvcpus;
return 0;
+}
+
+
+static int
+qemudDomainPinVcpu(virDomainPtr dom,
+ unsigned int vcpu,
+ unsigned char *cpumap,
+ int maplen) {
+ struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
+ struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
+ cpu_set_t mask;
+ int i, maxcpu;
+ virNodeInfo nodeinfo;
+
+ if (!qemudIsActiveVM(vm)) {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ "%s",_("cannot pin vcpus on an inactive domain"));
+ return -1;
+ }
+
+ if (vcpu > (vm->nvcpupids-1)) {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ _("vcpu number out of range %d > %d"),
+ vcpu, vm->nvcpupids);
+ return -1;
+ }
+
+ if (virNodeInfoPopulate(dom->conn, &nodeinfo) < 0)
+ return -1;
+
+ maxcpu = maplen * 8;
+ if (maxcpu > nodeinfo.cpus)
+ maxcpu = nodeinfo.cpus;
+
+ CPU_ZERO(&mask);
+ for (i = 0 ; i < maxcpu ; i++) {
+ if ((cpumap[i/8] >> (i % 8)) & 1)
+ CPU_SET(i, &mask);
+ }
+
+ if (vm->vcpupids != NULL) {
+ if (sched_setaffinity(vm->vcpupids[vcpu], sizeof(mask), &mask) < 0) {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ _("cannot set affinity: %s"), strerror(errno));
+ return -1;
+ }
+ } else {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
+ "%s", _("cpu affinity is not supported"));
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+qemudDomainGetVcpus(virDomainPtr dom,
+ virVcpuInfoPtr info,
+ int maxinfo,
+ unsigned char *cpumaps,
+ int maplen) {
+ struct qemud_driver *driver = (struct qemud_driver *)dom->conn->privateData;
+ struct qemud_vm *vm = qemudFindVMByUUID(driver, dom->uuid);
+ virNodeInfo nodeinfo;
+ int i, v, maxcpu;
+
+ if (!qemudIsActiveVM(vm)) {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ "%s",_("cannot pin vcpus on an inactive domain"));
+ return -1;
+ }
+
+ if (virNodeInfoPopulate(dom->conn, &nodeinfo) < 0)
+ return -1;
+
+ maxcpu = maplen * 8;
+ if (maxcpu > nodeinfo.cpus)
+ maxcpu = nodeinfo.cpus;
+
+ /* Clamp to actual number of vcpus */
+ if (maxinfo > vm->nvcpupids)
+ maxinfo = vm->nvcpupids;
+
+ if (maxinfo < 1)
+ return 0;
+
+ if (info != NULL) {
+ memset(info, 0, sizeof(*info) * maxinfo);
+ for (i = 0 ; i < maxinfo ; i++) {
+ info[i].number = i;
+ info[i].state = VIR_VCPU_RUNNING;
+ /* XXX cpu time, current pCPU mapping */
+ }
+ }
+
+ if (cpumaps != NULL) {
+ memset(cpumaps, 0, maplen * maxinfo);
+ if (vm->vcpupids != NULL) {
+ for (v = 0 ; v < maxinfo ; v++) {
+ cpu_set_t mask;
+ unsigned char *cpumap = VIR_GET_CPUMAP(cpumaps, maplen, v);
+ CPU_ZERO(&mask);
+
+ if (sched_getaffinity(vm->vcpupids[v], sizeof(mask), &mask) < 0) {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ _("cannot get affinity: %s"), strerror(errno));
+ return -1;
+ }
+
+ for (i = 0 ; i < maxcpu ; i++)
+ if (CPU_ISSET(i, &mask))
+ VIR_USE_CPU(cpumap, i);
+ }
+ } else {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
+ "%s", _("cpu affinity is not available"));
+ return -1;
+ }
+ }
+
+ return maxinfo;
}
static int qemudDomainGetMaxVcpus(virDomainPtr dom) {
@@ -3221,8 +3455,8 @@
qemudDomainRestore, /* domainRestore */
NULL, /* domainCoreDump */
qemudDomainSetVcpus, /* domainSetVcpus */
- NULL, /* domainPinVcpu */
- NULL, /* domainGetVcpus */
+ qemudDomainPinVcpu, /* domainPinVcpu */
+ qemudDomainGetVcpus, /* domainGetVcpus */
qemudDomainGetMaxVcpus, /* domainGetMaxVcpus */
qemudDomainDumpXML, /* domainDumpXML */
qemudListDefinedDomains, /* listDomains */
--
|: Red Hat, Engineering, Boston -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 :|
2
4
23 May '08
Another configure.ac cleanup, this time removing a bunch of duplicated
messages printed out by various checks. Applies ontop of the previous
patch.
Dan.
diff -r cc378ee57aab configure.in
--- a/configure.in Tue May 20 14:23:31 2008 -0400
+++ b/configure.in Tue May 20 14:32:17 2008 -0400
@@ -355,16 +355,14 @@
[GNUTLS_FOUND=yes], [GNUTLS_FOUND=no])
fi
if test "$GNUTLS_FOUND" = "no"; then
- AC_CHECK_HEADER([gnutls/gnutls.h],
- [],
- AC_MSG_ERROR(
- [You must install the GnuTLS development package in order to compile libvirt]))
+ fail=0
old_libs="$LIBS"
- AC_CHECK_LIB([gnutls], [gnutls_handshake],
- [],
- [AC_MSG_ERROR(
- [You must install the GnuTLS library in order to compile and run libvirt])],
- [-lgcrypt])
+ AC_CHECK_HEADER([gnutls/gnutls.h], [], [fail=1])
+ AC_CHECK_LIB([gnutls], [gnutls_handshake],[], [fail=1], [-lgcrypt])
+
+ test $fail = 1 &&
+ AC_MSG_ERROR([You must install the GnuTLS library in order to compile and run libvirt])
+
GNUTLS_LIBS=$LIBS
LIBS="$old_libs"
fi
@@ -400,6 +398,7 @@
SASL_CFLAGS="-I$with_sasl"
SASL_LIBS="-L$with_sasl"
fi
+ fail=0
old_cflags="$CFLAGS"
old_libs="$LIBS"
CFLAGS="$CFLAGS $SASL_CFLAGS"
@@ -408,18 +407,18 @@
if test "x$with_sasl" != "xcheck" ; then
with_sasl=no
else
- AC_MSG_ERROR(
- [You must install the Cyrus SASL development package in order to compile libvirt])
+ fail=1
fi])
if test "x$with_sasl" != "xno" ; then
AC_CHECK_LIB([sasl2], [sasl_client_init],[with_sasl=yes],[
if test "x$with_sasl" = "xcheck" ; then
with_sasl=no
else
- AC_MSG_ERROR(
- [You must install the Cyrus SASL library in order to compile and run libvirt])
+ fail=1
fi])
fi
+ test $fail = 1 &&
+ AC_MSG_ERROR([You must install the Cyrus SASL development package in order to compile libvirt])
CFLAGS="$old_cflags"
LIBS="$old_libs"
SASL_LIBS="$SASL_LIBS -lsasl2"
@@ -518,10 +517,11 @@
with_selinux="yes"
fi
else
- AC_CHECK_HEADER([selinux/selinux.h],[],
- [AC_MSG_ERROR([You must install the SELinux development package in order to compile libvirt])])
- AC_CHECK_LIB([selinux], [fgetfilecon],[],
- [AC_MSG_ERROR([You must install the SELinux development package in order to compile and run libvirt])])
+ fail=0
+ AC_CHECK_HEADER([selinux/selinux.h],[],[fail=1])
+ AC_CHECK_LIB([selinux], [fgetfilecon],[],[fail=1])
+ test $fail = 1 &&
+ AC_MSG_ERROR([You must install the SELinux development package in order to compile libvirt])
fi
CFLAGS="$old_cflags"
LIBS="$old_libs"
@@ -552,10 +552,11 @@
with_numactl="yes"
fi
else
- AC_CHECK_HEADER([numa.h],[],
- [AC_MSG_ERROR([You must install the numactl development package in order to compile libvirt])])
- AC_CHECK_LIB([numa], [numa_available],[],
- [AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt])])
+ fail=0
+ AC_CHECK_HEADER([numa.h],[],[fail=1])
+ AC_CHECK_LIB([numa], [numa_available],[],[fail=1])
+ test $fail = 1 &&
+ AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt])
fi
CFLAGS="$old_cflags"
LIBS="$old_libs"
@@ -632,7 +633,7 @@
AC_PATH_PROG([UMOUNT], [umount], [], [$PATH:/sbin:/usr/sbin])
if test "$with_storage_fs" = "yes" ; then
if test -z "$MOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
- if test -z "$UMOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
+ if test -z "$UMOUNT" ; then AC_MSG_ERROR(We need umount for FS storage driver) ; fi
else
if test -z "$MOUNT" ; then with_storage_fs=no ; fi
if test -z "$UMOUNT" ; then with_storage_fs=no ; fi
--
|: Red Hat, Engineering, Boston -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 :|
2
2
As suggested by Jim, this patch goes through the configure script and makes
sure all args to macros are fully quoted. NB, this applies on top of the
NUMA/cpu pinning patches I sent the other day, not CVS.
Dan.
diff -r d2bddf5ed80e configure.in
--- a/configure.in Tue May 20 14:10:37 2008 -0400
+++ b/configure.in Tue May 20 14:23:31 2008 -0400
@@ -15,12 +15,12 @@
LIBVIRT_VERSION_INFO=`expr $LIBVIRT_MAJOR_VERSION + $LIBVIRT_MINOR_VERSION`:$LIBVIRT_MICRO_VERSION:$LIBVIRT_MINOR_VERSION
LIBVIRT_VERSION_NUMBER=`expr $LIBVIRT_MAJOR_VERSION \* 1000000 + $LIBVIRT_MINOR_VERSION \* 1000 + $LIBVIRT_MICRO_VERSION`
-AC_SUBST(LIBVIRT_MAJOR_VERSION)
-AC_SUBST(LIBVIRT_MINOR_VERSION)
-AC_SUBST(LIBVIRT_MICRO_VERSION)
-AC_SUBST(LIBVIRT_VERSION)
-AC_SUBST(LIBVIRT_VERSION_INFO)
-AC_SUBST(LIBVIRT_VERSION_NUMBER)
+AC_SUBST([LIBVIRT_MAJOR_VERSION])
+AC_SUBST([LIBVIRT_MINOR_VERSION])
+AC_SUBST([LIBVIRT_MICRO_VERSION])
+AC_SUBST([LIBVIRT_VERSION])
+AC_SUBST([LIBVIRT_VERSION_INFO])
+AC_SUBST([LIBVIRT_VERSION_NUMBER])
dnl Required minimum versions of all libs we depend on
LIBXML_REQUIRED="2.5.0"
@@ -74,34 +74,34 @@
])
dnl Do we have rpcgen?
-AC_PATH_PROG(RPCGEN, rpcgen, no)
-AM_CONDITIONAL(RPCGEN, [test "x$ac_cv_path_RPCGEN" != "xno"])
+AC_PATH_PROG([RPCGEN], [rpcgen], [no])
+AM_CONDITIONAL([RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"])
dnl Is this GLIBC's buggy rpcgen?
-AM_CONDITIONAL(GLIBC_RPCGEN,
+AM_CONDITIONAL([GLIBC_RPCGEN],
[test "x$ac_cv_path_RPCGEN" != "xno" &&
$ac_cv_path_RPCGEN -t </dev/null >/dev/null 2>&1])
dnl pthread?
-AC_CHECK_HEADER(pthread.h,
- AC_CHECK_LIB(pthread,pthread_join,[
+AC_CHECK_HEADER([pthread.h],
+ AC_CHECK_LIB([pthread],[pthread_join],[
AC_DEFINE([HAVE_LIBPTHREAD],[],[Define if pthread (-lpthread)])
AC_DEFINE([HAVE_PTHREAD_H],[],[Define if <pthread.h>])
]))
dnl Miscellaneous external programs.
-AC_PATH_PROG(RM, rm, /bin/rm)
-AC_PATH_PROG(MV, mv, /bin/mv)
-AC_PATH_PROG(TAR, tar, /bin/tar)
-AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint)
-AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
+AC_PATH_PROG([RM], [rm], [/bin/rm])
+AC_PATH_PROG([MV], [mv], [/bin/mv])
+AC_PATH_PROG([TAR], [tar], [/bin/tar])
+AC_PATH_PROG([XMLLINT], [xmllint], [/usr/bin/xmllint])
+AC_PATH_PROG([XSLTPROC], [xsltproc], [/usr/bin/xsltproc])
dnl External programs that we can use if they are available.
dnl We will hard-code paths to these programs unless we cannot
dnl detect them, in which case we'll search for the program
dnl along the $PATH at runtime and fail if it's not there.
-AC_PATH_PROG(DNSMASQ, dnsmasq, dnsmasq,
+AC_PATH_PROG([DNSMASQ], [dnsmasq], [dnsmasq],
[/sbin:/usr/sbin:/usr/local/sbin:$PATH])
-AC_PATH_PROG(BRCTL, brctl, brctl,
+AC_PATH_PROG([BRCTL], [brctl], [brctl],
[/sbin:/usr/sbin:/usr/local/sbin:$PATH])
AC_DEFINE_UNQUOTED([DNSMASQ],["$DNSMASQ"],
@@ -110,15 +110,15 @@
[Location or name of the brctl program (see bridge-utils)])
dnl Specific dir for HTML output ?
-AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path],
+AC_ARG_WITH([html-dir], AC_HELP_STRING([--with-html-dir=path],
[path to base html directory, default $datadir/doc/html]),
[HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
-AC_ARG_WITH(html-subdir, AC_HELP_STRING([--with-html-subdir=path],
+AC_ARG_WITH([html-subdir], AC_HELP_STRING([--with-html-subdir=path],
[directory used under html-dir, default $PACKAGE-$VERSION/html]),
[test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
[HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
-AC_SUBST(HTML_DIR)
+AC_SUBST([HTML_DIR])
dnl if --prefix is /usr, don't use /usr/var for localstatedir
dnl or /usr/etc for sysconfdir
@@ -133,19 +133,19 @@
dnl Allow to build without Xen, QEMU/KVM, test or remote driver
-AC_ARG_WITH(xen,
+AC_ARG_WITH([xen],
[ --with-xen add XEN support (on)],[],[with_xen=yes])
-AC_ARG_WITH(qemu,
+AC_ARG_WITH([qemu],
[ --with-qemu add QEMU/KVM support (on)],[],[with_qemu=yes])
-AC_ARG_WITH(openvz,
+AC_ARG_WITH([openvz],
[ --with-openvz add OpenVZ support (off)],[],[with_openvz=no])
-AC_ARG_WITH(lxc,
+AC_ARG_WITH([lxc],
[ --with-lxc add Linux Container support (off)],[],[with_lxc=no])
-AC_ARG_WITH(test,
+AC_ARG_WITH([test],
[ --with-test add test driver support (on)],[],[with_test=yes])
-AC_ARG_WITH(remote,
+AC_ARG_WITH([remote],
[ --with-remote add remote driver support (on)],[],[with_remote=yes])
-AC_ARG_WITH(libvirtd,
+AC_ARG_WITH([libvirtd],
[ --with-libvirtd add libvirtd support (on)],[],[with_libvirtd=yes])
dnl
@@ -156,19 +156,19 @@
else
STATIC_BINARIES=
fi
-AC_SUBST(STATIC_BINARIES)
+AC_SUBST([STATIC_BINARIES])
dnl --enable-debug=(yes|no)
-AC_ARG_ENABLE(debug,
+AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug=no/yes],
[enable debugging output]),[],[enable_debug=yes])
if test x"$enable_debug" = x"yes"; then
- AC_DEFINE(ENABLE_DEBUG, [], [whether debugging is enabled])
+ AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled])
fi
AC_MSG_CHECKING([where to write libvirtd PID file])
-AC_ARG_WITH(remote-pid-file, AC_HELP_STRING([--with-remote-pid-file=[pidfile|none]], [PID file for libvirtd]))
+AC_ARG_WITH([remote-pid-file], AC_HELP_STRING([--with-remote-pid-file=[pidfile|none]], [PID file for libvirtd]))
if test "x$with_remote_pid_file" == "x" ; then
REMOTE_PID_FILE="$localstatedir/run/libvirtd.pid"
elif test "x$with_remote_pid_file" == "xnone" ; then
@@ -176,14 +176,14 @@
else
REMOTE_PID_FILE="$with_remote_pid_file"
fi
-AC_SUBST(REMOTE_PID_FILE)
+AC_SUBST([REMOTE_PID_FILE])
AC_MSG_RESULT($REMOTE_PID_FILE)
dnl
dnl init script flavor
dnl
AC_MSG_CHECKING([for init script flavor])
-AC_ARG_WITH(init-script,
+AC_ARG_WITH([init-script],
AC_HELP_STRING([--with-init-scripts=[redhat|auto|none]],
[Style of init scripts to install (defaults to auto)]))
if test "x$with_init_scripts" = "x" -o "x$with_init_scripts" = "xauto"; then
@@ -193,19 +193,19 @@
with_init_scripts=none
fi
fi
-AM_CONDITIONAL(LIBVIRT_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
+AM_CONDITIONAL([LIBVIRT_INIT_SCRIPTS_RED_HAT], test x$with_init_scripts = xredhat)
AC_MSG_RESULT($with_init_scripts)
dnl
dnl ensure that Fedora's system-config-firewall knows
dnl about libvirt's iptables rules
dnl
-AC_ARG_ENABLE(iptables-lokkit,
+AC_ARG_ENABLE([iptables-lokkit],
AC_HELP_STRING([--enable-iptables-lokkit=no/yes/check],
[enable registering libvirt's iptables rules with Fedora's lokkit]),
[],[enable_iptables_lokkit=check])
if test x"$enable_iptables_lokkit" != x"no"; then
- AC_PATH_PROG(LOKKIT_PATH, lokkit, [], [/usr/sbin:$PATH])
+ AC_PATH_PROG([LOKKIT_PATH],[lokkit], [], [/usr/sbin:$PATH])
fi
if test x"$enable_iptables_lokkit" = x"yes" -a x"$LOKKIT_PATH" = x; then
@@ -213,18 +213,18 @@
fi
if test x"$LOKKIT_PATH" != x; then
- AC_DEFINE(ENABLE_IPTABLES_LOKKIT, [], [whether support for Fedora's lokkit is enabled])
- AC_DEFINE_UNQUOTED(LOKKIT_PATH, "$LOKKIT_PATH", [path to lokkit binary])
+ AC_DEFINE([ENABLE_IPTABLES_LOKKIT], [], [whether support for Fedora's lokkit is enabled])
+ AC_DEFINE_UNQUOTED([LOKKIT_PATH], "$LOKKIT_PATH", [path to lokkit binary])
fi
-AC_PATH_PROG(IPTABLES_PATH, iptables, /sbin/iptables, [/usr/sbin:$PATH])
-AC_DEFINE_UNQUOTED(IPTABLES_PATH, "$IPTABLES_PATH", [path to iptables binary])
+AC_PATH_PROG([IPTABLES_PATH], [iptables], /sbin/iptables, [/usr/sbin:$PATH])
+AC_DEFINE_UNQUOTED([IPTABLES_PATH], "$IPTABLES_PATH", [path to iptables binary])
dnl
dnl Specify the xen-distribution directory to be able to compile on a
dnl non-xenified host
dnl
-AC_ARG_WITH(xen-distdir, AC_HELP_STRING([--with-xen-distdir=path],
+AC_ARG_WITH([xen-distdir], AC_HELP_STRING([--with-xen-distdir=path],
[distribution directory of Xen, default /usr]))
if test "x$with_xen_distdir" != "x"
then
@@ -262,7 +262,7 @@
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_XEN"
fi
- AC_CHECK_HEADERS(xen/xen.h xen/version.h xen/dom0_ops.h,,[
+ AC_CHECK_HEADERS([xen/xen.h xen/version.h xen/dom0_ops.h],,[
AC_MSG_ERROR([Cannot find standard Xen headers. Is xen-devel installed?])
],
[#include <stdio.h>
@@ -270,8 +270,8 @@
])
dnl Search for the location of <xen/{linux,sys}/privcmd.h>.
- AC_CHECK_HEADERS(xen/sys/privcmd.h,,[
- AC_CHECK_HEADERS(xen/linux/privcmd.h,,[
+ AC_CHECK_HEADERS([xen/sys/privcmd.h],,[
+ AC_CHECK_HEADERS([xen/linux/privcmd.h],,[
AC_MSG_ERROR([Cannot find header file <xen/linux/privcmd.h> or <xen/sys/privcmd.h>. Is xen-devel installed?])
],
[#include <stdio.h>
@@ -289,7 +289,7 @@
dnl check for kernel headers required by qemud/bridge.c
dnl
if test "$with_qemu" = "yes" ; then
- AC_CHECK_HEADERS(linux/param.h linux/sockios.h linux/if_bridge.h linux/if_tun.h,,
+ AC_CHECK_HEADERS([linux/param.h linux/sockios.h linux/if_bridge.h linux/if_tun.h],,
AC_MSG_ERROR([You must install kernel-headers in order to compile libvirt]))
fi
@@ -304,7 +304,7 @@
LIBXML_LIBS=""
LIBXML_FOUND="no"
-AC_ARG_WITH(libxml, [ --with-libxml=[PFX] libxml2 location])
+AC_ARG_WITH([libxml], [ --with-libxml=[PFX] libxml2 location])
if test "x$with_libxml" = "xno" ; then
AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED)
AC_MSG_ERROR(libxml2 >= $LIBXML_REQUIRED is required for libvirt)
@@ -332,16 +332,16 @@
fi
fi
-AC_SUBST(LIBXML_CFLAGS)
-AC_SUBST(LIBXML_LIBS)
+AC_SUBST([LIBXML_CFLAGS])
+AC_SUBST([LIBXML_LIBS])
dnl xmlURI structure has query_raw?
old_cflags="$CFLAGS"
old_ldflags="$LDFLAGS"
CFLAGS="$CFLAGS $LIBXML_CFLAGS"
LDFLAGS="$LDFLAGS $LIBXML_LIBS"
-AC_CHECK_MEMBER(struct _xmlURI.query_raw,
- [AC_DEFINE(HAVE_XMLURI_QUERY_RAW, [], [Have query_raw field in libxml2 xmlURI structure])],,
+AC_CHECK_MEMBER([struct _xmlURI.query_raw],
+ [AC_DEFINE([HAVE_XMLURI_QUERY_RAW], [], [Have query_raw field in libxml2 xmlURI structure])],,
[#include <libxml/uri.h>])
CFLAGS="$old_cflags"
LDFLAGS="$old_ldflags"
@@ -360,7 +360,7 @@
AC_MSG_ERROR(
[You must install the GnuTLS development package in order to compile libvirt]))
old_libs="$LIBS"
- AC_CHECK_LIB(gnutls, gnutls_handshake,
+ AC_CHECK_LIB([gnutls], [gnutls_handshake],
[],
[AC_MSG_ERROR(
[You must install the GnuTLS library in order to compile and run libvirt])],
@@ -369,8 +369,8 @@
LIBS="$old_libs"
fi
-AC_SUBST(GNUTLS_CFLAGS)
-AC_SUBST(GNUTLS_LIBS)
+AC_SUBST([GNUTLS_CFLAGS])
+AC_SUBST([GNUTLS_LIBS])
dnl Old versions of GnuTLS uses types like 'gnutls_session' instead
dnl of 'gnutls_session_t'. Try to detect this type if defined so
@@ -379,8 +379,8 @@
old_ldflags="$LDFLAGS"
CFLAGS="$CFLAGS $GNUTLS_CFLAGS"
LDFLAGS="$LDFLAGS $GNUTLS_LIBS"
-AC_CHECK_TYPE(gnutls_session,
- AC_DEFINE(GNUTLS_1_0_COMPAT,[],
+AC_CHECK_TYPE([gnutls_session],
+ AC_DEFINE([GNUTLS_1_0_COMPAT],[],
[enable GnuTLS 1.0 compatibility macros]),,
[#include <gnutls/gnutls.h>])
CFLAGS="$old_cflags"
@@ -388,7 +388,7 @@
dnl Cyrus SASL
-AC_ARG_WITH(sasl,
+AC_ARG_WITH([sasl],
[ --with-sasl use cyrus SASL for authentication],
[],
[with_sasl=check])
@@ -412,7 +412,7 @@
[You must install the Cyrus SASL development package in order to compile libvirt])
fi])
if test "x$with_sasl" != "xno" ; then
- AC_CHECK_LIB(sasl2, sasl_client_init,[with_sasl=yes],[
+ AC_CHECK_LIB([sasl2], [sasl_client_init],[with_sasl=yes],[
if test "x$with_sasl" = "xcheck" ; then
with_sasl=no
else
@@ -424,19 +424,19 @@
LIBS="$old_libs"
SASL_LIBS="$SASL_LIBS -lsasl2"
if test "x$with_sasl" = "xyes" ; then
- AC_DEFINE_UNQUOTED(HAVE_SASL, 1,
+ AC_DEFINE_UNQUOTED([HAVE_SASL], 1,
[whether Cyrus SASL is available for authentication])
fi
fi
-AM_CONDITIONAL(HAVE_SASL, [test "x$with_sasl" = "xyes"])
-AC_SUBST(SASL_CFLAGS)
-AC_SUBST(SASL_LIBS)
+AM_CONDITIONAL([HAVE_SASL], [test "x$with_sasl" = "xyes"])
+AC_SUBST([SASL_CFLAGS])
+AC_SUBST([SASL_LIBS])
dnl PolicyKit library
POLKIT_CFLAGS=
POLKIT_LIBS=
-AC_ARG_WITH(polkit,
+AC_ARG_WITH([polkit],
[ --with-polkit use PolicyKit for UNIX socket access checks],
[],
[with_polkit=check])
@@ -452,29 +452,29 @@
fi
])
if test "x$with_polkit" = "xyes" ; then
- AC_DEFINE_UNQUOTED(HAVE_POLKIT, 1,
+ AC_DEFINE_UNQUOTED([HAVE_POLKIT], 1,
[use PolicyKit for UNIX socket access checks])
old_CFLAGS=$CFLAGS
old_LDFLAGS=$LDFLAGS
CFLAGS="$CFLAGS $POLKIT_CFLAGS"
LDFLAGS="$LDFLAGS $POLKIT_LIBS"
- AC_CHECK_FUNCS(polkit_context_is_caller_authorized)
+ AC_CHECK_FUNCS([polkit_context_is_caller_authorized])
CFLAGS="$old_CFLAGS"
LDFLAGS="$old_LDFLAGS"
- AC_PATH_PROG(POLKIT_AUTH, polkit-auth)
+ AC_PATH_PROG([POLKIT_AUTH], [polkit-auth])
if test "x$POLKIT_AUTH" != "x"; then
AC_DEFINE_UNQUOTED([POLKIT_AUTH],["$POLKIT_AUTH"],[Location of polkit-auth program])
fi
fi
fi
-AM_CONDITIONAL(HAVE_POLKIT, [test "x$with_polkit" = "xyes"])
-AC_SUBST(POLKIT_CFLAGS)
-AC_SUBST(POLKIT_LIBS)
+AM_CONDITIONAL([HAVE_POLKIT], [test "x$with_polkit" = "xyes"])
+AC_SUBST([POLKIT_CFLAGS])
+AC_SUBST([POLKIT_LIBS])
dnl Avahi library
-AC_ARG_WITH(avahi,
+AC_ARG_WITH([avahi],
[ --with-avahi use avahi to advertise remote daemon],
[],
[with_avahi=check])
@@ -492,16 +492,16 @@
fi
])
if test "x$with_avahi" = "xyes" ; then
- AC_DEFINE_UNQUOTED(HAVE_AVAHI, 1,
+ AC_DEFINE_UNQUOTED([HAVE_AVAHI], 1,
[whether Avahi is used to broadcast server presense])
fi
fi
-AM_CONDITIONAL(HAVE_AVAHI, [test "x$with_avahi" = "xyes"])
-AC_SUBST(AVAHI_CFLAGS)
-AC_SUBST(AVAHI_LIBS)
+AM_CONDITIONAL([HAVE_AVAHI], [test "x$with_avahi" = "xyes"])
+AC_SUBST([AVAHI_CFLAGS])
+AC_SUBST([AVAHI_LIBS])
dnl SELinux
-AC_ARG_WITH(selinux,
+AC_ARG_WITH([selinux],
[ --with-selinux use SELinux to manage security],
[],
[with_selinux=check])
@@ -513,14 +513,14 @@
old_libs="$LIBS"
if test "$with_selinux" = "check"; then
AC_CHECK_HEADER([selinux/selinux.h],[],[with_selinux=no])
- AC_CHECK_LIB(selinux, fgetfilecon,[],[with_selinux=no])
+ AC_CHECK_LIB([selinux], [fgetfilecon],[],[with_selinux=no])
if test "$with_selinux" != "no"; then
with_selinux="yes"
fi
else
AC_CHECK_HEADER([selinux/selinux.h],[],
[AC_MSG_ERROR([You must install the SELinux development package in order to compile libvirt])])
- AC_CHECK_LIB(selinux, fgetfilecon,[],
+ AC_CHECK_LIB([selinux], [fgetfilecon],[],
[AC_MSG_ERROR([You must install the SELinux development package in order to compile and run libvirt])])
fi
CFLAGS="$old_cflags"
@@ -528,14 +528,14 @@
fi
if test "$with_selinux" = "yes"; then
SELINUX_LIBS="-lselinux"
- AC_DEFINE_UNQUOTED(HAVE_SELINUX, 1, [whether SELinux is available for security])
+ AC_DEFINE_UNQUOTED([HAVE_SELINUX], 1, [whether SELinux is available for security])
fi
-AM_CONDITIONAL(HAVE_SELINUX, [test "$with_selinux" != "no"])
-AC_SUBST(SELINUX_CFLAGS)
-AC_SUBST(SELINUX_LIBS)
+AM_CONDITIONAL([HAVE_SELINUX], [test "$with_selinux" != "no"])
+AC_SUBST([SELINUX_CFLAGS])
+AC_SUBST([SELINUX_LIBS])
dnl NUMA lib
-AC_ARG_WITH(numactl,
+AC_ARG_WITH([numactl],
[ --with-numactl use numactl for host topology info],
[],
[with_numactl=check])
@@ -547,14 +547,14 @@
old_libs="$LIBS"
if test "$with_numactl" = "check"; then
AC_CHECK_HEADER([numa.h],[],[with_numactl=no])
- AC_CHECK_LIB(numa, numa_available,[],[with_numactl=no])
+ AC_CHECK_LIB([numa], [numa_available],[],[with_numactl=no])
if test "$with_numactl" != "no"; then
with_numactl="yes"
fi
else
AC_CHECK_HEADER([numa.h],[],
[AC_MSG_ERROR([You must install the numactl development package in order to compile libvirt])])
- AC_CHECK_LIB(numa, numa_available,[],
+ AC_CHECK_LIB([numa], [numa_available],[],
[AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt])])
fi
CFLAGS="$old_cflags"
@@ -562,17 +562,17 @@
fi
if test "$with_numactl" = "yes"; then
NUMACTL_LIBS="-lnuma"
- AC_DEFINE_UNQUOTED(HAVE_NUMACTL, 1, [whether Numactl is available for security])
+ AC_DEFINE_UNQUOTED([HAVE_NUMACTL], 1, [whether Numactl is available for security])
fi
-AM_CONDITIONAL(HAVE_NUMACTL, [test "$with_numactl" != "no"])
-AC_SUBST(NUMACTL_CFLAGS)
-AC_SUBST(NUMACTL_LIBS)
+AM_CONDITIONAL([HAVE_NUMACTL], [test "$with_numactl" != "no"])
+AC_SUBST([NUMACTL_CFLAGS])
+AC_SUBST([NUMACTL_LIBS])
dnl virsh libraries
AC_CHECK_HEADERS([readline/readline.h])
# Check for readline.
-AC_CHECK_LIB(readline, readline,
+AC_CHECK_LIB([readline], [readline],
[lv_use_readline=yes; VIRSH_LIBS="$VIRSH_LIBS -lreadline"],
[lv_use_readline=no])
@@ -589,7 +589,7 @@
# Now, check for -lreadline again, also using $LIBS.
# Note: this time we use a different function, so that
# we don't get a cached "no" result.
- AC_CHECK_LIB(readline, rl_initialize,
+ AC_CHECK_LIB([readline], [rl_initialize],
[lv_use_readline=yes
VIRSH_LIBS="$VIRSH_LIBS -lreadline $LIBS"],,
[$LIBS])
@@ -607,29 +607,29 @@
else
READLINE_CFLAGS=
fi
-AC_SUBST(READLINE_CFLAGS)
-AC_SUBST(VIRSH_LIBS)
+AC_SUBST([READLINE_CFLAGS])
+AC_SUBST([VIRSH_LIBS])
-AC_SUBST(WITH_XEN)
-AC_SUBST(LIBVIRT_FEATURES)
+AC_SUBST([WITH_XEN])
+AC_SUBST([LIBVIRT_FEATURES])
dnl
dnl Storage driver checks
dnl
-AC_ARG_WITH(storage-fs,
+AC_ARG_WITH([storage-fs],
[ --with-storage-fs with FileSystem backend for the storage driver (on)],[],[with_storage_fs=check])
-AC_ARG_WITH(storage-lvm,
+AC_ARG_WITH([storage-lvm],
[ --with-storage-lvm with LVM backend for the storage driver (on)],[],[with_storage_lvm=check])
-AC_ARG_WITH(storage-iscsi,
+AC_ARG_WITH([storage-iscsi],
[ --with-storage-iscsi with iSCSI backend for the storage driver (on)],[],[with_storage_iscsi=check])
-AC_ARG_WITH(storage-disk,
+AC_ARG_WITH([storage-disk],
[ --with-storage-disk with GPartd Disk backend for the storage driver (on)],[],[with_storage_disk=check])
if test "$with_storage_fs" = "yes" -o "$with_storage_fs" = "check"; then
- AC_PATH_PROG(MOUNT, [mount], [], [$PATH:/sbin:/usr/sbin])
- AC_PATH_PROG(UMOUNT, [umount], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([MOUNT], [mount], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([UMOUNT], [umount], [], [$PATH:/sbin:/usr/sbin])
if test "$with_storage_fs" = "yes" ; then
if test -z "$MOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
if test -z "$UMOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
@@ -641,41 +641,41 @@
fi
if test "$with_storage_fs" = "yes" ; then
- AC_DEFINE_UNQUOTED(WITH_STORAGE_FS, 1, [whether FS backend for storage driver is enabled])
+ AC_DEFINE_UNQUOTED([WITH_STORAGE_FS], 1, [whether FS backend for storage driver is enabled])
AC_DEFINE_UNQUOTED([MOUNT],["$MOUNT"],
[Location or name of the mount program])
AC_DEFINE_UNQUOTED([UMOUNT],["$UMOUNT"],
[Location or name of the mount program])
fi
fi
-AM_CONDITIONAL(WITH_STORAGE_FS, [test "$with_storage_fs" = "yes"])
+AM_CONDITIONAL([WITH_STORAGE_FS], [test "$with_storage_fs" = "yes"])
-AC_PATH_PROG(QEMU_IMG, [qemu-img], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
+AC_PATH_PROG([QEMU_IMG], [qemu-img], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
if test -n "$QEMU_IMG" ; then
- AC_DEFINE_UNQUOTED(HAVE_QEMU_IMG, 1, [whether qemu-img is available for non-raw files])
+ AC_DEFINE_UNQUOTED([HAVE_QEMU_IMG], 1, [whether qemu-img is available for non-raw files])
AC_DEFINE_UNQUOTED([QEMU_IMG],["$QEMU_IMG"],
[Location or name of the qemu-img program])
fi
-AC_PATH_PROG(QCOW_CREATE, [qcow-create], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
+AC_PATH_PROG([QCOW_CREATE], [qcow-create], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
if test -n "$QCOW_CREATE" ; then
- AC_DEFINE_UNQUOTED(HAVE_QCOW_CREATE, 1, [whether qcow-create is available for non-raw files])
+ AC_DEFINE_UNQUOTED([HAVE_QCOW_CREATE], 1, [whether qcow-create is available for non-raw files])
AC_DEFINE_UNQUOTED([QCOW_CREATE],["$QCOW_CREATE"],
[Location or name of the qcow-create program])
fi
if test "$with_storage_lvm" = "yes" -o "$with_storage_lvm" = "check"; then
- AC_PATH_PROG(PVCREATE, [pvcreate], [], [$PATH:/sbin:/usr/sbin])
- AC_PATH_PROG(VGCREATE, [vgcreate], [], [$PATH:/sbin:/usr/sbin])
- AC_PATH_PROG(LVCREATE, [lvcreate], [], [$PATH:/sbin:/usr/sbin])
- AC_PATH_PROG(PVREMOVE, [pvremove], [], [$PATH:/sbin:/usr/sbin])
- AC_PATH_PROG(VGREMOVE, [vgremove], [], [$PATH:/sbin:/usr/sbin])
- AC_PATH_PROG(LVREMOVE, [lvremove], [], [$PATH:/sbin:/usr/sbin])
- AC_PATH_PROG(VGCHANGE, [vgchange], [], [$PATH:/sbin:/usr/sbin])
- AC_PATH_PROG(PVS, [pvs], [], [$PATH:/sbin:/usr/sbin])
- AC_PATH_PROG(VGS, [vgs], [], [$PATH:/sbin:/usr/sbin])
- AC_PATH_PROG(LVS, [lvs], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([PVCREATE], [pvcreate], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([VGCREATE], [vgcreate], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([LVCREATE], [lvcreate], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([PVREMOVE], [pvremove], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([VGREMOVE], [vgremove], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([LVREMOVE], [lvremove], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([VGCHANGE], [vgchange], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([PVS], [pvs], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([VGS], [vgs], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([LVS], [lvs], [], [$PATH:/sbin:/usr/sbin])
if test "$with_storage_lvm" = "yes" ; then
if test -z "$PVCREATE" ; then AC_MSG_ERROR(We need pvcreate for LVM storage driver) ; fi
@@ -704,7 +704,7 @@
fi
if test "$with_storage_lvm" = "yes" ; then
- AC_DEFINE_UNQUOTED(WITH_STORAGE_LVM, 1, [whether LVM backend for storage driver is enabled])
+ AC_DEFINE_UNQUOTED([WITH_STORAGE_LVM], 1, [whether LVM backend for storage driver is enabled])
AC_DEFINE_UNQUOTED([PVCREATE],["$PVCREATE"],[Location of pvcreate program])
AC_DEFINE_UNQUOTED([VGCREATE],["$VGCREATE"],[Location of vgcreate program])
AC_DEFINE_UNQUOTED([LVCREATE],["$LVCREATE"],[Location of lvcreate program])
@@ -717,12 +717,12 @@
AC_DEFINE_UNQUOTED([LVS],["$LVS"],[Location of lvs program])
fi
fi
-AM_CONDITIONAL(WITH_STORAGE_LVM, [test "$with_storage_lvm" = "yes"])
+AM_CONDITIONAL([WITH_STORAGE_LVM], [test "$with_storage_lvm" = "yes"])
if test "$with_storage_iscsi" = "yes" -o "$with_storage_iscsi" = "check"; then
- AC_PATH_PROG(ISCSIADM, [iscsiadm], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([ISCSIADM], [iscsiadm], [], [$PATH:/sbin:/usr/sbin])
if test "$with_storage_iscsi" = "yes" ; then
if test -z "$ISCSIADM" ; then AC_MSG_ERROR(We need iscsiadm for iSCSI storage driver) ; fi
else
@@ -732,18 +732,18 @@
fi
if test "$with_storage_iscsi" = "yes" ; then
- AC_DEFINE_UNQUOTED(WITH_STORAGE_ISCSI, 1, [whether iSCSI backend for storage driver is enabled])
+ AC_DEFINE_UNQUOTED([WITH_STORAGE_ISCSI], 1, [whether iSCSI backend for storage driver is enabled])
AC_DEFINE_UNQUOTED([ISCSIADM],["$ISCSIADM"],[Location of iscsiadm program])
fi
fi
-AM_CONDITIONAL(WITH_STORAGE_ISCSI, [test "$with_storage_iscsi" = "yes"])
+AM_CONDITIONAL([WITH_STORAGE_ISCSI], [test "$with_storage_iscsi" = "yes"])
LIBPARTED_CFLAGS=
LIBPARTED_LIBS=
if test "$with_storage_disk" = "yes" -o "$with_storage_disk" = "check"; then
- AC_PATH_PROG(PARTED, [parted], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([PARTED], [parted], [], [$PATH:/sbin:/usr/sbin])
if test -z "$PARTED" ; then with_storage_disk=no ; fi
PARTED_FOUND=yes
@@ -755,9 +755,9 @@
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
PARTED_FOUND=yes
- AC_CHECK_HEADER(parted/parted.h,,[PARTED_FOUND=no])
- AC_CHECK_LIB(uuid, uuid_generate,,[PARTED_FOUND=no])
- AC_CHECK_LIB(parted, ped_device_read,,[PARTED_FOUND=no])
+ AC_CHECK_HEADER([parted/parted.h],,[PARTED_FOUND=no])
+ AC_CHECK_LIB([uuid], [uuid_generate],,[PARTED_FOUND=no])
+ AC_CHECK_LIB([parted], [ped_device_read],,[PARTED_FOUND=no])
LIBPARTED_LIBS="-luuid -lparted"
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
@@ -774,13 +774,13 @@
fi
if test "$with_storage_disk" = "yes"; then
- AC_DEFINE_UNQUOTED(WITH_STORAGE_DISK, 1, [whether Disk backend for storage driver is enabled])
+ AC_DEFINE_UNQUOTED([WITH_STORAGE_DISK], 1, [whether Disk backend for storage driver is enabled])
AC_DEFINE_UNQUOTED([PARTED],["$PARTED"], [Location or name of the parted program])
fi
fi
-AM_CONDITIONAL(WITH_STORAGE_DISK, [test "$with_storage_disk" = "yes"])
-AC_SUBST(LIBPARTED_CFLAGS)
-AC_SUBST(LIBPARTED_LIBS)
+AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"])
+AC_SUBST([LIBPARTED_CFLAGS])
+AC_SUBST([LIBPARTED_LIBS])
dnl
@@ -808,7 +808,7 @@
echo Found python in environment PYTHON=$PYTHON
with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
else
- AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
+ AC_PATH_PROG([PYTHON], [python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5])
fi
fi
fi
@@ -853,11 +853,11 @@
else
PYTHON=
fi
-AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
-AC_SUBST(pythondir)
-AC_SUBST(PYTHON_VERSION)
-AC_SUBST(PYTHON_INCLUDES)
-AC_SUBST(PYTHON_SITE_PACKAGES)
+AM_CONDITIONAL([WITH_PYTHON], test "$PYTHON_INCLUDES" != "")
+AC_SUBST([pythondir])
+AC_SUBST([PYTHON_VERSION])
+AC_SUBST([PYTHON_INCLUDES])
+AC_SUBST([PYTHON_SITE_PACKAGES])
AC_MSG_CHECKING([whether this host is running a Xen kernel])
RUNNING_XEN=
@@ -879,9 +879,9 @@
fi
AC_MSG_RESULT($RUNNING_XEND)
-AM_CONDITIONAL(ENABLE_XEN_TESTS, [test "$RUNNING_XEN" != "no" -a "$RUNNING_XEND" != "no"])
+AM_CONDITIONAL([ENABLE_XEN_TESTS], [test "$RUNNING_XEN" != "no" -a "$RUNNING_XEND" != "no"])
-AC_ARG_ENABLE(test-coverage,
+AC_ARG_ENABLE([test-coverage],
[ --enable-test-coverage turn on code coverage instrumentation],
[case "${enableval}" in
yes|no) ;;
@@ -899,7 +899,7 @@
dnl Enable building the proxy?
-AC_ARG_WITH(xen-proxy,
+AC_ARG_WITH([xen-proxy],
[ --with-xen-proxy add XEN setuid proxy support (on)],[],[with_xen_proxy=auto])
AC_MSG_CHECKING([if Xen setuid proxy is needed])
@@ -915,13 +915,13 @@
fi
AC_MSG_RESULT([$with_xen_proxy])
-AM_CONDITIONAL(WITH_PROXY,[test "$with_xen_proxy" = "yes"])
+AM_CONDITIONAL([WITH_PROXY],[test "$with_xen_proxy" = "yes"])
if test "$with_xen_proxy" = "yes"; then
- AC_DEFINE(WITH_PROXY, 1, [Whether Xen proxy is enabled])
+ AC_DEFINE([WITH_PROXY], 1, [Whether Xen proxy is enabled])
fi
dnl Enable building libvirtd?
-AM_CONDITIONAL(WITH_LIBVIRTD,[test "x$with_libvirtd" = "xyes"])
+AM_CONDITIONAL([WITH_LIBVIRTD],[test "x$with_libvirtd" = "xyes"])
dnl Check for gettext
AM_GNU_GETTEXT_VERSION([0.14.1])
@@ -952,10 +952,10 @@
MINGW_EXTRA_LDFLAGS="-no-undefined"
;;
esac
-AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
-AC_SUBST(CYGWIN_EXTRA_LIBADD)
-AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
-AC_SUBST(MINGW_EXTRA_LDFLAGS)
+AC_SUBST([CYGWIN_EXTRA_LDFLAGS])
+AC_SUBST([CYGWIN_EXTRA_LIBADD])
+AC_SUBST([CYGWIN_EXTRA_PYTHON_LIBADD])
+AC_SUBST([MINGW_EXTRA_LDFLAGS])
AC_SYS_LARGEFILE
@@ -964,7 +964,7 @@
# in which .o files will be created.
test "$enable_shared" = no && lt_cv_objdir=.
LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.}
-AC_SUBST(LV_LIBTOOL_OBJDIR)
+AC_SUBST([LV_LIBTOOL_OBJDIR])
# very annoying
rm -f COPYING
--
|: Red Hat, Engineering, Boston -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 :|
3
4
This patch includes NUMA topology info in the QEMU driver capabilities
XML output. It also implements the free memory driver APIs. This is done
with the LGPL'd numactl library. The configure script probes for it and
only enables this functionality if it is found. The numactl library has
been around for quite a while - RHEL-3 vintage at least
configure.in | 39 ++++++++++++++++++++++++++++++
libvirt.spec.in | 3 ++
src/Makefile.am | 2 +
src/qemu_conf.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/qemu_driver.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 178 insertions(+)
Regards,
Daniel
Index: src/qemu_conf.c
===================================================================
RCS file: /data/cvs/libvirt/src/qemu_conf.c,v
retrieving revision 1.64
diff -u -p -r1.64 qemu_conf.c
--- src/qemu_conf.c 15 May 2008 20:07:34 -0000 1.64
+++ src/qemu_conf.c 15 May 2008 21:07:42 -0000
@@ -42,6 +42,10 @@
#include <libxml/xpath.h>
#include <libxml/uri.h>
+#if HAVE_NUMACTL
+#include <numa.h>
+#endif
+
#include "libvirt/virterror.h"
#include "qemu_conf.h"
@@ -49,6 +53,7 @@
#include "buf.h"
#include "conf.h"
#include "util.h"
+#include "memory.h"
#include <verify.h>
#define qemudLog(level, msg...) fprintf(stderr, msg)
@@ -389,6 +394,67 @@ qemudCapsInitGuest(virCapsPtr caps,
return 0;
}
+#if HAVE_NUMACTL
+#define MAX_CPUS 4096
+#define MAX_CPUS_MASK_SIZE (sizeof(unsigned long))
+#define MAX_CPUS_MASK_LEN (MAX_CPUS / MAX_CPUS_MASK_SIZE)
+#define MAX_CPUS_MASK_BYTES (MAX_CPUS / 8)
+static int
+qemudCapsInitNUMA(virCapsPtr caps)
+{
+ int n, i;
+ unsigned long *mask = NULL;
+ int ncpus;
+ int *cpus = NULL;
+ int ret = -1;
+
+ fprintf(stderr, "Add numa\n");
+
+ if (numa_available() < 0)
+ return 0;
+
+ fprintf(stderr, "Start\n");
+ if (VIR_ALLOC_N(mask, MAX_CPUS_MASK_LEN) < 0)
+ goto cleanup;
+
+ for (n = 0 ; n <= numa_max_node() ; n++) {
+ fprintf(stderr, "Do node %d\n", n);
+
+ if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_BYTES) < 0)
+ goto cleanup;
+
+ for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)
+ if ((mask[(i / MAX_CPUS_MASK_SIZE)] >> (i % MAX_CPUS_MASK_SIZE)) & 1)
+ ncpus++;
+
+ if (VIR_ALLOC_N(cpus, ncpus) < 0)
+ goto cleanup;
+
+ for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)
+ if ((mask[(i / MAX_CPUS_MASK_SIZE)] >> (i % MAX_CPUS_MASK_SIZE)) & 1)
+ cpus[ncpus++] = i;
+
+ fprintf(stderr, "Do node %d %d\n", n, ncpus);
+ if (virCapabilitiesAddHostNUMACell(caps,
+ n,
+ ncpus,
+ cpus) < 0)
+ goto cleanup;
+
+ VIR_FREE(cpus);
+ }
+
+ ret = 0;
+
+cleanup:
+ VIR_FREE(cpus);
+ VIR_FREE(mask);
+ return ret;
+}
+#else
+static int qemudCapsInitNUMA(virCapsPtr caps ATTRIBUTE_UNUSED) { return 0; }
+#endif
+
virCapsPtr qemudCapsInit(void) {
struct utsname utsname;
virCapsPtr caps;
@@ -401,6 +467,9 @@ virCapsPtr qemudCapsInit(void) {
0, 0)) == NULL)
goto no_memory;
+ if (qemudCapsInitNUMA(caps) < 0)
+ goto no_memory;
+
for (i = 0 ; i < (sizeof(arch_info_hvm)/sizeof(arch_info_hvm[0])) ; i++)
if (qemudCapsInitGuest(caps,
utsname.machine,
Index: src/qemu_driver.c
===================================================================
RCS file: /data/cvs/libvirt/src/qemu_driver.c,v
retrieving revision 1.74
diff -u -p -r1.74 qemu_driver.c
--- src/qemu_driver.c 15 May 2008 16:11:40 -0000 1.74
+++ src/qemu_driver.c 15 May 2008 21:07:50 -0000
@@ -47,6 +47,10 @@
#include <sys/wait.h>
#include <libxml/uri.h>
+#if HAVE_NUMACTL
+#include <numa.h>
+#endif
+
#include "libvirt/virterror.h"
#include "event.h"
@@ -1605,6 +1609,62 @@ static char *qemudGetCapabilities(virCon
}
+#if HAVE_NUMACTL
+static int
+qemudNodeGetCellsFreeMemory(virConnectPtr conn,
+ unsigned long long *freeMems,
+ int startCell,
+ int maxCells)
+{
+ int n, lastCell, numCells;
+ fprintf(stderr, "Foo %d %d\n", startCell, maxCells);
+ if (numa_available() < 0) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_SUPPORT,
+ "%s", _("NUMA not supported on this host"));
+ return -1;
+ }
+ lastCell = startCell + maxCells - 1;
+ if (lastCell > numa_max_node())
+ lastCell = numa_max_node();
+
+ for (numCells = 0, n = startCell ; n <= lastCell ; n++) {
+ long long mem;
+ if (numa_node_size64(n, &mem) < 0) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Failed to query NUMA free memory"));
+ return -1;
+ }
+ fprintf(stderr, "baro %d %llu\n", n, mem);
+ freeMems[numCells++] = mem;
+ }
+ return numCells;
+}
+
+static unsigned long long
+qemudNodeGetFreeMemory (virConnectPtr conn)
+{
+ unsigned long long freeMem = 0;
+ int n;
+ if (numa_available() < 0) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_SUPPORT,
+ "%s", _("NUMA not supported on this host"));
+ return -1;
+ }
+
+ for (n = 0 ; n <= numa_max_node() ; n++) {
+ long long mem;
+ if (numa_node_size64(n, &mem) < 0) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Failed to query NUMA free memory"));
+ return -1;
+ }
+ freeMem += mem;
+ }
+
+ return freeMem;
+}
+
+#endif
static int qemudGetProcessInfo(unsigned long long *cpuTime, int pid) {
char proc[PATH_MAX];
@@ -3168,8 +3228,13 @@ static virDriver qemuDriver = {
NULL, /* domainMigrateFinish */
qemudDomainBlockStats, /* domainBlockStats */
qemudDomainInterfaceStats, /* domainInterfaceStats */
+#if HAVE_NUMACTL
+ qemudNodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
+ qemudNodeGetFreeMemory, /* getFreeMemory */
+#else
NULL, /* nodeGetCellsFreeMemory */
NULL, /* getFreeMemory */
+#endif
};
static virNetworkDriver qemuNetworkDriver = {
Index: src/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/src/Makefile.am,v
retrieving revision 1.79
diff -u -p -r1.79 Makefile.am
--- src/Makefile.am 29 Apr 2008 15:38:13 -0000 1.79
+++ src/Makefile.am 15 May 2008 21:07:57 -0000
@@ -9,6 +9,7 @@ INCLUDES = \
$(GNUTLS_CFLAGS) \
$(SASL_CFLAGS) \
$(SELINUX_CFLAGS) \
+ $(NUMACTL_CFLAGS) \
-DBINDIR=\""$(libexecdir)"\" \
-DSBINDIR=\""$(sbindir)"\" \
-DSYSCONF_DIR="\"$(sysconfdir)\"" \
@@ -100,6 +101,7 @@ endif
libvirt_la_SOURCES = $(CLIENT_SOURCES) $(SERVER_SOURCES)
libvirt_la_LIBADD = $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) $(SELINUX_LIBS) \
+ $(NUMACTL_LIBS) \
@CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \
-version-info @LIBVIRT_VERSION_INFO@ \
Index: configure.in
===================================================================
RCS file: /data/cvs/libvirt/configure.in,v
retrieving revision 1.143
diff -u -p -r1.143 configure.in
--- configure.in 5 May 2008 19:58:56 -0000 1.143
+++ configure.in 15 May 2008 21:08:05 -0000
@@ -534,6 +534,40 @@ AM_CONDITIONAL(HAVE_SELINUX, [test "$wit
AC_SUBST(SELINUX_CFLAGS)
AC_SUBST(SELINUX_LIBS)
+dnl NUMA lib
+AC_ARG_WITH(numactl,
+ [ --with-numactl use numactl for host topology info],
+ [],
+ [with_numactl=check])
+
+NUMACTL_CFLAGS=
+NUMACTL_LIBS=
+if test "$with_qemu" = "yes" -a "$with_numactl" != "no"; then
+ old_cflags="$CFLAGS"
+ old_libs="$LIBS"
+ if test "$with_numactl" = "check"; then
+ AC_CHECK_HEADER([numa.h],[],[with_numactl=no])
+ AC_CHECK_LIB(numa, numa_available,[],[with_numactl=no])
+ if test "$with_numactl" != "no"; then
+ with_numactl="yes"
+ fi
+ else
+ AC_CHECK_HEADER([numa.h],[],
+ [AC_MSG_ERROR([You must install the numactl development package in order to compile libvirt])])
+ AC_CHECK_LIB(numa, numa_available,[],
+ [AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt])])
+ fi
+ CFLAGS="$old_cflags"
+ LIBS="$old_libs"
+fi
+if test "$with_numactl" = "yes"; then
+ NUMACTL_LIBS="-lnuma"
+ AC_DEFINE_UNQUOTED(HAVE_NUMACTL, 1, [whether Numactl is available for security])
+fi
+AM_CONDITIONAL(HAVE_NUMACTL, [test "$with_numactl" != "no"])
+AC_SUBST(NUMACTL_CFLAGS)
+AC_SUBST(NUMACTL_LIBS)
+
dnl virsh libraries
AC_CHECK_HEADERS([readline/readline.h])
@@ -1001,6 +1035,11 @@ AC_MSG_NOTICE([ selinux: $SELINUX_CFLAG
else
AC_MSG_NOTICE([ selinux: no])
fi
+if test "$with_numactl" = "yes" ; then
+AC_MSG_NOTICE([ numactl: $NUMACTL_CFLAGS $NUMACTL_LIBS])
+else
+AC_MSG_NOTICE([ numactl: no])
+fi
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Miscellaneous])
AC_MSG_NOTICE([])
Index: libvirt.spec.in
===================================================================
RCS file: /data/cvs/libvirt/libvirt.spec.in,v
retrieving revision 1.83
diff -u -p -r1.83 libvirt.spec.in
--- libvirt.spec.in 8 Apr 2008 16:45:57 -0000 1.83
+++ libvirt.spec.in 15 May 2008 21:08:14 -0000
@@ -67,6 +67,9 @@ BuildRequires: dnsmasq
BuildRequires: bridge-utils
BuildRequires: qemu
BuildRequires: cyrus-sasl-devel
+%if %{with_qemu}
+BuildRequires: numactl-devel
+%endif
%if %{with_polkit}
BuildRequires: PolicyKit-devel >= 0.6
%endif
--
|: Red Hat, Engineering, Boston -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 :|
3
6
For some reason the virNodeGetFreeMemroy and virNodeGetCellsFreeMemory
NUMA APIs were never added to the remote driver. THis patch fixes that.
It also updates the 2 perl scripts which post-process the RPC files to
not insert TABs, since we'd previously removed them from all the generated
files. Finally, the remote_protocol.x has TAB -> SPACE conversion since
we missed that first time around
qemud/remote.c | 47 +
qemud/remote_dispatch_localvars.h | 3
qemud/remote_dispatch_proc_switch.h | 15
qemud/remote_dispatch_prototypes.h | 2
qemud/remote_generate_stubs.pl | 20
qemud/remote_protocol.c | 30 +
qemud/remote_protocol.h | 918 ++++++++++++++++++------------------
qemud/remote_protocol.x | 21
qemud/rpcgen_fix.pl | 4
src/remote_internal.c | 55 ++
10 files changed, 657 insertions(+), 458 deletions(-)
Regards,
Daniel
Index: src/remote_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/remote_internal.c,v
retrieving revision 1.74
diff -u -p -r1.74 remote_internal.c
--- src/remote_internal.c 15 May 2008 14:21:34 -0000 1.74
+++ src/remote_internal.c 15 May 2008 21:07:22 -0000
@@ -1329,6 +1329,58 @@ remoteGetCapabilities (virConnectPtr con
}
static int
+remoteNodeGetCellsFreeMemory(virConnectPtr conn,
+ unsigned long long *freeMems,
+ int startCell,
+ int maxCells)
+{
+ remote_node_get_cells_free_memory_args args;
+ remote_node_get_cells_free_memory_ret ret;
+ int i;
+ GET_PRIVATE (conn, -1);
+
+ if (maxCells > REMOTE_NODE_MAX_CELLS) {
+ errorf (conn, VIR_ERR_RPC,
+ _("too many NUMA cells: %d > %d"),
+ maxCells,
+ REMOTE_NODE_MAX_CELLS);
+ return -1;
+ }
+
+ args.startCell = startCell;
+ args.maxCells = maxCells;
+
+ memset (&ret, 0, sizeof ret);
+ if (call (conn, priv, 0, REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY,
+ (xdrproc_t) xdr_remote_node_get_cells_free_memory_args, (char *)&args,
+ (xdrproc_t) xdr_remote_node_get_cells_free_memory_ret, (char *)&ret) == -1)
+ return -1;
+
+ for (i = 0 ; i < ret.freeMems.freeMems_len ; i++)
+ freeMems[i] = ret.freeMems.freeMems_val[i];
+
+ xdr_free((xdrproc_t) xdr_remote_node_get_cells_free_memory_ret, (char *) &ret);
+
+ return ret.freeMems.freeMems_len;
+}
+
+static unsigned long long
+remoteNodeGetFreeMemory (virConnectPtr conn)
+{
+ remote_node_get_free_memory_ret ret;
+ GET_PRIVATE (conn, -1);
+
+ memset (&ret, 0, sizeof ret);
+ if (call (conn, priv, 0, REMOTE_PROC_NODE_GET_FREE_MEMORY,
+ (xdrproc_t) xdr_void, NULL,
+ (xdrproc_t) xdr_remote_node_get_free_memory_ret, (char *)&ret) == -1)
+ return 0;
+
+ return ret.freeMem;
+}
+
+
+static int
remoteListDomains (virConnectPtr conn, int *ids, int maxids)
{
int i;
@@ -4728,7 +4780,8 @@ static virDriver driver = {
.domainMigrateFinish = remoteDomainMigrateFinish,
.domainBlockStats = remoteDomainBlockStats,
.domainInterfaceStats = remoteDomainInterfaceStats,
- .nodeGetCellsFreeMemory = NULL,
+ .nodeGetCellsFreeMemory = remoteNodeGetCellsFreeMemory,
+ .getFreeMemory = remoteNodeGetFreeMemory,
};
static virNetworkDriver network_driver = {
Index: qemud/remote.c
===================================================================
RCS file: /data/cvs/libvirt/qemud/remote.c,v
retrieving revision 1.31
diff -u -p -r1.31 remote.c
--- qemud/remote.c 15 May 2008 06:12:32 -0000 1.31
+++ qemud/remote.c 15 May 2008 21:07:31 -0000
@@ -596,6 +596,53 @@ remoteDispatchGetCapabilities (struct qe
}
static int
+remoteDispatchNodeGetCellsFreeMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
+ struct qemud_client *client,
+ remote_message_header *req,
+ remote_node_get_cells_free_memory_args *args,
+ remote_node_get_cells_free_memory_ret *ret)
+{
+ CHECK_CONN(client);
+
+ if (args->maxCells > REMOTE_NODE_MAX_CELLS) {
+ remoteDispatchError (client, req,
+ "%s", _("maxCells > REMOTE_NODE_MAX_CELLS"));
+ return -2;
+ }
+
+ /* Allocate return buffer. */
+ ret->freeMems.freeMems_val = calloc (args->maxCells, sizeof (*(ret->freeMems.freeMems_val)));
+
+ ret->freeMems.freeMems_len = virNodeGetCellsFreeMemory(client->conn,
+ (unsigned long long *)ret->freeMems.freeMems_val,
+ args->startCell,
+ args->maxCells);
+ if (ret->freeMems.freeMems_len == 0)
+ return -1;
+
+ return 0;
+}
+
+
+static int
+remoteDispatchNodeGetFreeMemory (struct qemud_server *server ATTRIBUTE_UNUSED,
+ struct qemud_client *client,
+ remote_message_header *req,
+ void *args ATTRIBUTE_UNUSED,
+ remote_node_get_free_memory_ret *ret)
+{
+ unsigned long long freeMem;
+ CHECK_CONN(client);
+
+ freeMem = virNodeGetFreeMemory(client->conn);
+ if (freeMem == 0) return -1;
+
+ ret->freeMem = freeMem;
+ return 0;
+}
+
+
+static int
remoteDispatchDomainGetSchedulerType (struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client,
remote_message_header *req,
Index: qemud/remote_dispatch_localvars.h
===================================================================
RCS file: /data/cvs/libvirt/qemud/remote_dispatch_localvars.h,v
retrieving revision 1.9
diff -u -p -r1.9 remote_dispatch_localvars.h
--- qemud/remote_dispatch_localvars.h 20 Feb 2008 15:22:35 -0000 1.9
+++ qemud/remote_dispatch_localvars.h 15 May 2008 21:07:31 -0000
@@ -98,6 +98,8 @@ remote_domain_save_args lv_remote_domain
remote_domain_migrate_prepare_args lv_remote_domain_migrate_prepare_args;
remote_domain_migrate_prepare_ret lv_remote_domain_migrate_prepare_ret;
remote_domain_undefine_args lv_remote_domain_undefine_args;
+remote_node_get_cells_free_memory_args lv_remote_node_get_cells_free_memory_args;
+remote_node_get_cells_free_memory_ret lv_remote_node_get_cells_free_memory_ret;
remote_domain_get_scheduler_type_args lv_remote_domain_get_scheduler_type_args;
remote_domain_get_scheduler_type_ret lv_remote_domain_get_scheduler_type_ret;
remote_get_version_ret lv_remote_get_version_ret;
@@ -122,6 +124,7 @@ remote_storage_pool_undefine_args lv_rem
remote_domain_set_autostart_args lv_remote_domain_set_autostart_args;
remote_storage_pool_get_autostart_args lv_remote_storage_pool_get_autostart_args;
remote_storage_pool_get_autostart_ret lv_remote_storage_pool_get_autostart_ret;
+remote_node_get_free_memory_ret lv_remote_node_get_free_memory_ret;
remote_storage_vol_get_path_args lv_remote_storage_vol_get_path_args;
remote_storage_vol_get_path_ret lv_remote_storage_vol_get_path_ret;
remote_domain_lookup_by_id_args lv_remote_domain_lookup_by_id_args;
Index: qemud/remote_dispatch_proc_switch.h
===================================================================
RCS file: /data/cvs/libvirt/qemud/remote_dispatch_proc_switch.h,v
retrieving revision 1.10
diff -u -p -r1.10 remote_dispatch_proc_switch.h
--- qemud/remote_dispatch_proc_switch.h 10 Apr 2008 16:54:54 -0000 1.10
+++ qemud/remote_dispatch_proc_switch.h 15 May 2008 21:07:31 -0000
@@ -491,6 +491,21 @@ case REMOTE_PROC_NETWORK_UNDEFINE:
args = (char *) &lv_remote_network_undefine_args;
memset (&lv_remote_network_undefine_args, 0, sizeof lv_remote_network_undefine_args);
break;
+case REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY:
+ fn = (dispatch_fn) remoteDispatchNodeGetCellsFreeMemory;
+ args_filter = (xdrproc_t) xdr_remote_node_get_cells_free_memory_args;
+ args = (char *) &lv_remote_node_get_cells_free_memory_args;
+ memset (&lv_remote_node_get_cells_free_memory_args, 0, sizeof lv_remote_node_get_cells_free_memory_args);
+ ret_filter = (xdrproc_t) xdr_remote_node_get_cells_free_memory_ret;
+ ret = (char *) &lv_remote_node_get_cells_free_memory_ret;
+ memset (&lv_remote_node_get_cells_free_memory_ret, 0, sizeof lv_remote_node_get_cells_free_memory_ret);
+ break;
+case REMOTE_PROC_NODE_GET_FREE_MEMORY:
+ fn = (dispatch_fn) remoteDispatchNodeGetFreeMemory;
+ ret_filter = (xdrproc_t) xdr_remote_node_get_free_memory_ret;
+ ret = (char *) &lv_remote_node_get_free_memory_ret;
+ memset (&lv_remote_node_get_free_memory_ret, 0, sizeof lv_remote_node_get_free_memory_ret);
+ break;
case REMOTE_PROC_NODE_GET_INFO:
fn = (dispatch_fn) remoteDispatchNodeGetInfo;
ret_filter = (xdrproc_t) xdr_remote_node_get_info_ret;
Index: qemud/remote_dispatch_prototypes.h
===================================================================
RCS file: /data/cvs/libvirt/qemud/remote_dispatch_prototypes.h,v
retrieving revision 1.10
diff -u -p -r1.10 remote_dispatch_prototypes.h
--- qemud/remote_dispatch_prototypes.h 20 Feb 2008 15:22:35 -0000 1.10
+++ qemud/remote_dispatch_prototypes.h 15 May 2008 21:07:31 -0000
@@ -67,6 +67,8 @@ static int remoteDispatchNetworkLookupBy
static int remoteDispatchNetworkLookupByUuid (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_lookup_by_uuid_args *args, remote_network_lookup_by_uuid_ret *ret);
static int remoteDispatchNetworkSetAutostart (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_set_autostart_args *args, void *ret);
static int remoteDispatchNetworkUndefine (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_network_undefine_args *args, void *ret);
+static int remoteDispatchNodeGetCellsFreeMemory (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_node_get_cells_free_memory_args *args, remote_node_get_cells_free_memory_ret *ret);
+static int remoteDispatchNodeGetFreeMemory (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_node_get_free_memory_ret *ret);
static int remoteDispatchNodeGetInfo (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_node_get_info_ret *ret);
static int remoteDispatchNumOfDefinedDomains (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_num_of_defined_domains_ret *ret);
static int remoteDispatchNumOfDefinedNetworks (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_num_of_defined_networks_ret *ret);
Index: qemud/remote_generate_stubs.pl
===================================================================
RCS file: /data/cvs/libvirt/qemud/remote_generate_stubs.pl,v
retrieving revision 1.2
diff -u -p -r1.2 remote_generate_stubs.pl
--- qemud/remote_generate_stubs.pl 5 Dec 2007 15:34:05 -0000 1.2
+++ qemud/remote_generate_stubs.pl 15 May 2008 21:07:31 -0000
@@ -84,8 +84,8 @@ if ($opt_d) {
my @keys = sort (keys %calls);
foreach (@keys) {
print "$_:\n";
- print "\tname $calls{$_}->{name} ($calls{$_}->{ProcName})\n";
- print "\t$calls{$_}->{args} -> $calls{$_}->{ret}\n";
+ print " name $calls{$_}->{name} ($calls{$_}->{ProcName})\n";
+ print " $calls{$_}->{args} -> $calls{$_}->{ret}\n";
}
}
@@ -117,18 +117,18 @@ elsif ($opt_w) {
my @keys = sort (keys %calls);
foreach (@keys) {
print "case REMOTE_PROC_$calls{$_}->{UC_NAME}:\n";
- print "\tfn = (dispatch_fn) remoteDispatch$calls{$_}->{ProcName};\n";
+ print " fn = (dispatch_fn) remoteDispatch$calls{$_}->{ProcName};\n";
if ($calls{$_}->{args} ne "void") {
- print "\targs_filter = (xdrproc_t) xdr_$calls{$_}->{args};\n";
- print "\targs = (char *) &lv_$calls{$_}->{args};\n";
- print "\tmemset (&lv_$calls{$_}->{args}, 0, sizeof lv_$calls{$_}->{args});\n"
+ print " args_filter = (xdrproc_t) xdr_$calls{$_}->{args};\n";
+ print " args = (char *) &lv_$calls{$_}->{args};\n";
+ print " memset (&lv_$calls{$_}->{args}, 0, sizeof lv_$calls{$_}->{args});\n"
}
if ($calls{$_}->{ret} ne "void") {
- print "\tret_filter = (xdrproc_t) xdr_$calls{$_}->{ret};\n";
- print "\tret = (char *) &lv_$calls{$_}->{ret};\n";
- print "\tmemset (&lv_$calls{$_}->{ret}, 0, sizeof lv_$calls{$_}->{ret});\n"
+ print " ret_filter = (xdrproc_t) xdr_$calls{$_}->{ret};\n";
+ print " ret = (char *) &lv_$calls{$_}->{ret};\n";
+ print " memset (&lv_$calls{$_}->{ret}, 0, sizeof lv_$calls{$_}->{ret});\n"
}
- print "\tbreak;\n";
+ print " break;\n";
}
}
Index: qemud/remote_protocol.c
===================================================================
RCS file: /data/cvs/libvirt/qemud/remote_protocol.c,v
retrieving revision 1.10
diff -u -p -r1.10 remote_protocol.c
--- qemud/remote_protocol.c 10 Apr 2008 16:54:54 -0000 1.10
+++ qemud/remote_protocol.c 15 May 2008 21:07:31 -0000
@@ -387,6 +387,36 @@ xdr_remote_get_capabilities_ret (XDR *xd
}
bool_t
+xdr_remote_node_get_cells_free_memory_args (XDR *xdrs, remote_node_get_cells_free_memory_args *objp)
+{
+
+ if (!xdr_int (xdrs, &objp->startCell))
+ return FALSE;
+ if (!xdr_int (xdrs, &objp->maxCells))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_remote_node_get_cells_free_memory_ret (XDR *xdrs, remote_node_get_cells_free_memory_ret *objp)
+{
+
+ if (!xdr_array (xdrs, (char **)&objp->freeMems.freeMems_val, (u_int *) &objp->freeMems.freeMems_len, REMOTE_NODE_MAX_CELLS,
+ sizeof (quad_t), (xdrproc_t) xdr_quad_t))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
+xdr_remote_node_get_free_memory_ret (XDR *xdrs, remote_node_get_free_memory_ret *objp)
+{
+
+ if (!xdr_quad_t (xdrs, &objp->freeMem))
+ return FALSE;
+ return TRUE;
+}
+
+bool_t
xdr_remote_domain_get_scheduler_type_args (XDR *xdrs, remote_domain_get_scheduler_type_args *objp)
{
Index: qemud/remote_protocol.h
===================================================================
RCS file: /data/cvs/libvirt/qemud/remote_protocol.h,v
retrieving revision 1.11
diff -u -p -r1.11 remote_protocol.h
--- qemud/remote_protocol.h 10 Apr 2008 16:54:54 -0000 1.11
+++ qemud/remote_protocol.h 15 May 2008 21:07:31 -0000
@@ -30,34 +30,35 @@ typedef remote_nonnull_string *remote_st
#define REMOTE_STORAGE_POOL_NAME_LIST_MAX 256
#define REMOTE_STORAGE_VOL_NAME_LIST_MAX 1024
#define REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX 16
+#define REMOTE_NODE_MAX_CELLS 1024
#define REMOTE_AUTH_SASL_DATA_MAX 65536
#define REMOTE_AUTH_TYPE_LIST_MAX 20
typedef char remote_uuid[VIR_UUID_BUFLEN];
struct remote_nonnull_domain {
- remote_nonnull_string name;
- remote_uuid uuid;
- int id;
+ remote_nonnull_string name;
+ remote_uuid uuid;
+ int id;
};
typedef struct remote_nonnull_domain remote_nonnull_domain;
struct remote_nonnull_network {
- remote_nonnull_string name;
- remote_uuid uuid;
+ remote_nonnull_string name;
+ remote_uuid uuid;
};
typedef struct remote_nonnull_network remote_nonnull_network;
struct remote_nonnull_storage_pool {
- remote_nonnull_string name;
- remote_uuid uuid;
+ remote_nonnull_string name;
+ remote_uuid uuid;
};
typedef struct remote_nonnull_storage_pool remote_nonnull_storage_pool;
struct remote_nonnull_storage_vol {
- remote_nonnull_string pool;
- remote_nonnull_string name;
- remote_nonnull_string key;
+ remote_nonnull_string pool;
+ remote_nonnull_string name;
+ remote_nonnull_string key;
};
typedef struct remote_nonnull_storage_vol remote_nonnull_storage_vol;
@@ -70,1076 +71,1097 @@ typedef remote_nonnull_storage_pool *rem
typedef remote_nonnull_storage_vol *remote_storage_vol;
struct remote_error {
- int code;
- int domain;
- remote_string message;
- int level;
- remote_domain dom;
- remote_string str1;
- remote_string str2;
- remote_string str3;
- int int1;
- int int2;
- remote_network net;
+ int code;
+ int domain;
+ remote_string message;
+ int level;
+ remote_domain dom;
+ remote_string str1;
+ remote_string str2;
+ remote_string str3;
+ int int1;
+ int int2;
+ remote_network net;
};
typedef struct remote_error remote_error;
enum remote_auth_type {
- REMOTE_AUTH_NONE = 0,
- REMOTE_AUTH_SASL = 1,
- REMOTE_AUTH_POLKIT = 2,
+ REMOTE_AUTH_NONE = 0,
+ REMOTE_AUTH_SASL = 1,
+ REMOTE_AUTH_POLKIT = 2,
};
typedef enum remote_auth_type remote_auth_type;
struct remote_vcpu_info {
- u_int number;
- int state;
- u_quad_t cpu_time;
- int cpu;
+ u_int number;
+ int state;
+ u_quad_t cpu_time;
+ int cpu;
};
typedef struct remote_vcpu_info remote_vcpu_info;
struct remote_sched_param_value {
- int type;
- union {
- int i;
- u_int ui;
- quad_t l;
- u_quad_t ul;
- double d;
- int b;
- } remote_sched_param_value_u;
+ int type;
+ union {
+ int i;
+ u_int ui;
+ quad_t l;
+ u_quad_t ul;
+ double d;
+ int b;
+ } remote_sched_param_value_u;
};
typedef struct remote_sched_param_value remote_sched_param_value;
struct remote_sched_param {
- remote_nonnull_string field;
- remote_sched_param_value value;
+ remote_nonnull_string field;
+ remote_sched_param_value value;
};
typedef struct remote_sched_param remote_sched_param;
struct remote_open_args {
- remote_string name;
- int flags;
+ remote_string name;
+ int flags;
};
typedef struct remote_open_args remote_open_args;
struct remote_supports_feature_args {
- int feature;
+ int feature;
};
typedef struct remote_supports_feature_args remote_supports_feature_args;
struct remote_supports_feature_ret {
- int supported;
+ int supported;
};
typedef struct remote_supports_feature_ret remote_supports_feature_ret;
struct remote_get_type_ret {
- remote_nonnull_string type;
+ remote_nonnull_string type;
};
typedef struct remote_get_type_ret remote_get_type_ret;
struct remote_get_version_ret {
- quad_t hv_ver;
+ quad_t hv_ver;
};
typedef struct remote_get_version_ret remote_get_version_ret;
struct remote_get_hostname_ret {
- remote_nonnull_string hostname;
+ remote_nonnull_string hostname;
};
typedef struct remote_get_hostname_ret remote_get_hostname_ret;
struct remote_get_max_vcpus_args {
- remote_string type;
+ remote_string type;
};
typedef struct remote_get_max_vcpus_args remote_get_max_vcpus_args;
struct remote_get_max_vcpus_ret {
- int max_vcpus;
+ int max_vcpus;
};
typedef struct remote_get_max_vcpus_ret remote_get_max_vcpus_ret;
struct remote_node_get_info_ret {
- char model[32];
- quad_t memory;
- int cpus;
- int mhz;
- int nodes;
- int sockets;
- int cores;
- int threads;
+ char model[32];
+ quad_t memory;
+ int cpus;
+ int mhz;
+ int nodes;
+ int sockets;
+ int cores;
+ int threads;
};
typedef struct remote_node_get_info_ret remote_node_get_info_ret;
struct remote_get_capabilities_ret {
- remote_nonnull_string capabilities;
+ remote_nonnull_string capabilities;
};
typedef struct remote_get_capabilities_ret remote_get_capabilities_ret;
+struct remote_node_get_cells_free_memory_args {
+ int startCell;
+ int maxCells;
+};
+typedef struct remote_node_get_cells_free_memory_args remote_node_get_cells_free_memory_args;
+
+struct remote_node_get_cells_free_memory_ret {
+ struct {
+ u_int freeMems_len;
+ quad_t *freeMems_val;
+ } freeMems;
+};
+typedef struct remote_node_get_cells_free_memory_ret remote_node_get_cells_free_memory_ret;
+
+struct remote_node_get_free_memory_ret {
+ quad_t freeMem;
+};
+typedef struct remote_node_get_free_memory_ret remote_node_get_free_memory_ret;
+
struct remote_domain_get_scheduler_type_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_get_scheduler_type_args remote_domain_get_scheduler_type_args;
struct remote_domain_get_scheduler_type_ret {
- remote_nonnull_string type;
- int nparams;
+ remote_nonnull_string type;
+ int nparams;
};
typedef struct remote_domain_get_scheduler_type_ret remote_domain_get_scheduler_type_ret;
struct remote_domain_get_scheduler_parameters_args {
- remote_nonnull_domain dom;
- int nparams;
+ remote_nonnull_domain dom;
+ int nparams;
};
typedef struct remote_domain_get_scheduler_parameters_args remote_domain_get_scheduler_parameters_args;
struct remote_domain_get_scheduler_parameters_ret {
- struct {
- u_int params_len;
- remote_sched_param *params_val;
- } params;
+ struct {
+ u_int params_len;
+ remote_sched_param *params_val;
+ } params;
};
typedef struct remote_domain_get_scheduler_parameters_ret remote_domain_get_scheduler_parameters_ret;
struct remote_domain_set_scheduler_parameters_args {
- remote_nonnull_domain dom;
- struct {
- u_int params_len;
- remote_sched_param *params_val;
- } params;
+ remote_nonnull_domain dom;
+ struct {
+ u_int params_len;
+ remote_sched_param *params_val;
+ } params;
};
typedef struct remote_domain_set_scheduler_parameters_args remote_domain_set_scheduler_parameters_args;
struct remote_domain_block_stats_args {
- remote_nonnull_domain dom;
- remote_nonnull_string path;
+ remote_nonnull_domain dom;
+ remote_nonnull_string path;
};
typedef struct remote_domain_block_stats_args remote_domain_block_stats_args;
struct remote_domain_block_stats_ret {
- quad_t rd_req;
- quad_t rd_bytes;
- quad_t wr_req;
- quad_t wr_bytes;
- quad_t errs;
+ quad_t rd_req;
+ quad_t rd_bytes;
+ quad_t wr_req;
+ quad_t wr_bytes;
+ quad_t errs;
};
typedef struct remote_domain_block_stats_ret remote_domain_block_stats_ret;
struct remote_domain_interface_stats_args {
- remote_nonnull_domain dom;
- remote_nonnull_string path;
+ remote_nonnull_domain dom;
+ remote_nonnull_string path;
};
typedef struct remote_domain_interface_stats_args remote_domain_interface_stats_args;
struct remote_domain_interface_stats_ret {
- quad_t rx_bytes;
- quad_t rx_packets;
- quad_t rx_errs;
- quad_t rx_drop;
- quad_t tx_bytes;
- quad_t tx_packets;
- quad_t tx_errs;
- quad_t tx_drop;
+ quad_t rx_bytes;
+ quad_t rx_packets;
+ quad_t rx_errs;
+ quad_t rx_drop;
+ quad_t tx_bytes;
+ quad_t tx_packets;
+ quad_t tx_errs;
+ quad_t tx_drop;
};
typedef struct remote_domain_interface_stats_ret remote_domain_interface_stats_ret;
struct remote_list_domains_args {
- int maxids;
+ int maxids;
};
typedef struct remote_list_domains_args remote_list_domains_args;
struct remote_list_domains_ret {
- struct {
- u_int ids_len;
- int *ids_val;
- } ids;
+ struct {
+ u_int ids_len;
+ int *ids_val;
+ } ids;
};
typedef struct remote_list_domains_ret remote_list_domains_ret;
struct remote_num_of_domains_ret {
- int num;
+ int num;
};
typedef struct remote_num_of_domains_ret remote_num_of_domains_ret;
struct remote_domain_create_linux_args {
- remote_nonnull_string xml_desc;
- int flags;
+ remote_nonnull_string xml_desc;
+ int flags;
};
typedef struct remote_domain_create_linux_args remote_domain_create_linux_args;
struct remote_domain_create_linux_ret {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_create_linux_ret remote_domain_create_linux_ret;
struct remote_domain_lookup_by_id_args {
- int id;
+ int id;
};
typedef struct remote_domain_lookup_by_id_args remote_domain_lookup_by_id_args;
struct remote_domain_lookup_by_id_ret {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_lookup_by_id_ret remote_domain_lookup_by_id_ret;
struct remote_domain_lookup_by_uuid_args {
- remote_uuid uuid;
+ remote_uuid uuid;
};
typedef struct remote_domain_lookup_by_uuid_args remote_domain_lookup_by_uuid_args;
struct remote_domain_lookup_by_uuid_ret {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_lookup_by_uuid_ret remote_domain_lookup_by_uuid_ret;
struct remote_domain_lookup_by_name_args {
- remote_nonnull_string name;
+ remote_nonnull_string name;
};
typedef struct remote_domain_lookup_by_name_args remote_domain_lookup_by_name_args;
struct remote_domain_lookup_by_name_ret {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_lookup_by_name_ret remote_domain_lookup_by_name_ret;
struct remote_domain_suspend_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_suspend_args remote_domain_suspend_args;
struct remote_domain_resume_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_resume_args remote_domain_resume_args;
struct remote_domain_shutdown_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_shutdown_args remote_domain_shutdown_args;
struct remote_domain_reboot_args {
- remote_nonnull_domain dom;
- int flags;
+ remote_nonnull_domain dom;
+ int flags;
};
typedef struct remote_domain_reboot_args remote_domain_reboot_args;
struct remote_domain_destroy_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_destroy_args remote_domain_destroy_args;
struct remote_domain_get_os_type_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_get_os_type_args remote_domain_get_os_type_args;
struct remote_domain_get_os_type_ret {
- remote_nonnull_string type;
+ remote_nonnull_string type;
};
typedef struct remote_domain_get_os_type_ret remote_domain_get_os_type_ret;
struct remote_domain_get_max_memory_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_get_max_memory_args remote_domain_get_max_memory_args;
struct remote_domain_get_max_memory_ret {
- u_quad_t memory;
+ u_quad_t memory;
};
typedef struct remote_domain_get_max_memory_ret remote_domain_get_max_memory_ret;
struct remote_domain_set_max_memory_args {
- remote_nonnull_domain dom;
- u_quad_t memory;
+ remote_nonnull_domain dom;
+ u_quad_t memory;
};
typedef struct remote_domain_set_max_memory_args remote_domain_set_max_memory_args;
struct remote_domain_set_memory_args {
- remote_nonnull_domain dom;
- u_quad_t memory;
+ remote_nonnull_domain dom;
+ u_quad_t memory;
};
typedef struct remote_domain_set_memory_args remote_domain_set_memory_args;
struct remote_domain_get_info_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_get_info_args remote_domain_get_info_args;
struct remote_domain_get_info_ret {
- u_char state;
- u_quad_t max_mem;
- u_quad_t memory;
- u_short nr_virt_cpu;
- u_quad_t cpu_time;
+ u_char state;
+ u_quad_t max_mem;
+ u_quad_t memory;
+ u_short nr_virt_cpu;
+ u_quad_t cpu_time;
};
typedef struct remote_domain_get_info_ret remote_domain_get_info_ret;
struct remote_domain_save_args {
- remote_nonnull_domain dom;
- remote_nonnull_string to;
+ remote_nonnull_domain dom;
+ remote_nonnull_string to;
};
typedef struct remote_domain_save_args remote_domain_save_args;
struct remote_domain_restore_args {
- remote_nonnull_string from;
+ remote_nonnull_string from;
};
typedef struct remote_domain_restore_args remote_domain_restore_args;
struct remote_domain_core_dump_args {
- remote_nonnull_domain dom;
- remote_nonnull_string to;
- int flags;
+ remote_nonnull_domain dom;
+ remote_nonnull_string to;
+ int flags;
};
typedef struct remote_domain_core_dump_args remote_domain_core_dump_args;
struct remote_domain_dump_xml_args {
- remote_nonnull_domain dom;
- int flags;
+ remote_nonnull_domain dom;
+ int flags;
};
typedef struct remote_domain_dump_xml_args remote_domain_dump_xml_args;
struct remote_domain_dump_xml_ret {
- remote_nonnull_string xml;
+ remote_nonnull_string xml;
};
typedef struct remote_domain_dump_xml_ret remote_domain_dump_xml_ret;
struct remote_domain_migrate_prepare_args {
- remote_string uri_in;
- u_quad_t flags;
- remote_string dname;
- u_quad_t resource;
+ remote_string uri_in;
+ u_quad_t flags;
+ remote_string dname;
+ u_quad_t resource;
};
typedef struct remote_domain_migrate_prepare_args remote_domain_migrate_prepare_args;
struct remote_domain_migrate_prepare_ret {
- struct {
- u_int cookie_len;
- char *cookie_val;
- } cookie;
- remote_string uri_out;
+ struct {
+ u_int cookie_len;
+ char *cookie_val;
+ } cookie;
+ remote_string uri_out;
};
typedef struct remote_domain_migrate_prepare_ret remote_domain_migrate_prepare_ret;
struct remote_domain_migrate_perform_args {
- remote_nonnull_domain dom;
- struct {
- u_int cookie_len;
- char *cookie_val;
- } cookie;
- remote_nonnull_string uri;
- u_quad_t flags;
- remote_string dname;
- u_quad_t resource;
+ remote_nonnull_domain dom;
+ struct {
+ u_int cookie_len;
+ char *cookie_val;
+ } cookie;
+ remote_nonnull_string uri;
+ u_quad_t flags;
+ remote_string dname;
+ u_quad_t resource;
};
typedef struct remote_domain_migrate_perform_args remote_domain_migrate_perform_args;
struct remote_domain_migrate_finish_args {
- remote_nonnull_string dname;
- struct {
- u_int cookie_len;
- char *cookie_val;
- } cookie;
- remote_nonnull_string uri;
- u_quad_t flags;
+ remote_nonnull_string dname;
+ struct {
+ u_int cookie_len;
+ char *cookie_val;
+ } cookie;
+ remote_nonnull_string uri;
+ u_quad_t flags;
};
typedef struct remote_domain_migrate_finish_args remote_domain_migrate_finish_args;
struct remote_domain_migrate_finish_ret {
- remote_nonnull_domain ddom;
+ remote_nonnull_domain ddom;
};
typedef struct remote_domain_migrate_finish_ret remote_domain_migrate_finish_ret;
struct remote_list_defined_domains_args {
- int maxnames;
+ int maxnames;
};
typedef struct remote_list_defined_domains_args remote_list_defined_domains_args;
struct remote_list_defined_domains_ret {
- struct {
- u_int names_len;
- remote_nonnull_string *names_val;
- } names;
+ struct {
+ u_int names_len;
+ remote_nonnull_string *names_val;
+ } names;
};
typedef struct remote_list_defined_domains_ret remote_list_defined_domains_ret;
struct remote_num_of_defined_domains_ret {
- int num;
+ int num;
};
typedef struct remote_num_of_defined_domains_ret remote_num_of_defined_domains_ret;
struct remote_domain_create_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_create_args remote_domain_create_args;
struct remote_domain_define_xml_args {
- remote_nonnull_string xml;
+ remote_nonnull_string xml;
};
typedef struct remote_domain_define_xml_args remote_domain_define_xml_args;
struct remote_domain_define_xml_ret {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_define_xml_ret remote_domain_define_xml_ret;
struct remote_domain_undefine_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_undefine_args remote_domain_undefine_args;
struct remote_domain_set_vcpus_args {
- remote_nonnull_domain dom;
- int nvcpus;
+ remote_nonnull_domain dom;
+ int nvcpus;
};
typedef struct remote_domain_set_vcpus_args remote_domain_set_vcpus_args;
struct remote_domain_pin_vcpu_args {
- remote_nonnull_domain dom;
- int vcpu;
- struct {
- u_int cpumap_len;
- char *cpumap_val;
- } cpumap;
+ remote_nonnull_domain dom;
+ int vcpu;
+ struct {
+ u_int cpumap_len;
+ char *cpumap_val;
+ } cpumap;
};
typedef struct remote_domain_pin_vcpu_args remote_domain_pin_vcpu_args;
struct remote_domain_get_vcpus_args {
- remote_nonnull_domain dom;
- int maxinfo;
- int maplen;
+ remote_nonnull_domain dom;
+ int maxinfo;
+ int maplen;
};
typedef struct remote_domain_get_vcpus_args remote_domain_get_vcpus_args;
struct remote_domain_get_vcpus_ret {
- struct {
- u_int info_len;
- remote_vcpu_info *info_val;
- } info;
- struct {
- u_int cpumaps_len;
- char *cpumaps_val;
- } cpumaps;
+ struct {
+ u_int info_len;
+ remote_vcpu_info *info_val;
+ } info;
+ struct {
+ u_int cpumaps_len;
+ char *cpumaps_val;
+ } cpumaps;
};
typedef struct remote_domain_get_vcpus_ret remote_domain_get_vcpus_ret;
struct remote_domain_get_max_vcpus_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_get_max_vcpus_args remote_domain_get_max_vcpus_args;
struct remote_domain_get_max_vcpus_ret {
- int num;
+ int num;
};
typedef struct remote_domain_get_max_vcpus_ret remote_domain_get_max_vcpus_ret;
struct remote_domain_attach_device_args {
- remote_nonnull_domain dom;
- remote_nonnull_string xml;
+ remote_nonnull_domain dom;
+ remote_nonnull_string xml;
};
typedef struct remote_domain_attach_device_args remote_domain_attach_device_args;
struct remote_domain_detach_device_args {
- remote_nonnull_domain dom;
- remote_nonnull_string xml;
+ remote_nonnull_domain dom;
+ remote_nonnull_string xml;
};
typedef struct remote_domain_detach_device_args remote_domain_detach_device_args;
struct remote_domain_get_autostart_args {
- remote_nonnull_domain dom;
+ remote_nonnull_domain dom;
};
typedef struct remote_domain_get_autostart_args remote_domain_get_autostart_args;
struct remote_domain_get_autostart_ret {
- int autostart;
+ int autostart;
};
typedef struct remote_domain_get_autostart_ret remote_domain_get_autostart_ret;
struct remote_domain_set_autostart_args {
- remote_nonnull_domain dom;
- int autostart;
+ remote_nonnull_domain dom;
+ int autostart;
};
typedef struct remote_domain_set_autostart_args remote_domain_set_autostart_args;
struct remote_num_of_networks_ret {
- int num;
+ int num;
};
typedef struct remote_num_of_networks_ret remote_num_of_networks_ret;
struct remote_list_networks_args {
- int maxnames;
+ int maxnames;
};
typedef struct remote_list_networks_args remote_list_networks_args;
struct remote_list_networks_ret {
- struct {
- u_int names_len;
- remote_nonnull_string *names_val;
- } names;
+ struct {
+ u_int names_len;
+ remote_nonnull_string *names_val;
+ } names;
};
typedef struct remote_list_networks_ret remote_list_networks_ret;
struct remote_num_of_defined_networks_ret {
- int num;
+ int num;
};
typedef struct remote_num_of_defined_networks_ret remote_num_of_defined_networks_ret;
struct remote_list_defined_networks_args {
- int maxnames;
+ int maxnames;
};
typedef struct remote_list_defined_networks_args remote_list_defined_networks_args;
struct remote_list_defined_networks_ret {
- struct {
- u_int names_len;
- remote_nonnull_string *names_val;
- } names;
+ struct {
+ u_int names_len;
+ remote_nonnull_string *names_val;
+ } names;
};
typedef struct remote_list_defined_networks_ret remote_list_defined_networks_ret;
struct remote_network_lookup_by_uuid_args {
- remote_uuid uuid;
+ remote_uuid uuid;
};
typedef struct remote_network_lookup_by_uuid_args remote_network_lookup_by_uuid_args;
struct remote_network_lookup_by_uuid_ret {
- remote_nonnull_network net;
+ remote_nonnull_network net;
};
typedef struct remote_network_lookup_by_uuid_ret remote_network_lookup_by_uuid_ret;
struct remote_network_lookup_by_name_args {
- remote_nonnull_string name;
+ remote_nonnull_string name;
};
typedef struct remote_network_lookup_by_name_args remote_network_lookup_by_name_args;
struct remote_network_lookup_by_name_ret {
- remote_nonnull_network net;
+ remote_nonnull_network net;
};
typedef struct remote_network_lookup_by_name_ret remote_network_lookup_by_name_ret;
struct remote_network_create_xml_args {
- remote_nonnull_string xml;
+ remote_nonnull_string xml;
};
typedef struct remote_network_create_xml_args remote_network_create_xml_args;
struct remote_network_create_xml_ret {
- remote_nonnull_network net;
+ remote_nonnull_network net;
};
typedef struct remote_network_create_xml_ret remote_network_create_xml_ret;
struct remote_network_define_xml_args {
- remote_nonnull_string xml;
+ remote_nonnull_string xml;
};
typedef struct remote_network_define_xml_args remote_network_define_xml_args;
struct remote_network_define_xml_ret {
- remote_nonnull_network net;
+ remote_nonnull_network net;
};
typedef struct remote_network_define_xml_ret remote_network_define_xml_ret;
struct remote_network_undefine_args {
- remote_nonnull_network net;
+ remote_nonnull_network net;
};
typedef struct remote_network_undefine_args remote_network_undefine_args;
struct remote_network_create_args {
- remote_nonnull_network net;
+ remote_nonnull_network net;
};
typedef struct remote_network_create_args remote_network_create_args;
struct remote_network_destroy_args {
- remote_nonnull_network net;
+ remote_nonnull_network net;
};
typedef struct remote_network_destroy_args remote_network_destroy_args;
struct remote_network_dump_xml_args {
- remote_nonnull_network net;
- int flags;
+ remote_nonnull_network net;
+ int flags;
};
typedef struct remote_network_dump_xml_args remote_network_dump_xml_args;
struct remote_network_dump_xml_ret {
- remote_nonnull_string xml;
+ remote_nonnull_string xml;
};
typedef struct remote_network_dump_xml_ret remote_network_dump_xml_ret;
struct remote_network_get_bridge_name_args {
- remote_nonnull_network net;
+ remote_nonnull_network net;
};
typedef struct remote_network_get_bridge_name_args remote_network_get_bridge_name_args;
struct remote_network_get_bridge_name_ret {
- remote_nonnull_string name;
+ remote_nonnull_string name;
};
typedef struct remote_network_get_bridge_name_ret remote_network_get_bridge_name_ret;
struct remote_network_get_autostart_args {
- remote_nonnull_network net;
+ remote_nonnull_network net;
};
typedef struct remote_network_get_autostart_args remote_network_get_autostart_args;
struct remote_network_get_autostart_ret {
- int autostart;
+ int autostart;
};
typedef struct remote_network_get_autostart_ret remote_network_get_autostart_ret;
struct remote_network_set_autostart_args {
- remote_nonnull_network net;
- int autostart;
+ remote_nonnull_network net;
+ int autostart;
};
typedef struct remote_network_set_autostart_args remote_network_set_autostart_args;
struct remote_auth_list_ret {
- struct {
- u_int types_len;
- remote_auth_type *types_val;
- } types;
+ struct {
+ u_int types_len;
+ remote_auth_type *types_val;
+ } types;
};
typedef struct remote_auth_list_ret remote_auth_list_ret;
struct remote_auth_sasl_init_ret {
- remote_nonnull_string mechlist;
+ remote_nonnull_string mechlist;
};
typedef struct remote_auth_sasl_init_ret remote_auth_sasl_init_ret;
struct remote_auth_sasl_start_args {
- remote_nonnull_string mech;
- int nil;
- struct {
- u_int data_len;
- char *data_val;
- } data;
+ remote_nonnull_string mech;
+ int nil;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
};
typedef struct remote_auth_sasl_start_args remote_auth_sasl_start_args;
struct remote_auth_sasl_start_ret {
- int complete;
- int nil;
- struct {
- u_int data_len;
- char *data_val;
- } data;
+ int complete;
+ int nil;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
};
typedef struct remote_auth_sasl_start_ret remote_auth_sasl_start_ret;
struct remote_auth_sasl_step_args {
- int nil;
- struct {
- u_int data_len;
- char *data_val;
- } data;
+ int nil;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
};
typedef struct remote_auth_sasl_step_args remote_auth_sasl_step_args;
struct remote_auth_sasl_step_ret {
- int complete;
- int nil;
- struct {
- u_int data_len;
- char *data_val;
- } data;
+ int complete;
+ int nil;
+ struct {
+ u_int data_len;
+ char *data_val;
+ } data;
};
typedef struct remote_auth_sasl_step_ret remote_auth_sasl_step_ret;
struct remote_auth_polkit_ret {
- int complete;
+ int complete;
};
typedef struct remote_auth_polkit_ret remote_auth_polkit_ret;
struct remote_num_of_storage_pools_ret {
- int num;
+ int num;
};
typedef struct remote_num_of_storage_pools_ret remote_num_of_storage_pools_ret;
struct remote_list_storage_pools_args {
- int maxnames;
+ int maxnames;
};
typedef struct remote_list_storage_pools_args remote_list_storage_pools_args;
struct remote_list_storage_pools_ret {
- struct {
- u_int names_len;
- remote_nonnull_string *names_val;
- } names;
+ struct {
+ u_int names_len;
+ remote_nonnull_string *names_val;
+ } names;
};
typedef struct remote_list_storage_pools_ret remote_list_storage_pools_ret;
struct remote_num_of_defined_storage_pools_ret {
- int num;
+ int num;
};
typedef struct remote_num_of_defined_storage_pools_ret remote_num_of_defined_storage_pools_ret;
struct remote_list_defined_storage_pools_args {
- int maxnames;
+ int maxnames;
};
typedef struct remote_list_defined_storage_pools_args remote_list_defined_storage_pools_args;
struct remote_list_defined_storage_pools_ret {
- struct {
- u_int names_len;
- remote_nonnull_string *names_val;
- } names;
+ struct {
+ u_int names_len;
+ remote_nonnull_string *names_val;
+ } names;
};
typedef struct remote_list_defined_storage_pools_ret remote_list_defined_storage_pools_ret;
struct remote_storage_pool_lookup_by_uuid_args {
- remote_uuid uuid;
+ remote_uuid uuid;
};
typedef struct remote_storage_pool_lookup_by_uuid_args remote_storage_pool_lookup_by_uuid_args;
struct remote_storage_pool_lookup_by_uuid_ret {
- remote_nonnull_storage_pool pool;
+ remote_nonnull_storage_pool pool;
};
typedef struct remote_storage_pool_lookup_by_uuid_ret remote_storage_pool_lookup_by_uuid_ret;
struct remote_storage_pool_lookup_by_name_args {
- remote_nonnull_string name;
+ remote_nonnull_string name;
};
typedef struct remote_storage_pool_lookup_by_name_args remote_storage_pool_lookup_by_name_args;
struct remote_storage_pool_lookup_by_name_ret {
- remote_nonnull_storage_pool pool;
+ remote_nonnull_storage_pool pool;
};
typedef struct remote_storage_pool_lookup_by_name_ret remote_storage_pool_lookup_by_name_ret;
struct remote_storage_pool_lookup_by_volume_args {
- remote_nonnull_storage_vol vol;
+ remote_nonnull_storage_vol vol;
};
typedef struct remote_storage_pool_lookup_by_volume_args remote_storage_pool_lookup_by_volume_args;
struct remote_storage_pool_lookup_by_volume_ret {
- remote_nonnull_storage_pool pool;
+ remote_nonnull_storage_pool pool;
};
typedef struct remote_storage_pool_lookup_by_volume_ret remote_storage_pool_lookup_by_volume_ret;
struct remote_storage_pool_create_xml_args {
- remote_nonnull_string xml;
- u_int flags;
+ remote_nonnull_string xml;
+ u_int flags;
};
typedef struct remote_storage_pool_create_xml_args remote_storage_pool_create_xml_args;
struct remote_storage_pool_create_xml_ret {
- remote_nonnull_storage_pool pool;
+ remote_nonnull_storage_pool pool;
};
typedef struct remote_storage_pool_create_xml_ret remote_storage_pool_create_xml_ret;
struct remote_storage_pool_define_xml_args {
- remote_nonnull_string xml;
- u_int flags;
+ remote_nonnull_string xml;
+ u_int flags;
};
typedef struct remote_storage_pool_define_xml_args remote_storage_pool_define_xml_args;
struct remote_storage_pool_define_xml_ret {
- remote_nonnull_storage_pool pool;
+ remote_nonnull_storage_pool pool;
};
typedef struct remote_storage_pool_define_xml_ret remote_storage_pool_define_xml_ret;
struct remote_storage_pool_build_args {
- remote_nonnull_storage_pool pool;
- u_int flags;
+ remote_nonnull_storage_pool pool;
+ u_int flags;
};
typedef struct remote_storage_pool_build_args remote_storage_pool_build_args;
struct remote_storage_pool_undefine_args {
- remote_nonnull_storage_pool pool;
+ remote_nonnull_storage_pool pool;
};
typedef struct remote_storage_pool_undefine_args remote_storage_pool_undefine_args;
struct remote_storage_pool_create_args {
- remote_nonnull_storage_pool pool;
- u_int flags;
+ remote_nonnull_storage_pool pool;
+ u_int flags;
};
typedef struct remote_storage_pool_create_args remote_storage_pool_create_args;
struct remote_storage_pool_destroy_args {
- remote_nonnull_storage_pool pool;
+ remote_nonnull_storage_pool pool;
};
typedef struct remote_storage_pool_destroy_args remote_storage_pool_destroy_args;
struct remote_storage_pool_delete_args {
- remote_nonnull_storage_pool pool;
- u_int flags;
+ remote_nonnull_storage_pool pool;
+ u_int flags;
};
typedef struct remote_storage_pool_delete_args remote_storage_pool_delete_args;
struct remote_storage_pool_refresh_args {
- remote_nonnull_storage_pool pool;
- u_int flags;
+ remote_nonnull_storage_pool pool;
+ u_int flags;
};
typedef struct remote_storage_pool_refresh_args remote_storage_pool_refresh_args;
struct remote_storage_pool_dump_xml_args {
- remote_nonnull_storage_pool pool;
- u_int flags;
+ remote_nonnull_storage_pool pool;
+ u_int flags;
};
typedef struct remote_storage_pool_dump_xml_args remote_storage_pool_dump_xml_args;
struct remote_storage_pool_dump_xml_ret {
- remote_nonnull_string xml;
+ remote_nonnull_string xml;
};
typedef struct remote_storage_pool_dump_xml_ret remote_storage_pool_dump_xml_ret;
struct remote_storage_pool_get_info_args {
- remote_nonnull_storage_pool pool;
+ remote_nonnull_storage_pool pool;
};
typedef struct remote_storage_pool_get_info_args remote_storage_pool_get_info_args;
struct remote_storage_pool_get_info_ret {
- u_char state;
- u_quad_t capacity;
- u_quad_t allocation;
- u_quad_t available;
+ u_char state;
+ u_quad_t capacity;
+ u_quad_t allocation;
+ u_quad_t available;
};
typedef struct remote_storage_pool_get_info_ret remote_storage_pool_get_info_ret;
struct remote_storage_pool_get_autostart_args {
- remote_nonnull_storage_pool pool;
+ remote_nonnull_storage_pool pool;
};
typedef struct remote_storage_pool_get_autostart_args remote_storage_pool_get_autostart_args;
struct remote_storage_pool_get_autostart_ret {
- int autostart;
+ int autostart;
};
typedef struct remote_storage_pool_get_autostart_ret remote_storage_pool_get_autostart_ret;
struct remote_storage_pool_set_autostart_args {
- remote_nonnull_storage_pool pool;
- int autostart;
+ remote_nonnull_storage_pool pool;
+ int autostart;
};
typedef struct remote_storage_pool_set_autostart_args remote_storage_pool_set_autostart_args;
struct remote_storage_pool_num_of_volumes_args {
- remote_nonnull_storage_pool pool;
+ remote_nonnull_storage_pool pool;
};
typedef struct remote_storage_pool_num_of_volumes_args remote_storage_pool_num_of_volumes_args;
struct remote_storage_pool_num_of_volumes_ret {
- int num;
+ int num;
};
typedef struct remote_storage_pool_num_of_volumes_ret remote_storage_pool_num_of_volumes_ret;
struct remote_storage_pool_list_volumes_args {
- remote_nonnull_storage_pool pool;
- int maxnames;
+ remote_nonnull_storage_pool pool;
+ int maxnames;
};
typedef struct remote_storage_pool_list_volumes_args remote_storage_pool_list_volumes_args;
struct remote_storage_pool_list_volumes_ret {
- struct {
- u_int names_len;
- remote_nonnull_string *names_val;
- } names;
+ struct {
+ u_int names_len;
+ remote_nonnull_string *names_val;
+ } names;
};
typedef struct remote_storage_pool_list_volumes_ret remote_storage_pool_list_volumes_ret;
struct remote_storage_vol_lookup_by_name_args {
- remote_nonnull_storage_pool pool;
- remote_nonnull_string name;
+ remote_nonnull_storage_pool pool;
+ remote_nonnull_string name;
};
typedef struct remote_storage_vol_lookup_by_name_args remote_storage_vol_lookup_by_name_args;
struct remote_storage_vol_lookup_by_name_ret {
- remote_nonnull_storage_vol vol;
+ remote_nonnull_storage_vol vol;
};
typedef struct remote_storage_vol_lookup_by_name_ret remote_storage_vol_lookup_by_name_ret;
struct remote_storage_vol_lookup_by_key_args {
- remote_nonnull_string key;
+ remote_nonnull_string key;
};
typedef struct remote_storage_vol_lookup_by_key_args remote_storage_vol_lookup_by_key_args;
struct remote_storage_vol_lookup_by_key_ret {
- remote_nonnull_storage_vol vol;
+ remote_nonnull_storage_vol vol;
};
typedef struct remote_storage_vol_lookup_by_key_ret remote_storage_vol_lookup_by_key_ret;
struct remote_storage_vol_lookup_by_path_args {
- remote_nonnull_string path;
+ remote_nonnull_string path;
};
typedef struct remote_storage_vol_lookup_by_path_args remote_storage_vol_lookup_by_path_args;
struct remote_storage_vol_lookup_by_path_ret {
- remote_nonnull_storage_vol vol;
+ remote_nonnull_storage_vol vol;
};
typedef struct remote_storage_vol_lookup_by_path_ret remote_storage_vol_lookup_by_path_ret;
struct remote_storage_vol_create_xml_args {
- remote_nonnull_storage_pool pool;
- remote_nonnull_string xml;
- u_int flags;
+ remote_nonnull_storage_pool pool;
+ remote_nonnull_string xml;
+ u_int flags;
};
typedef struct remote_storage_vol_create_xml_args remote_storage_vol_create_xml_args;
struct remote_storage_vol_create_xml_ret {
- remote_nonnull_storage_vol vol;
+ remote_nonnull_storage_vol vol;
};
typedef struct remote_storage_vol_create_xml_ret remote_storage_vol_create_xml_ret;
struct remote_storage_vol_delete_args {
- remote_nonnull_storage_vol vol;
- u_int flags;
+ remote_nonnull_storage_vol vol;
+ u_int flags;
};
typedef struct remote_storage_vol_delete_args remote_storage_vol_delete_args;
struct remote_storage_vol_dump_xml_args {
- remote_nonnull_storage_vol vol;
- u_int flags;
+ remote_nonnull_storage_vol vol;
+ u_int flags;
};
typedef struct remote_storage_vol_dump_xml_args remote_storage_vol_dump_xml_args;
struct remote_storage_vol_dump_xml_ret {
- remote_nonnull_string xml;
+ remote_nonnull_string xml;
};
typedef struct remote_storage_vol_dump_xml_ret remote_storage_vol_dump_xml_ret;
struct remote_storage_vol_get_info_args {
- remote_nonnull_storage_vol vol;
+ remote_nonnull_storage_vol vol;
};
typedef struct remote_storage_vol_get_info_args remote_storage_vol_get_info_args;
struct remote_storage_vol_get_info_ret {
- char type;
- u_quad_t capacity;
- u_quad_t allocation;
+ char type;
+ u_quad_t capacity;
+ u_quad_t allocation;
};
typedef struct remote_storage_vol_get_info_ret remote_storage_vol_get_info_ret;
struct remote_storage_vol_get_path_args {
- remote_nonnull_storage_vol vol;
+ remote_nonnull_storage_vol vol;
};
typedef struct remote_storage_vol_get_path_args remote_storage_vol_get_path_args;
struct remote_storage_vol_get_path_ret {
- remote_nonnull_string name;
+ remote_nonnull_string name;
};
typedef struct remote_storage_vol_get_path_ret remote_storage_vol_get_path_ret;
#define REMOTE_PROGRAM 0x20008086
#define REMOTE_PROTOCOL_VERSION 1
enum remote_procedure {
- REMOTE_PROC_OPEN = 1,
- REMOTE_PROC_CLOSE = 2,
- REMOTE_PROC_GET_TYPE = 3,
- REMOTE_PROC_GET_VERSION = 4,
- REMOTE_PROC_GET_MAX_VCPUS = 5,
- REMOTE_PROC_NODE_GET_INFO = 6,
- REMOTE_PROC_GET_CAPABILITIES = 7,
- REMOTE_PROC_DOMAIN_ATTACH_DEVICE = 8,
- REMOTE_PROC_DOMAIN_CREATE = 9,
- REMOTE_PROC_DOMAIN_CREATE_LINUX = 10,
- REMOTE_PROC_DOMAIN_DEFINE_XML = 11,
- REMOTE_PROC_DOMAIN_DESTROY = 12,
- REMOTE_PROC_DOMAIN_DETACH_DEVICE = 13,
- REMOTE_PROC_DOMAIN_DUMP_XML = 14,
- REMOTE_PROC_DOMAIN_GET_AUTOSTART = 15,
- REMOTE_PROC_DOMAIN_GET_INFO = 16,
- REMOTE_PROC_DOMAIN_GET_MAX_MEMORY = 17,
- REMOTE_PROC_DOMAIN_GET_MAX_VCPUS = 18,
- REMOTE_PROC_DOMAIN_GET_OS_TYPE = 19,
- REMOTE_PROC_DOMAIN_GET_VCPUS = 20,
- REMOTE_PROC_LIST_DEFINED_DOMAINS = 21,
- REMOTE_PROC_DOMAIN_LOOKUP_BY_ID = 22,
- REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME = 23,
- REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID = 24,
- REMOTE_PROC_NUM_OF_DEFINED_DOMAINS = 25,
- REMOTE_PROC_DOMAIN_PIN_VCPU = 26,
- REMOTE_PROC_DOMAIN_REBOOT = 27,
- REMOTE_PROC_DOMAIN_RESUME = 28,
- REMOTE_PROC_DOMAIN_SET_AUTOSTART = 29,
- REMOTE_PROC_DOMAIN_SET_MAX_MEMORY = 30,
- REMOTE_PROC_DOMAIN_SET_MEMORY = 31,
- REMOTE_PROC_DOMAIN_SET_VCPUS = 32,
- REMOTE_PROC_DOMAIN_SHUTDOWN = 33,
- REMOTE_PROC_DOMAIN_SUSPEND = 34,
- REMOTE_PROC_DOMAIN_UNDEFINE = 35,
- REMOTE_PROC_LIST_DEFINED_NETWORKS = 36,
- REMOTE_PROC_LIST_DOMAINS = 37,
- REMOTE_PROC_LIST_NETWORKS = 38,
- REMOTE_PROC_NETWORK_CREATE = 39,
- REMOTE_PROC_NETWORK_CREATE_XML = 40,
- REMOTE_PROC_NETWORK_DEFINE_XML = 41,
- REMOTE_PROC_NETWORK_DESTROY = 42,
- REMOTE_PROC_NETWORK_DUMP_XML = 43,
- REMOTE_PROC_NETWORK_GET_AUTOSTART = 44,
- REMOTE_PROC_NETWORK_GET_BRIDGE_NAME = 45,
- REMOTE_PROC_NETWORK_LOOKUP_BY_NAME = 46,
- REMOTE_PROC_NETWORK_LOOKUP_BY_UUID = 47,
- REMOTE_PROC_NETWORK_SET_AUTOSTART = 48,
- REMOTE_PROC_NETWORK_UNDEFINE = 49,
- REMOTE_PROC_NUM_OF_DEFINED_NETWORKS = 50,
- REMOTE_PROC_NUM_OF_DOMAINS = 51,
- REMOTE_PROC_NUM_OF_NETWORKS = 52,
- REMOTE_PROC_DOMAIN_CORE_DUMP = 53,
- REMOTE_PROC_DOMAIN_RESTORE = 54,
- REMOTE_PROC_DOMAIN_SAVE = 55,
- REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE = 56,
- REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS = 57,
- REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS = 58,
- REMOTE_PROC_GET_HOSTNAME = 59,
- REMOTE_PROC_SUPPORTS_FEATURE = 60,
- REMOTE_PROC_DOMAIN_MIGRATE_PREPARE = 61,
- REMOTE_PROC_DOMAIN_MIGRATE_PERFORM = 62,
- REMOTE_PROC_DOMAIN_MIGRATE_FINISH = 63,
- REMOTE_PROC_DOMAIN_BLOCK_STATS = 64,
- REMOTE_PROC_DOMAIN_INTERFACE_STATS = 65,
- REMOTE_PROC_AUTH_LIST = 66,
- REMOTE_PROC_AUTH_SASL_INIT = 67,
- REMOTE_PROC_AUTH_SASL_START = 68,
- REMOTE_PROC_AUTH_SASL_STEP = 69,
- REMOTE_PROC_AUTH_POLKIT = 70,
- REMOTE_PROC_NUM_OF_STORAGE_POOLS = 71,
- REMOTE_PROC_LIST_STORAGE_POOLS = 72,
- REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS = 73,
- REMOTE_PROC_LIST_DEFINED_STORAGE_POOLS = 74,
- REMOTE_PROC_DISCOVER_STORAGE_POOLS = 75,
- REMOTE_PROC_STORAGE_POOL_CREATE_XML = 76,
- REMOTE_PROC_STORAGE_POOL_DEFINE_XML = 77,
- REMOTE_PROC_STORAGE_POOL_CREATE = 78,
- REMOTE_PROC_STORAGE_POOL_BUILD = 79,
- REMOTE_PROC_STORAGE_POOL_DESTROY = 80,
- REMOTE_PROC_STORAGE_POOL_DELETE = 81,
- REMOTE_PROC_STORAGE_POOL_UNDEFINE = 82,
- REMOTE_PROC_STORAGE_POOL_REFRESH = 83,
- REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_NAME = 84,
- REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_UUID = 85,
- REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_VOLUME = 86,
- REMOTE_PROC_STORAGE_POOL_GET_INFO = 87,
- REMOTE_PROC_STORAGE_POOL_DUMP_XML = 88,
- REMOTE_PROC_STORAGE_POOL_GET_AUTOSTART = 89,
- REMOTE_PROC_STORAGE_POOL_SET_AUTOSTART = 90,
- REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES = 91,
- REMOTE_PROC_STORAGE_POOL_LIST_VOLUMES = 92,
- REMOTE_PROC_STORAGE_VOL_CREATE_XML = 93,
- REMOTE_PROC_STORAGE_VOL_DELETE = 94,
- REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_NAME = 95,
- REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_KEY = 96,
- REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH = 97,
- REMOTE_PROC_STORAGE_VOL_GET_INFO = 98,
- REMOTE_PROC_STORAGE_VOL_DUMP_XML = 99,
- REMOTE_PROC_STORAGE_VOL_GET_PATH = 100,
+ REMOTE_PROC_OPEN = 1,
+ REMOTE_PROC_CLOSE = 2,
+ REMOTE_PROC_GET_TYPE = 3,
+ REMOTE_PROC_GET_VERSION = 4,
+ REMOTE_PROC_GET_MAX_VCPUS = 5,
+ REMOTE_PROC_NODE_GET_INFO = 6,
+ REMOTE_PROC_GET_CAPABILITIES = 7,
+ REMOTE_PROC_DOMAIN_ATTACH_DEVICE = 8,
+ REMOTE_PROC_DOMAIN_CREATE = 9,
+ REMOTE_PROC_DOMAIN_CREATE_LINUX = 10,
+ REMOTE_PROC_DOMAIN_DEFINE_XML = 11,
+ REMOTE_PROC_DOMAIN_DESTROY = 12,
+ REMOTE_PROC_DOMAIN_DETACH_DEVICE = 13,
+ REMOTE_PROC_DOMAIN_DUMP_XML = 14,
+ REMOTE_PROC_DOMAIN_GET_AUTOSTART = 15,
+ REMOTE_PROC_DOMAIN_GET_INFO = 16,
+ REMOTE_PROC_DOMAIN_GET_MAX_MEMORY = 17,
+ REMOTE_PROC_DOMAIN_GET_MAX_VCPUS = 18,
+ REMOTE_PROC_DOMAIN_GET_OS_TYPE = 19,
+ REMOTE_PROC_DOMAIN_GET_VCPUS = 20,
+ REMOTE_PROC_LIST_DEFINED_DOMAINS = 21,
+ REMOTE_PROC_DOMAIN_LOOKUP_BY_ID = 22,
+ REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME = 23,
+ REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID = 24,
+ REMOTE_PROC_NUM_OF_DEFINED_DOMAINS = 25,
+ REMOTE_PROC_DOMAIN_PIN_VCPU = 26,
+ REMOTE_PROC_DOMAIN_REBOOT = 27,
+ REMOTE_PROC_DOMAIN_RESUME = 28,
+ REMOTE_PROC_DOMAIN_SET_AUTOSTART = 29,
+ REMOTE_PROC_DOMAIN_SET_MAX_MEMORY = 30,
+ REMOTE_PROC_DOMAIN_SET_MEMORY = 31,
+ REMOTE_PROC_DOMAIN_SET_VCPUS = 32,
+ REMOTE_PROC_DOMAIN_SHUTDOWN = 33,
+ REMOTE_PROC_DOMAIN_SUSPEND = 34,
+ REMOTE_PROC_DOMAIN_UNDEFINE = 35,
+ REMOTE_PROC_LIST_DEFINED_NETWORKS = 36,
+ REMOTE_PROC_LIST_DOMAINS = 37,
+ REMOTE_PROC_LIST_NETWORKS = 38,
+ REMOTE_PROC_NETWORK_CREATE = 39,
+ REMOTE_PROC_NETWORK_CREATE_XML = 40,
+ REMOTE_PROC_NETWORK_DEFINE_XML = 41,
+ REMOTE_PROC_NETWORK_DESTROY = 42,
+ REMOTE_PROC_NETWORK_DUMP_XML = 43,
+ REMOTE_PROC_NETWORK_GET_AUTOSTART = 44,
+ REMOTE_PROC_NETWORK_GET_BRIDGE_NAME = 45,
+ REMOTE_PROC_NETWORK_LOOKUP_BY_NAME = 46,
+ REMOTE_PROC_NETWORK_LOOKUP_BY_UUID = 47,
+ REMOTE_PROC_NETWORK_SET_AUTOSTART = 48,
+ REMOTE_PROC_NETWORK_UNDEFINE = 49,
+ REMOTE_PROC_NUM_OF_DEFINED_NETWORKS = 50,
+ REMOTE_PROC_NUM_OF_DOMAINS = 51,
+ REMOTE_PROC_NUM_OF_NETWORKS = 52,
+ REMOTE_PROC_DOMAIN_CORE_DUMP = 53,
+ REMOTE_PROC_DOMAIN_RESTORE = 54,
+ REMOTE_PROC_DOMAIN_SAVE = 55,
+ REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE = 56,
+ REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS = 57,
+ REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS = 58,
+ REMOTE_PROC_GET_HOSTNAME = 59,
+ REMOTE_PROC_SUPPORTS_FEATURE = 60,
+ REMOTE_PROC_DOMAIN_MIGRATE_PREPARE = 61,
+ REMOTE_PROC_DOMAIN_MIGRATE_PERFORM = 62,
+ REMOTE_PROC_DOMAIN_MIGRATE_FINISH = 63,
+ REMOTE_PROC_DOMAIN_BLOCK_STATS = 64,
+ REMOTE_PROC_DOMAIN_INTERFACE_STATS = 65,
+ REMOTE_PROC_AUTH_LIST = 66,
+ REMOTE_PROC_AUTH_SASL_INIT = 67,
+ REMOTE_PROC_AUTH_SASL_START = 68,
+ REMOTE_PROC_AUTH_SASL_STEP = 69,
+ REMOTE_PROC_AUTH_POLKIT = 70,
+ REMOTE_PROC_NUM_OF_STORAGE_POOLS = 71,
+ REMOTE_PROC_LIST_STORAGE_POOLS = 72,
+ REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS = 73,
+ REMOTE_PROC_LIST_DEFINED_STORAGE_POOLS = 74,
+ REMOTE_PROC_DISCOVER_STORAGE_POOLS = 75,
+ REMOTE_PROC_STORAGE_POOL_CREATE_XML = 76,
+ REMOTE_PROC_STORAGE_POOL_DEFINE_XML = 77,
+ REMOTE_PROC_STORAGE_POOL_CREATE = 78,
+ REMOTE_PROC_STORAGE_POOL_BUILD = 79,
+ REMOTE_PROC_STORAGE_POOL_DESTROY = 80,
+ REMOTE_PROC_STORAGE_POOL_DELETE = 81,
+ REMOTE_PROC_STORAGE_POOL_UNDEFINE = 82,
+ REMOTE_PROC_STORAGE_POOL_REFRESH = 83,
+ REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_NAME = 84,
+ REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_UUID = 85,
+ REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_VOLUME = 86,
+ REMOTE_PROC_STORAGE_POOL_GET_INFO = 87,
+ REMOTE_PROC_STORAGE_POOL_DUMP_XML = 88,
+ REMOTE_PROC_STORAGE_POOL_GET_AUTOSTART = 89,
+ REMOTE_PROC_STORAGE_POOL_SET_AUTOSTART = 90,
+ REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES = 91,
+ REMOTE_PROC_STORAGE_POOL_LIST_VOLUMES = 92,
+ REMOTE_PROC_STORAGE_VOL_CREATE_XML = 93,
+ REMOTE_PROC_STORAGE_VOL_DELETE = 94,
+ REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_NAME = 95,
+ REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_KEY = 96,
+ REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH = 97,
+ REMOTE_PROC_STORAGE_VOL_GET_INFO = 98,
+ REMOTE_PROC_STORAGE_VOL_DUMP_XML = 99,
+ REMOTE_PROC_STORAGE_VOL_GET_PATH = 100,
+ REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY = 101,
+ REMOTE_PROC_NODE_GET_FREE_MEMORY = 102,
};
typedef enum remote_procedure remote_procedure;
enum remote_message_direction {
- REMOTE_CALL = 0,
- REMOTE_REPLY = 1,
- REMOTE_MESSAGE = 2,
+ REMOTE_CALL = 0,
+ REMOTE_REPLY = 1,
+ REMOTE_MESSAGE = 2,
};
typedef enum remote_message_direction remote_message_direction;
enum remote_message_status {
- REMOTE_OK = 0,
- REMOTE_ERROR = 1,
+ REMOTE_OK = 0,
+ REMOTE_ERROR = 1,
};
typedef enum remote_message_status remote_message_status;
#define REMOTE_MESSAGE_HEADER_XDR_LEN 4
struct remote_message_header {
- u_int prog;
- u_int vers;
- remote_procedure proc;
- remote_message_direction direction;
- u_int serial;
- remote_message_status status;
+ u_int prog;
+ u_int vers;
+ remote_procedure proc;
+ remote_message_direction direction;
+ u_int serial;
+ remote_message_status status;
};
typedef struct remote_message_header remote_message_header;
@@ -1172,6 +1194,9 @@ extern bool_t xdr_remote_get_max_vcpus_
extern bool_t xdr_remote_get_max_vcpus_ret (XDR *, remote_get_max_vcpus_ret*);
extern bool_t xdr_remote_node_get_info_ret (XDR *, remote_node_get_info_ret*);
extern bool_t xdr_remote_get_capabilities_ret (XDR *, remote_get_capabilities_ret*);
+extern bool_t xdr_remote_node_get_cells_free_memory_args (XDR *, remote_node_get_cells_free_memory_args*);
+extern bool_t xdr_remote_node_get_cells_free_memory_ret (XDR *, remote_node_get_cells_free_memory_ret*);
+extern bool_t xdr_remote_node_get_free_memory_ret (XDR *, remote_node_get_free_memory_ret*);
extern bool_t xdr_remote_domain_get_scheduler_type_args (XDR *, remote_domain_get_scheduler_type_args*);
extern bool_t xdr_remote_domain_get_scheduler_type_ret (XDR *, remote_domain_get_scheduler_type_ret*);
extern bool_t xdr_remote_domain_get_scheduler_parameters_args (XDR *, remote_domain_get_scheduler_parameters_args*);
@@ -1344,6 +1369,9 @@ extern bool_t xdr_remote_get_max_vcpus_a
extern bool_t xdr_remote_get_max_vcpus_ret ();
extern bool_t xdr_remote_node_get_info_ret ();
extern bool_t xdr_remote_get_capabilities_ret ();
+extern bool_t xdr_remote_node_get_cells_free_memory_args ();
+extern bool_t xdr_remote_node_get_cells_free_memory_ret ();
+extern bool_t xdr_remote_node_get_free_memory_ret ();
extern bool_t xdr_remote_domain_get_scheduler_type_args ();
extern bool_t xdr_remote_domain_get_scheduler_type_ret ();
extern bool_t xdr_remote_domain_get_scheduler_parameters_args ();
Index: qemud/remote_protocol.x
===================================================================
RCS file: /data/cvs/libvirt/qemud/remote_protocol.x,v
retrieving revision 1.11
diff -u -p -r1.11 remote_protocol.x
--- qemud/remote_protocol.x 10 Apr 2008 16:53:29 -0000 1.11
+++ qemud/remote_protocol.x 15 May 2008 21:07:31 -0000
@@ -87,6 +87,9 @@ const REMOTE_STORAGE_VOL_NAME_LIST_MAX =
/* Upper limit on list of scheduler parameters. */
const REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX = 16;
+/* Upper limit on number of NUMA cells */
+const REMOTE_NODE_MAX_CELLS = 1024;
+
/* Upper limit on SASL auth negotiation packet */
const REMOTE_AUTH_SASL_DATA_MAX = 65536;
@@ -254,6 +257,19 @@ struct remote_get_capabilities_ret {
remote_nonnull_string capabilities;
};
+struct remote_node_get_cells_free_memory_args {
+ int startCell;
+ int maxCells;
+};
+
+struct remote_node_get_cells_free_memory_ret {
+ hyper freeMems<REMOTE_NODE_MAX_CELLS>;
+};
+
+struct remote_node_get_free_memory_ret {
+ hyper freeMem;
+};
+
struct remote_domain_get_scheduler_type_args {
remote_nonnull_domain dom;
};
@@ -1017,7 +1033,10 @@ enum remote_procedure {
REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH = 97,
REMOTE_PROC_STORAGE_VOL_GET_INFO = 98,
REMOTE_PROC_STORAGE_VOL_DUMP_XML = 99,
- REMOTE_PROC_STORAGE_VOL_GET_PATH = 100
+ REMOTE_PROC_STORAGE_VOL_GET_PATH = 100,
+
+ REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY = 101,
+ REMOTE_PROC_NODE_GET_FREE_MEMORY = 102
};
/* Custom RPC structure. */
Index: qemud/rpcgen_fix.pl
===================================================================
RCS file: /data/cvs/libvirt/qemud/rpcgen_fix.pl,v
retrieving revision 1.1
diff -u -p -r1.1 rpcgen_fix.pl
--- qemud/rpcgen_fix.pl 11 Jun 2007 11:36:17 -0000 1.1
+++ qemud/rpcgen_fix.pl 15 May 2008 21:07:31 -0000
@@ -24,6 +24,8 @@ while (<>) {
next;
}
+ s/\t/ /g;
+
if (m/^}/) {
$in_function = 0;
@@ -52,7 +54,7 @@ while (<>) {
foreach (keys %uses) {
$i = $uses{$_};
unshift @function,
- ("\tchar **objp_cpp$i = (char **) (void *) &$_;\n");
+ (" char **objp_cpp$i = (char **) (void *) &$_;\n");
$i++;
}
@function =
--
|: Red Hat, Engineering, Boston -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 :|
3
8
While testing Cole's series of patches I identified a couple more places
where we leak memory.
In libvirt.c, the default authentication callback uses uninitialized
data, and indeed strdup()'s it and this is then never released. This
simply disables that bit of code.
In qparams.c when free'ing the struct the 'p' struct field was not
released. I took the opportunity to switch it over to using the new
style memory.h functions
In remote.c there were a couple of handlers which forgot to free the
virDomainPtr object when they were done.
qemud/remote.c | 18 ++++++++++++++----
src/libvirt.c | 16 +++++++++-------
src/qparams.c | 31 +++++++++++++------------------
3 files changed, 36 insertions(+), 29 deletions(-)
Dan.
Index: qemud/remote.c
===================================================================
RCS file: /data/cvs/libvirt/qemud/remote.c,v
retrieving revision 1.32
diff -u -p -r1.32 remote.c
--- qemud/remote.c 21 May 2008 20:53:30 -0000 1.32
+++ qemud/remote.c 21 May 2008 21:16:42 -0000
@@ -792,8 +792,11 @@ remoteDispatchDomainBlockStats (struct q
}
path = args->path;
- if (virDomainBlockStats (dom, path, &stats, sizeof stats) == -1)
+ if (virDomainBlockStats (dom, path, &stats, sizeof stats) == -1) {
+ virDomainFree (dom);
return -1;
+ }
+ virDomainFree (dom);
ret->rd_req = stats.rd_req;
ret->rd_bytes = stats.rd_bytes;
@@ -823,8 +826,11 @@ remoteDispatchDomainInterfaceStats (stru
}
path = args->path;
- if (virDomainInterfaceStats (dom, path, &stats, sizeof stats) == -1)
+ if (virDomainInterfaceStats (dom, path, &stats, sizeof stats) == -1) {
+ virDomainFree (dom);
return -1;
+ }
+ virDomainFree (dom);
ret->rx_bytes = stats.rx_bytes;
ret->rx_packets = stats.rx_packets;
@@ -1258,7 +1264,11 @@ remoteDispatchDomainMigratePerform (stru
args->cookie.cookie_len,
args->uri,
args->flags, dname, args->resource);
- if (r == -1) return -1;
+ if (r == -1) {
+ virDomainFree (dom);
+ return -1;
+ }
+ virDomainFree (dom);
return 0;
}
@@ -1281,7 +1291,7 @@ remoteDispatchDomainMigrateFinish (struc
if (ddom == NULL) return -1;
make_nonnull_domain (&ret->ddom, ddom);
-
+ virDomainFree (ddom);
return 0;
}
Index: src/libvirt.c
===================================================================
RCS file: /data/cvs/libvirt/src/libvirt.c,v
retrieving revision 1.140
diff -u -p -r1.140 libvirt.c
--- src/libvirt.c 21 May 2008 20:53:31 -0000 1.140
+++ src/libvirt.c 21 May 2008 21:16:45 -0000
@@ -170,13 +170,15 @@ static int virConnectAuthCallbackDefault
return -1;
}
- if (STREQ(bufptr, "") && cred[i].defresult)
- cred[i].result = strdup(cred[i].defresult);
- else
- cred[i].result = strdup(bufptr);
- if (!cred[i].result)
- return -1;
- cred[i].resultlen = strlen(cred[i].result);
+ if (cred[i].type != VIR_CRED_EXTERNAL) {
+ if (STREQ(bufptr, "") && cred[i].defresult)
+ cred[i].result = strdup(cred[i].defresult);
+ else
+ cred[i].result = strdup(bufptr);
+ if (!cred[i].result)
+ return -1;
+ cred[i].resultlen = strlen(cred[i].result);
+ }
}
return 0;
Index: src/qparams.c
===================================================================
RCS file: /data/cvs/libvirt/src/qparams.c,v
retrieving revision 1.4
diff -u -p -r1.4 qparams.c
--- src/qparams.c 28 Apr 2008 15:14:59 -0000 1.4
+++ src/qparams.c 21 May 2008 21:16:45 -0000
@@ -27,7 +27,7 @@
#include <stdarg.h>
#include "buf.h"
-
+#include "memory.h"
#include "qparams.h"
struct qparam_set *
@@ -39,13 +39,12 @@ new_qparam_set (int init_alloc, ...)
if (init_alloc <= 0) init_alloc = 1;
- ps = malloc (sizeof (*ps));
- if (!ps) return NULL;
+ if (VIR_ALLOC(ps) < 0)
+ return NULL;
ps->n = 0;
ps->alloc = init_alloc;
- ps->p = malloc (init_alloc * sizeof (ps->p[0]));
- if (!ps->p) {
- free (ps);
+ if (VIR_ALLOC_N(ps->p, ps->alloc) < 0) {
+ VIR_FREE (ps);
return NULL;
}
@@ -87,13 +86,8 @@ append_qparams (struct qparam_set *ps, .
static int
grow_qparam_set (struct qparam_set *ps)
{
- struct qparam *old_p;
-
if (ps->n >= ps->alloc) {
- old_p = ps->p;
- ps->p = realloc (ps->p, 2 * ps->alloc * sizeof (ps->p[0]));
- if (!ps->p) {
- ps->p = old_p;
+ if (VIR_REALLOC_N(ps->p, ps->alloc * 2) < 0) {
perror ("realloc");
return -1;
}
@@ -115,13 +109,13 @@ append_qparam (struct qparam_set *ps,
pvalue = strdup (value);
if (!pvalue) {
- free (pname);
+ VIR_FREE (pname);
return -1;
}
if (grow_qparam_set (ps) == -1) {
- free (pname);
- free (pvalue);
+ VIR_FREE (pname);
+ VIR_FREE (pvalue);
return -1;
}
@@ -161,10 +155,11 @@ free_qparam_set (struct qparam_set *ps)
int i;
for (i = 0; i < ps->n; ++i) {
- free (ps->p[i].name);
- free (ps->p[i].value);
+ VIR_FREE (ps->p[i].name);
+ VIR_FREE (ps->p[i].value);
}
- free (ps);
+ VIR_FREE (ps->p);
+ VIR_FREE (ps);
}
struct qparam_set *
--
|: Red Hat, Engineering, Boston -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 :|
3
4
22 May '08
Domain and Net objects were not being cleaned up properly
when reporting errors from the remote driver. Attached patch
fixes this.
Thanks,
Cole
diff --git a/src/remote_internal.c b/src/remote_internal.c
index 51e8eb7..80f6ce6 100644
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -4606,6 +4606,10 @@ server_error (virConnectPtr conn, remote_error *err)
err->str3 ? *err->str3 : NULL,
err->int1, err->int2,
"%s", err->message ? *err->message : NULL);
+ if (dom)
+ virDomainFree(dom);
+ if (net)
+ virNetworkFree(dom);
}
/* get_nonnull_domain and get_nonnull_network turn an on-wire
4
13
22 May '08
Hi,
I have got the problem solved. I could now compile the code using Storage APIs also. But I run them I am getting error message: "libvir: Remote error : unknown procedure: 72"
The API I used is: virConnectListStoragePools
What is the problem here? How could I solve this. My OS is SLES 10 sp2 and hypervisor is XEN.
Thanks,
Amudhan.
>>> Chris Lalancette <clalance(a)redhat.com> 05/22/08 12:10 AM >>>
Amudhan Gunasekaran wrote:
> Hi,
>
> I am getting the following the error when I try to use ANY storage related APIs.
>
> undefined reference to '<method name>' for example,
>
> undefined reference to virConnectListStoragePools.
>
> I checked in the libvirt.h and it has the method definition. I checked the libvirt.c and it has the implementations. I can not figure out why I get this error. I could use APIs related the network, for example virConnectListNetworks. Where could I have gone wrong and what are the work-arounds to solve them?
>
> I am using SLES 10 SP2.
This probably means that libvirtd and/or virsh is still using the old copy of
the library. If you have a libvirt package installed, and then you built the
the CVS libvirt by hand, the CVS version probably got installed somewhere to
/usr/local/lib, which is in the search path after where libvirt is probably
installed to /usr/lib. Try removing your libvirt package and doing a "make
install" in the CVS version; you should then have everything matching up.
Chris Lalancette
1
0
22 May '08
Hello,
I am facing problems in creating a network bridge using libvirt. My
requirement is, i need to create a bridge on the host machine. The bridge
shd get ip address from dhcp server(instead of static). I am not getting
what exactly the xml format that virsh is looking for?
I am using the following xml for creating a bridge.
<network>
<name>local</name>
<bridge name="virbr1" />
<source dev="eth1"/>
<mac address="00:11:22:33:44:55"/>
</network>
The bridge is getting created but not with the specified device and mac
address. Bridge is not getting ip address at all.
Can you please tell me the xml format for my requirement?
Thanks.
2
1
22 May '08
The patch below fixes an issue in the python bindings with the
vir*Destroy methods. After the object is successfully destroyed,
the payload is cleared, using 'self._o = None'. This unfortunately
screws up virt object reference counts, as the payload should be
free'd using the appropriate vir*Free function.
Thanks,
Cole
diff --git a/python/generator.py b/python/generator.py
index cb57bff..9421981 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -629,10 +629,10 @@ function_classes = {}
function_classes["None"] = []
function_post = {
- 'virDomainDestroy': "self._o = None",
- 'virNetworkDestroy': "self._o = None",
- 'virStoragePoolDestroy': "self._o = None",
- 'virStorageVolDestroy': "self._o = None",
+ 'virDomainDestroy': "del(self)",
+ 'virNetworkDestroy': "del(self)",
+ 'virStoragePoolDestroy': "del(self)",
+ 'virStorageVolDestroy': "del(self)",
}
# Functions returning an integral type which need special rules to
3
12
Some pieces of libvirt currently assume that the vir*Destroy
functions will free the passed object upon success. In
practice none of the current drivers seem to do this,
resulting in memory leaks.
The attached patch fixes the leaks I could find, as well as
changes the comments for virDomainDestroy and virNetworkDestroy
in libvirt.c to reflect reality. I also added a couple debug
statements to hash.c where domain reference counts can be
printed as they are changed.
Thanks,
Cole
diff --git a/qemud/remote.c b/qemud/remote.c
index a97641a..725152e 100644
--- a/qemud/remote.c
+++ b/qemud/remote.c
@@ -940,9 +940,11 @@ remoteDispatchDomainDestroy (struct qemud_server *server ATTRIBUTE_UNUSED,
return -2;
}
- if (virDomainDestroy (dom) == -1)
+ if (virDomainDestroy (dom) == -1) {
+ virDomainFree(dom);
return -1;
- /* No need to free dom - destroy does it for us */
+ }
+ virDomainFree(dom);
return 0;
}
diff --git a/src/hash.c b/src/hash.c
index 79421aa..a014990 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -842,6 +842,9 @@ __virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid)
goto error;
}
conn->refs++;
+ DEBUG0("virGetDomain: New hash entry.");
+ } else {
+ DEBUG("virGetDomain: Existing hash entry, refs now %d", ret->refs+1);
}
ret->refs++;
pthread_mutex_unlock(&conn->lock);
diff --git a/src/libvirt.c b/src/libvirt.c
index 97f6bc3..9f6df8e 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1390,10 +1390,9 @@ virDomainLookupByName(virConnectPtr conn, const char *name)
* @domain: a domain object
*
* Destroy the domain object. The running instance is shutdown if not down
- * already and all resources used by it are given back to the hypervisor.
- * The data structure is freed and should not be used thereafter if the
- * call does not return an error.
- * This function may requires privileged access
+ * already and all resources used by it are given back to the hypervisor. This
+ * does not free the associated virDomainPtr object.
+ * This function may require privileged access
*
* Returns 0 in case of success and -1 in case of failure.
*/
@@ -3502,10 +3501,9 @@ virNetworkCreate(virNetworkPtr network)
* @network: a network object
*
* Destroy the network object. The running instance is shutdown if not down
- * already and all resources used by it are given back to the hypervisor.
- * The data structure is freed and should not be used thereafter if the
- * call does not return an error.
- * This function may requires privileged access
+ * already and all resources used by it are given back to the hypervisor. This
+ * does not free the associated virNetworkPtr object.
+ * This function may require privileged access
*
* Returns 0 in case of success and -1 in case of failure.
*/
diff --git a/src/virsh.c b/src/virsh.c
index 45af630..234fc36 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -1468,9 +1468,9 @@ cmdDestroy(vshControl * ctl, vshCmd * cmd)
} else {
vshError(ctl, FALSE, _("Failed to destroy domain %s"), name);
ret = FALSE;
- virDomainFree(dom);
}
+ virDomainFree(dom);
return ret;
}
@@ -2433,9 +2433,9 @@ cmdNetworkDestroy(vshControl * ctl, vshCmd * cmd)
} else {
vshError(ctl, FALSE, _("Failed to destroy network %s"), name);
ret = FALSE;
- virNetworkFree(network);
}
+ virNetworkFree(network);
return ret;
}
@@ -3161,9 +3161,9 @@ cmdPoolDestroy(vshControl * ctl, vshCmd * cmd)
} else {
vshError(ctl, FALSE, _("Failed to destroy pool %s"), name);
ret = FALSE;
- virStoragePoolFree(pool);
}
+ virStoragePoolFree(pool);
return ret;
}
3
4
22 May '08
Hi Chris Lalancette,
Thanks for your quick reply. I just removed the already installed libvirt from my machine and did a *make install* in my CVS version of the code (which is in my machine at: /root/libvirt). The *make install* completed without any problems. But when I tried to compile the code, I get other error messages. I actually use the command:
gcc `pkg-config --cflags --libs libvirt` -o myexample myexample.c
The error messages I got are:
Package libvirt was not found in the pkg-config search path.
Perhaps you should add the directory containing `libvirt.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libvirt' found
myexample.c:9:29: error: libvirt/libvirt.h: No such file or directory
Previously, I used the same command to compile and it compiled without any problems (if I had not used storage related apis). I think I am doing some silly mistakes. Please help me to rectify it.
Thanks,
Amudhan.
>>> Chris Lalancette <clalance(a)redhat.com> 05/22/08 12:10 AM >>>
Amudhan Gunasekaran wrote:
> Hi,
>
> I am getting the following the error when I try to use ANY storage related APIs.
>
> undefined reference to '<method name>' for example,
>
> undefined reference to virConnectListStoragePools.
>
> I checked in the libvirt.h and it has the method definition. I checked the libvirt.c and it has the implementations. I can not figure out why I get this error. I could use APIs related the network, for example virConnectListNetworks. Where could I have gone wrong and what are the work-arounds to solve them?
>
> I am using SLES 10 SP2.
This probably means that libvirtd and/or virsh is still using the old copy of
the library. If you have a libvirt package installed, and then you built the
the CVS libvirt by hand, the CVS version probably got installed somewhere to
/usr/local/lib, which is in the search path after where libvirt is probably
installed to /usr/lib. Try removing your libvirt package and doing a "make
install" in the CVS version; you should then have everything matching up.
Chris Lalancette
1
0
Hi,
I am getting the following the error when I try to use ANY storage related APIs.
undefined reference to '<method name>' for example,
undefined reference to virConnectListStoragePools.
I checked in the libvirt.h and it has the method definition. I checked the libvirt.c and it has the implementations. I can not figure out why I get this error. I could use APIs related the network, for example virConnectListNetworks. Where could I have gone wrong and what are the work-arounds to solve them?
I am using SLES 10 SP2.
Thanks in advance,
Amudhan.
2
1
Hi,
I found few simple errors in docs/formatdomain.html while scrolling it;
the appended patch fixes them.
Anton
2
1
The previous patch to add routed networking broke the removal of one of the
FORWARD rules at shutdown. It was adding
/sbin/iptables --table filter --insert FORWARD
--destination 192.168.122.0/255.255.255.0
--out-interface virbr0 --match state
--state ESTABLISHED,RELATED --jump ACCEPT
But trying to remove
/sbin/iptables --table filter --delete FORWARD
--destination 192.168.122.0/255.255.255.0
--out-interface virbr0 --jump ACCEPT
which wasn't matching on the state flags. This patch makes it use the correct
removal code
Dan.
Index: src/qemu_driver.c
===================================================================
RCS file: /data/cvs/libvirt/src/qemu_driver.c,v
retrieving revision 1.76
diff -u -r1.76 qemu_driver.c
--- src/qemu_driver.c 16 May 2008 16:51:30 -0000 1.76
+++ src/qemu_driver.c 20 May 2008 20:41:03 -0000
@@ -1209,12 +1213,20 @@
struct qemud_network *network) {
if (network->def->forward) {
iptablesRemoveForwardMasquerade(driver->iptables,
- network->def->network,
- network->def->forwardDev);
- iptablesRemoveForwardAllowIn(driver->iptables,
- network->def->network,
- network->bridge,
- network->def->forwardDev);
+ network->def->network,
+ network->def->forwardDev);
+
+ if (network->def->forwardMode == QEMUD_NET_FORWARD_NAT)
+ iptablesRemoveForwardAllowRelatedIn(driver->iptables,
+ network->def->network,
+ network->bridge,
+ network->def->forwardDev);
+ else if (network->def->forwardMode == QEMUD_NET_FORWARD_ROUTE)
+ iptablesRemoveForwardAllowIn(driver->iptables,
+ network->def->network,
+ network->bridge,
+ network->def->forwardDev);
+
iptablesRemoveForwardAllowOut(driver->iptables,
network->def->network,
network->bridge,
--
|: Red Hat, Engineering, Boston -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 :|
2
1