[Libvir] Extra options to dnsmasq
by PATTE, Mathieu
Hi everyone!
Is there any way I can pass extra options to dnsmasq when starting a
virtual network?
I need that in order to specify static dhcp leases. (is there another
way to do that?)
Thanks,
Mathieu Patte
Electronic Ground Support Equipment Engineer
EADS Astrium
31 rue des Cosmonautes Z.I. du Palays
31402 Toulouse Cedex 4 France
Phone : +33562199032
Mail : mathieu.patte(a)astrium.eads.net
<mailto:mathieu.patte@astrium.eads.net>
Ce courriel (incluant ses eventuelles pieces jointes) peut contenir des informations confidentielles et/ou protegees ou dont la diffusion est restreinte. Si vous avez recu ce courriel par erreur, vous ne devez ni le copier, ni l'utiliser, ni en divulguer le contenu a quiconque. Merci d'en avertir immediatement l'expediteur et d'effacer ce courriel de votre systeme. Astrium decline toute responsabilite en cas de corruption par virus, d'alteration ou de falsification de ce courriel lors de sa transmission par voie electronique.
This email (including any attachments) may contain confidential and/or privileged information or information otherwise protected from disclosure. If you are not the intended recipient, please notify the sender immediately, do not copy this message or any attachments and do not use it for any purpose or disclose its content to any person, but delete this message and any attachments from your system. Astrium disclaims any and all liability if this email transmission was virus corrupted, altered or falsified.
---------------------------------------------------------------------
Astrium SAS (393 341 516 RCS Paris) - Siege social: 6 rue Laurent Pichat, 75016 Paris, France
16 years, 7 months
[Libvir] PATCH: Re-structuring the libvirt.org website content
by Daniel P. Berrange
The current way we structure and manage the website for libvirt.org is
becoming (has become) unsustainable as we add more features which in turn
require more documentation.
The first problem is all content is in a single huge file docs/libvir.html,
from which each individual page is then extracted. When adding new content
I find myself spending more time just scrolling up & down the file trying
to find my place, than actually writing content. The obvious change is
to split this file up, so that it is one file per page on the website.
With some clever XSL we can still keep the benefit of automatically merging
the content with the shared HTML layout / navigation.
The second problem is that the navigation is completely flat, giving rise
to the increasingly long set of the links down the left hand side. This
is discouraging the addition of new pages with the result too much content
is lumped together in the same page, and making it harder to navigate the
site.
I started to write some more content for the serial device format, but gave
up and decided to spent the time this weekend attempting to address these
two problems to create a more developer & user friendly website, and then
writing some more general content for the site too. The patch is rather
unsuprisingly enourmous so I am not attaching it to this mail. Instead I
have uploaded it to
http://berrange.fedorapeople.org/libvirt/libvirt-website.patch
Reading the patch isn't too interesting - you're probably more interested
in the end result, so I've also uploaded a demo copy showing the proposed
new style and site navigation:
http://berrange.fedorapeople.org/libvirt/website-demo/index.html
The 'sitemap' page is a good place to start if you want to see how it all
fits together.
NB, this demo of the site structure will be removed after a few days
because we don't want to disrupt the google index for the main site, so
if you're reading this message from the archives just go to the main
http://libvirt.org site to see how it all evolved...
The changes to the build process / source structure are as follows:
- The giant docs/libvir.html file is now removed, and all its content is
placed into individual files named XXX.html.in where XXX is the name
of the page as viewed on the site.
The markup in the XXX.html.in files consists soley of the actual page
content inside the <body> tag. There is no <head> data. There is no
navigation or style markup in these XXX.html.in files. They are the
pure content of each page. This makes writing new content very clear
and straightforward.
- There is now a hiearchical navigation structure, with 10 pages at the
top level, and the rest nested below these levels. The master structure
for the site is defined in the file sitemap.html.in which is also
exposed directly on the site
http://berrange.fedorapeople.org/libvirt/website-demo/sitemap.html
- The page.xsl file reads the site structure from the sitemap.html.in file
and builds up a context-sensitive menu on the left hand site of every
page. Sub-levels in the hierarchy will be automatically expanded as
neccessary.
- Content from the XXX.html.in files is processed by the site.xsl transform
to add in the page navigation and metadata. The site.xsl transform calls
to the page.xsl file to pull in navigation. The resulting generated pages
are named XXX.html as before.
- The newapi.xsl file has been updated to make use of page.xsl to pull
in the navigation menu to the API reference pages.
- The ChangeLog.xsl file has been updated to make use of page.xsl to
pull in the navigation menu
Adding a new page is now very straightforward:
- Create a new file XXX.html.in in the docs/ directory and write the
content you desire
- Edit the docs/sitemap.html.in file and add a link to the new page at
the appropriate place in the site hierarchy - this automagically deals
with the left hand context nav menu.
- Type 'make web' to generate the XXX.html page with navigation and
update navigation in the other pages.
Finally the content changes / additions. First of all, all existing content
from the site is still there - it has merely been re-arranged in places.
- The content on the front page is refreshed to give a succinct summary
of what libvirt is about, inspired by the oVirt front page:
http://berrange.fedorapeople.org/libvirt/website-demo/index.html
- There is a page for every hypervisor driver, which is intended to
describe the requirements of the driver, and provide example XML
documents for the driver. I have added some basic content for
the Xen and QEMU drivers - other drivers still need docs
http://berrange.fedorapeople.org/libvirt/website-demo/drvxen.html
http://berrange.fedorapeople.org/libvirt/website-demo/drvqemu.html
- There is a page for every XML format used by libvirt. I've mostly
copied content from the existing format.html and storage.html pages
into these new pages unchanged, and added some info on the virtual
network XML. All of thee pages need some major revision though, since
the existing content is severely out of date for domains, and
capabilities.
http://berrange.fedorapeople.org/libvirt/website-demo/formatdomain.html
http://berrange.fedorapeople.org/libvirt/website-demo/formatnetwork.html
http://berrange.fedorapeople.org/libvirt/website-demo/formatstorage.html
http://berrange.fedorapeople.org/libvirt/website-demo/formatcaps.html
- There is a page for every major subsystem in libvirt, describing the
concepts behind that part of the API. There are pages for domains,
networks, storage and node devices. Again we have a need for more content
in this area to give developers a high level overview of our API concepts.
Much of this information exists in email threads from the time at which
we designed the APIs (in particular true for storage & network APIs).
http://berrange.fedorapeople.org/libvirt/website-demo/intro.html
http://berrange.fedorapeople.org/libvirt/website-demo/archdomain.html
http://berrange.fedorapeople.org/libvirt/website-demo/archnetwork.html
http://berrange.fedorapeople.org/libvirt/website-demo/archstorage.html
- There are pages for language bindings, though there is only content
for python
http://berrange.fedorapeople.org/libvirt/website-demo/bindings.html
http://berrange.fedorapeople.org/libvirt/website-demo/python.html
- There are pages focusing on deployment issues such as building / install
of libvirt, deploying on windows, remote management config, authentication
config and URI formats. This content is all unchanged from existing
pages
http://berrange.fedorapeople.org/libvirt/website-demo/uri.html
http://berrange.fedorapeople.org/libvirt/website-demo/remote.html
http://berrange.fedorapeople.org/libvirt/website-demo/auth.html
http://berrange.fedorapeople.org/libvirt/website-demo/windows.html
- The API docs are of course seemlessly included in the site structure
http://berrange.fedorapeople.org/libvirt/website-demo/html/index.html
http://berrange.fedorapeople.org/libvirt/website-demo/html/libvirt-libvir...
http://berrange.fedorapeople.org/libvirt/website-demo/html/libvirt-virter...
IMHO, we could do with re-structuring these APIs docs though. The main
libvirt-libvirt.html page is getting too large to deal with. It would
be better for developers if we could split up into sections for each
of the major public objects, virConnectPtr, virDomainPtr, virNetworkPtr
virStoragePoolPtr and virStorageVolPtr and their associated APIs.
This shouldn't be too hard todo with a little tweaking of the API docs
generator.
- The related links are now on a page of their own, since the list on
the left hand menu was getting too large.
http://berrange.fedorapeople.org/libvirt/website-demo/relatedlinks.html
- There is a page describing all applications using libvirt as their API
http://berrange.fedorapeople.org/libvirt/website-demo/apps.html
Shout if you have more applications you want added to this page...
- Expanded content a little wrt to bug reporting and mailing lists
http://berrange.fedorapeople.org/libvirt/website-demo/bugs.html
http://berrange.fedorapeople.org/libvirt/website-demo/contact.html
- Linked to the new wiki site, and added seemless integration betweeen
the wiki navigation & styling, and the main site.
- There is a new updated CSS graphic design - I can't take credit for
that - it is from mockups done by one of the Red Hat designers.
Again, if all this is too much to take in, just go straight to the sitemap
page on the demo site and click around...
http://berrange.fedorapeople.org/libvirt/website-demo/sitemap.html
The patch for all this is at
http://berrange.fedorapeople.org/libvirt/libvirt-website.patch
The giant and fairly meaningless diffstat is:
ChangeLog.xsl | 72
FAQ.html | 225 +-
FAQ.html.in | 144 +
Makefile.am | 49
apps.html | 179 +
apps.html.in | 108
archdomain.html | 99
archdomain.html.in | 5
architecture.html | 142 +
architecture.html.in | 101
archnetwork.html | 99
archnetwork.html.in | 5
archnode.html | 99
archnode.html.in | 5
archstorage.html | 119 +
archstorage.html.in | 30
auth.html | 198 +
auth.html.in | 183 +
bindings.html | 109
bindings.html.in | 24
bugs.html | 141 +
bugs.html.in | 82
contact.html | 91
contact.html.in | 37
deployment.html | 131 +
deployment.html.in | 46
devhelp/libvirt-virterror.html | 6
docs.html | 85
docs.html.in | 5
downloads.html | 142 +
downloads.html.in | 89
drivers.html | 146 +
drivers.html.in | 27
drvlxc.html | 108
drvlxc.html.in | 5
drvopenvz.html | 108
drvopenvz.html.in | 5
drvqemu.html | 187 +
drvqemu.html.in | 97
drvremote.html | 108
drvremote.html.in | 5
drvtest.html | 108
drvtest.html.in | 5
drvxen.html | 303 ++
drvxen.html.in | 221 +
errors.html | 141 -
errors.html.in | 83
format.html | 450 +---
format.html.in | 243 ++
formatcaps.html | 165 +
formatcaps.html.in | 70
formatdomain.html | 115 +
formatdomain.html.in | 18
formatnetwork.html | 175 +
formatnetwork.html.in | 93
formatnode.html | 102
formatnode.html.in | 5
formatstorage.html | 331 ++
formatstorage.html.in | 237 ++
generic.css | 74
html/book1.html | 3
html/index.html | 5
html/libvirt-conf.html | 44
html/libvirt-lib.html | 3
html/libvirt-libvirt.html | 961 +++-----
html/libvirt-virterror.html | 173 -
hvsupport.html | 1031 +++++----
hvsupport.html.in | 597 +++++
index.html | 238 --
index.html.in | 68
intro.html | 132 +
intro.html.in | 46
libvir.html | 4596 -----------------------------------------
libvirt-api.xml | 6
libvirt-header-bg.png |binary
libvirt-header-logo.png |binary
libvirt-net-logical.fig | 159 +
libvirt-net-logical.png |binary
libvirt-net-physical.fig | 139 +
libvirt-net-physical.png |binary
libvirt-refs.xml | 7
libvirt.css | 345 +--
main.css | 2
newapi.xsl | 380 +--
news.html | 462 ++--
news.html.in | 607 +++++
page.xsl | 94
python.html | 161 +
python.html.in | 71
relatedlinks.html | 114 +
relatedlinks.html.in | 55
remote.html | 851 +++++--
remote.html.in | 893 +++++++
site.xsl | 407 ---
sitemap.html | 279 ++
sitemap.html.in | 220 +
storage.html | 963 +++-----
storage.html.in | 354 +++
uri.html | 349 ++-
uri.html.in | 295 ++
windows.html | 303 +-
windows.html.in | 239 ++
103 files changed, 13910 insertions(+), 8327 deletions(-)
Regards,
Daniel.
--
|: 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 :|
16 years, 7 months
[Libvir] PATCH: Use macros to remove duplicate test code
by Daniel P. Berrange
The test suite files contain alot of boilerplate duplicated code. With a
few more macros I can significantly cut down the size of the test code.
I also change abs_top_srcdir to abs_srcdir, and automatically initialize
it to 'getcwd' if the env variable is missing. This lets me run the test
cases directly, rather than having to go via 'make check'.
statstest.c | 207 ++++++++++++++++++++++-------------------------------
test_conf.sh | 16 +++-
xencapstest.c | 10 --
xmconfigtest.c | 220 ++++++++++++---------------------------------------------
4 files changed, 149 insertions(+), 304 deletions(-)
Dan.
Index: statstest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/statstest.c,v
retrieving revision 1.5
diff -u -p -r1.5 statstest.c
--- statstest.c 10 Apr 2008 16:53:29 -0000 1.5
+++ statstest.c 18 Apr 2008 00:29:55 -0000
@@ -7,6 +7,8 @@
#include "stats_linux.h"
#include "internal.h"
+#include "testutils.h"
+
#if WITH_XEN
static void testQuietError(void *userData ATTRIBUTE_UNUSED,
virErrorPtr error ATTRIBUTE_UNUSED)
@@ -21,13 +23,26 @@ static int testDevice(const char *path,
int actual = xenLinuxDomainDeviceID(NULL, 1, path);
if (actual == expect) {
- fprintf(stderr, "%-14s == %-6d OK\n", path, expect);
return 0;
} else {
- fprintf(stderr, "%-14s == %-6d (%-6d) FAILED\n", path, expect, actual);
+ if (getenv("DEBUG_TESTS"))
+ fprintf(stderr, "Expect %-6d Actual %-6d\n", expect, actual);
return -1;
}
}
+
+struct testInfo
+{
+ const char *dev;
+ int num;
+};
+
+static int testDeviceHelper(const void *data)
+{
+ const struct testInfo *info = data;
+ return testDevice(info->dev, info->num);
+}
+
#endif
int
@@ -42,85 +57,67 @@ main(void)
if (!getenv("DEBUG_TESTS"))
virSetErrorFunc(NULL, testQuietError);
+#define DO_TEST(dev, num) \
+ do { \
+ struct testInfo info = { dev, num }; \
+ if (virtTestRun("Device " dev " -> " # num, \
+ 1, testDeviceHelper, &info) < 0) \
+ ret = -1; \
+ } while (0)
+
/********************************
* Xen paravirt disks
********************************/
/* first valid disk */
- if (testDevice("xvda", 51712) < 0)
- ret = -1;
- if (testDevice("xvda1", 51713) < 0)
- ret = -1;
- if (testDevice("xvda15", 51727) < 0)
- ret = -1;
+ DO_TEST("xvda", 51712);
+ DO_TEST("xvda1", 51713);
+ DO_TEST("xvda15", 51727);
/* Last valid disk */
- if (testDevice("xvdp", 51952) < 0)
- ret = -1;
- if (testDevice("xvdp1", 51953) < 0)
- ret = -1;
- if (testDevice("xvdp15", 51967) < 0)
- ret = -1;
+ DO_TEST("xvdp", 51952);
+ DO_TEST("xvdp1", 51953);
+ DO_TEST("xvdp15", 51967);
/* Disk letter to large */
- if (testDevice("xvdq", -1) < 0)
- ret = -1;
+ DO_TEST("xvdq", -1);
/* missing disk letter */
- if (testDevice("xvd1", -1) < 0)
- ret = -1;
+ DO_TEST("xvd1", -1);
/* partition to large */
- if (testDevice("xvda16", -1) < 0)
- ret = -1;
+ DO_TEST("xvda16", -1);
/* partition to small */
- if (testDevice("xvda0", -1) < 0)
- ret = -1;
+ DO_TEST("xvda0", -1);
/* leading zeros */
- if (testDevice("xvda01", -1) < 0)
- ret = -1;
+ DO_TEST("xvda01", -1);
/* leading + */
- if (testDevice("xvda+1", -1) < 0)
- ret = -1;
+ DO_TEST("xvda+1", -1);
/* leading - */
- if (testDevice("xvda-1", -1) < 0)
- ret = -1;
+ DO_TEST("xvda-1", -1);
/********************************
* IDE disks
********************************/
/* odd numbered disk */
- if (testDevice("hda", 768) < 0)
- ret = -1;
- if (testDevice("hda1", 769) < 0)
- ret = -1;
- if (testDevice("hda63", 831) < 0)
- ret = -1;
+ DO_TEST("hda", 768);
+ DO_TEST("hda1", 769);
+ DO_TEST("hda63", 831);
/* even number disk */
- if (testDevice("hdd", 5695) < 0)
- ret = -1;
- if (testDevice("hdd1", 5696) < 0)
- ret = -1;
- if (testDevice("hdd63", 5758) < 0)
- ret = -1;
+ DO_TEST("hdd", 5695);
+ DO_TEST("hdd1", 5696);
+ DO_TEST("hdd63", 5758);
/* last valid disk */
- if (testDevice("hdt", 23359) < 0)
- ret = -1;
- if (testDevice("hdt1", 23360) < 0)
- ret = -1;
- if (testDevice("hdt63", 23422) < 0)
- ret = -1;
+ DO_TEST("hdt", 23359);
+ DO_TEST("hdt1", 23360);
+ DO_TEST("hdt63", 23422);
/* Disk letter to large */
- if (testDevice("hdu", -1) < 0)
- ret = -1;
+ DO_TEST("hdu", -1);
/* missing disk letter */
- if (testDevice("hd1", -1) < 0)
- ret = -1;
+ DO_TEST("hd1", -1);
/* partition to large */
- if (testDevice("hda64", -1) < 0)
- ret = -1;
+ DO_TEST("hda64", -1);
/* partition to small */
- if (testDevice("hda0", -1) < 0)
- ret = -1;
+ DO_TEST("hda0", -1);
@@ -129,89 +126,55 @@ main(void)
********************************/
/* first valid disk */
- if (testDevice("sda", 2048) < 0)
- ret = -1;
- if (testDevice("sda1", 2049) < 0)
- ret = -1;
- if (testDevice("sda15", 2063) < 0)
- ret = -1;
+ DO_TEST("sda", 2048);
+ DO_TEST("sda1", 2049);
+ DO_TEST("sda15", 2063);
/* last valid disk of first SCSI major number */
- if (testDevice("sdp", 2288) < 0)
- ret = -1;
- if (testDevice("sdp1", 2289) < 0)
- ret = -1;
- if (testDevice("sdp15", 2303) < 0)
- ret = -1;
+ DO_TEST("sdp", 2288);
+ DO_TEST("sdp1", 2289);
+ DO_TEST("sdp15", 2303);
/* first valid disk of second SCSI major number */
- if (testDevice("sdq", 16640) < 0)
- ret = -1;
- if (testDevice("sdq1", 16641) < 0)
- ret = -1;
- if (testDevice("sdq15", 16655) < 0)
- ret = -1;
+ DO_TEST("sdq", 16640);
+ DO_TEST("sdq1", 16641);
+ DO_TEST("sdq15", 16655);
/* last valid single letter disk */
- if (testDevice("sdz", 16784) < 0)
- ret = -1;
- if (testDevice("sdz1", 16785) < 0)
- ret = -1;
- if (testDevice("sdz15", 16799) < 0)
- ret = -1;
+ DO_TEST("sdz", 16784);
+ DO_TEST("sdz1", 16785);
+ DO_TEST("sdz15", 16799);
/* first valid dual letter disk */
- if (testDevice("sdaa", 16800) < 0)
- ret = -1;
- if (testDevice("sdaa1", 16801) < 0)
- ret = -1;
- if (testDevice("sdaa15", 16815) < 0)
- ret = -1;
+ DO_TEST("sdaa", 16800);
+ DO_TEST("sdaa1", 16801);
+ DO_TEST("sdaa15", 16815);
/* second valid dual letter disk */
- if (testDevice("sdab", 16816) < 0)
- ret = -1;
- if (testDevice("sdab1", 16817) < 0)
- ret = -1;
- if (testDevice("sdab15", 16831) < 0)
- ret = -1;
+ DO_TEST("sdab", 16816);
+ DO_TEST("sdab1", 16817);
+ DO_TEST("sdab15", 16831);
/* first letter of second sequence of dual letter disk */
- if (testDevice("sdba", 17216) < 0)
- ret = -1;
- if (testDevice("sdba1", 17217) < 0)
- ret = -1;
- if (testDevice("sdba15", 17231) < 0)
- ret = -1;
+ DO_TEST("sdba", 17216);
+ DO_TEST("sdba1", 17217);
+ DO_TEST("sdba15", 17231);
/* last valid dual letter disk */
- if (testDevice("sdiv", 34800) < 0)
- ret = -1;
- if (testDevice("sdiv1", 34801) < 0)
- ret = -1;
- if (testDevice("sdiv15", 34815) < 0)
- ret = -1;
+ DO_TEST("sdiv", 34800);
+ DO_TEST("sdiv1", 34801);
+ DO_TEST("sdiv15", 34815);
/* Disk letter to large */
- if (testDevice("sdix", -1) < 0)
- ret = -1;
+ DO_TEST("sdix", -1);
/* missing disk letter */
- if (testDevice("sd1", -1) < 0)
- ret = -1;
+ DO_TEST("sd1", -1);
/* partition to large */
- if (testDevice("sda16", -1) < 0)
- ret = -1;
+ DO_TEST("sda16", -1);
/* partition to small */
- if (testDevice("sda0", -1) < 0)
- ret = -1;
+ DO_TEST("sda0", -1);
/* Path stripping */
- if (testDevice("/dev", -1) < 0)
- ret = -1;
- if (testDevice("/dev/", -1) < 0)
- ret = -1;
- if (testDevice("/dev/xvd", -1) < 0)
- ret = -1;
- if (testDevice("/dev/xvda", 51712) < 0)
- ret = -1;
- if (testDevice("/dev/xvda1", 51713) < 0)
- ret = -1;
- if (testDevice("/dev/xvda15", 51727) < 0)
- ret = -1;
+ DO_TEST("/dev", -1);
+ DO_TEST("/dev/", -1);
+ DO_TEST("/dev/xvd", -1);
+ DO_TEST("/dev/xvda", 51712);
+ DO_TEST("/dev/xvda1", 51713);
+ DO_TEST("/dev/xvda15", 51727);
#endif
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
Index: test_conf.sh
===================================================================
RCS file: /data/cvs/libvirt/tests/test_conf.sh,v
retrieving revision 1.4
diff -u -p -r1.4 test_conf.sh
--- test_conf.sh 5 Feb 2008 19:27:37 -0000 1.4
+++ test_conf.sh 18 Apr 2008 00:29:55 -0000
@@ -1,8 +1,15 @@
#!/bin/bash
-set -x
+#set -x
+set -e
+if [ -z "$abs_srcdir" ]; then
+ abs_srcdir=`pwd`
+fi
+
NOK=0
-for f in $abs_top_srcdir/tests/confdata/*.conf
+i=1
+for f in $abs_srcdir/confdata/*.conf
do
+ n=`echo $f | sed -e "s,$abs_srcdir/confdata/,,"`
./conftest $f > conftest.$$
outfile=`echo "$f" | sed s+\.conf$+\.out+`
diff $outfile conftest.$$ > /dev/null
@@ -11,11 +18,12 @@ do
if [ -n "$DEBUG_TESTS" ]; then
diff -u $outfile conftest.$$
fi
- echo "$f FAILED"
+ printf "%2d) %-60s ... %s\n" $i $n "FAILED"
NOK=1
else
- echo "$f OK"
+ printf "%2d) %-60s ... %s\n" $i $n "OK"
fi
+ i=`expr $i + 1`
done
rm -f conftest.$$
exit $NOK
Index: xencapstest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/xencapstest.c,v
retrieving revision 1.11
diff -u -p -r1.11 xencapstest.c
--- xencapstest.c 10 Apr 2008 16:54:54 -0000 1.11
+++ xencapstest.c 18 Apr 2008 00:29:56 -0000
@@ -50,14 +50,10 @@ static int testCompareFiles(const char *
if (!(actualxml = xenHypervisorMakeCapabilitiesXML(NULL, hostmachine, fp1, fp2)))
goto fail;
- if (getenv("DEBUG_TESTS") &&
- STRNEQ(expectxml, actualxml)) {
- printf("In test file %s:\n", capabilities);
- printf("Expect %d '%s'\n", (int)strlen(expectxml), expectxml);
- printf("Actual %d '%s'\n", (int)strlen(actualxml), actualxml);
+ if (STRNEQ(expectxml, actualxml)) {
+ virtTestDifference(stderr, expectxml, actualxml);
+ goto fail;
}
- if (strcmp(expectxml, actualxml))
- goto fail;
ret = 0;
Index: xmconfigtest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/xmconfigtest.c,v
retrieving revision 1.13
diff -u -p -r1.13 xmconfigtest.c
--- xmconfigtest.c 10 Apr 2008 16:53:29 -0000 1.13
+++ xmconfigtest.c 18 Apr 2008 00:29:56 -0000
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#ifdef WITH_XEN
@@ -35,11 +36,11 @@
#include "conf.h"
static char *progname;
-static char *abs_top_srcdir;
+static char *abs_srcdir;
#define MAX_FILE 4096
-static int testCompareParseXML(const char *xmcfg_rel, const char *xml_rel,
+static int testCompareParseXML(const char *xmcfg, const char *xml,
int xendConfigVersion) {
char xmlData[MAX_FILE];
char xmcfgData[MAX_FILE];
@@ -53,11 +54,6 @@ static int testCompareParseXML(const cha
int wrote = MAX_FILE;
void *old_priv = NULL;
struct _xenUnifiedPrivate priv;
- char xmcfg[PATH_MAX];
- char xml[PATH_MAX];
-
- snprintf(xmcfg, sizeof xmcfg - 1, "%s/tests/%s", abs_top_srcdir, xmcfg_rel);
- snprintf(xml, sizeof xml - 1, "%s/tests/%s", abs_top_srcdir, xml_rel);
conn = virConnectOpenReadOnly("test:///default");
if (!conn) goto fail;
@@ -80,11 +76,8 @@ static int testCompareParseXML(const cha
goto fail;
gotxmcfgPtr[wrote] = '\0';
- if (strcmp(xmcfgData, gotxmcfgData)) {
- if (getenv("DEBUG_TESTS")) {
- printf("Expect %d '%s'\n", (int)strlen(xmcfgData), xmcfgData);
- printf("Actual %d '%s'\n", (int)strlen(gotxmcfgData), gotxmcfgData);
- }
+ if (STRNEQ(xmcfgData, gotxmcfgData)) {
+ virtTestDifference(stderr, xmcfgData, gotxmcfgData);
goto fail;
}
@@ -102,7 +95,7 @@ static int testCompareParseXML(const cha
return ret;
}
-static int testCompareFormatXML(const char *xmcfg_rel, const char *xml_rel,
+static int testCompareFormatXML(const char *xmcfg, const char *xml,
int xendConfigVersion) {
char xmlData[MAX_FILE];
char xmcfgData[MAX_FILE];
@@ -114,11 +107,6 @@ static int testCompareFormatXML(const ch
virConnectPtr conn;
void *old_priv;
struct _xenUnifiedPrivate priv;
- char xmcfg[PATH_MAX];
- char xml[PATH_MAX];
-
- snprintf(xmcfg, sizeof xmcfg - 1, "%s/tests/%s", abs_top_srcdir, xmcfg_rel);
- snprintf(xml, sizeof xml - 1, "%s/tests/%s", abs_top_srcdir, xml_rel);
conn = virConnectOpenReadOnly("test:///default");
if (!conn) goto fail;
@@ -163,102 +151,25 @@ static int testCompareFormatXML(const ch
return ret;
}
-static int testCompareParavirtOldPVFBFormat(const void *data ATTRIBUTE_UNUSED) {
- return testCompareFormatXML("xmconfigdata/test-paravirt-old-pvfb.cfg",
- "xmconfigdata/test-paravirt-old-pvfb.xml",
- 2);
-}
-static int testCompareParavirtOldPVFBParse(const void *data ATTRIBUTE_UNUSED) {
- return testCompareParseXML("xmconfigdata/test-paravirt-old-pvfb.cfg",
- "xmconfigdata/test-paravirt-old-pvfb.xml",
- 2);
-}
-
-static int testCompareParavirtNewPVFBFormat(const void *data ATTRIBUTE_UNUSED) {
- return testCompareFormatXML("xmconfigdata/test-paravirt-new-pvfb.cfg",
- "xmconfigdata/test-paravirt-new-pvfb.xml",
- 3);
-}
-static int testCompareParavirtNewPVFBParse(const void *data ATTRIBUTE_UNUSED) {
- return testCompareParseXML("xmconfigdata/test-paravirt-new-pvfb.cfg",
- "xmconfigdata/test-paravirt-new-pvfb.xml",
- 3);
-}
-
-static int testCompareFullvirtOldCDROMFormat(const void *data ATTRIBUTE_UNUSED) {
- return testCompareFormatXML("xmconfigdata/test-fullvirt-old-cdrom.cfg",
- "xmconfigdata/test-fullvirt-old-cdrom.xml",
- 1);
-}
-static int testCompareFullvirtOldCDROMParse(const void *data ATTRIBUTE_UNUSED) {
- return testCompareParseXML("xmconfigdata/test-fullvirt-old-cdrom.cfg",
- "xmconfigdata/test-fullvirt-old-cdrom.xml",
- 1);
-}
-
-static int testCompareFullvirtNewCDROMFormat(const void *data ATTRIBUTE_UNUSED) {
- return testCompareFormatXML("xmconfigdata/test-fullvirt-new-cdrom.cfg",
- "xmconfigdata/test-fullvirt-new-cdrom.xml",
- 2);
-}
-static int testCompareFullvirtNewCDROMParse(const void *data ATTRIBUTE_UNUSED) {
- return testCompareParseXML("xmconfigdata/test-fullvirt-new-cdrom.cfg",
- "xmconfigdata/test-fullvirt-new-cdrom.xml",
- 2);
-}
-
-static int testCompareFullvirtClockUTCFormat(const void *data ATTRIBUTE_UNUSED) {
- return testCompareFormatXML("xmconfigdata/test-fullvirt-utc.cfg",
- "xmconfigdata/test-fullvirt-utc.xml",
- 2);
-}
-static int testCompareFullvirtClockUTCParse(const void *data ATTRIBUTE_UNUSED) {
- return testCompareParseXML("xmconfigdata/test-fullvirt-utc.cfg",
- "xmconfigdata/test-fullvirt-utc.xml",
- 2);
-}
-
-static int testCompareFullvirtClockLocaltimeFormat(const void *data ATTRIBUTE_UNUSED) {
- return testCompareFormatXML("xmconfigdata/test-fullvirt-localtime.cfg",
- "xmconfigdata/test-fullvirt-localtime.xml",
- 2);
-}
-
-static int testCompareFullvirtClockLocaltimeParse(const void *data ATTRIBUTE_UNUSED) {
- return testCompareParseXML("xmconfigdata/test-fullvirt-localtime.cfg",
- "xmconfigdata/test-fullvirt-localtime.xml",
- 2);
-}
-
-static int testCompareFullvirtInputUSBTabletFormat(const void *data ATTRIBUTE_UNUSED) {
- return testCompareFormatXML("xmconfigdata/test-fullvirt-usbtablet.cfg",
- "xmconfigdata/test-fullvirt-usbtablet.xml",
- 2);
-}
+struct testInfo {
+ const char *name;
+ int version;
+ int mode;
+};
-static int testCompareFullvirtInputUSBTabletParse(const void *data ATTRIBUTE_UNUSED) {
- return testCompareParseXML("xmconfigdata/test-fullvirt-usbtablet.cfg",
- "xmconfigdata/test-fullvirt-usbtablet.xml",
- 2);
-}
-
-static int testCompareFullvirtInputUSBTabletNoBusParse(const void *data ATTRIBUTE_UNUSED) {
- return testCompareParseXML("xmconfigdata/test-fullvirt-usbtablet.cfg",
- "xmconfigdata/test-fullvirt-usbtablet-no-bus.xml",
- 2);
-}
-
-static int testCompareFullvirtInputUSBMouseFormat(const void *data ATTRIBUTE_UNUSED) {
- return testCompareParseXML("xmconfigdata/test-fullvirt-usbmouse.cfg",
- "xmconfigdata/test-fullvirt-usbmouse.xml",
- 2);
-}
-
-static int testCompareFullvirtInputUSBMouseParse(const void *data ATTRIBUTE_UNUSED) {
- return testCompareParseXML("xmconfigdata/test-fullvirt-usbmouse.cfg",
- "xmconfigdata/test-fullvirt-usbmouse.xml",
- 2);
+static int testCompareHelper(const void *data) {
+ const struct testInfo *info = data;
+ char xml[PATH_MAX];
+ char cfg[PATH_MAX];
+ snprintf(xml, PATH_MAX, "%s/xmconfigdata/test-%s.xml",
+ abs_srcdir, info->name);
+ snprintf(cfg, PATH_MAX, "%s/xmconfigdata/test-%s.cfg",
+ abs_srcdir, info->name);
+ if (info->mode == 0)
+ return testCompareParseXML(cfg, xml, info->version);
+ else
+ return testCompareFormatXML(cfg, xml, info->version);
}
@@ -266,6 +177,7 @@ int
main(int argc, char **argv)
{
int ret = 0;
+ char cwd[PATH_MAX];
progname = argv[0];
@@ -274,65 +186,31 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
- abs_top_srcdir = getenv("abs_top_srcdir");
- if (!abs_top_srcdir)
- return 1;
-
- /* Config -> XML */
- if (virtTestRun("Paravirt old PVFB (Format)",
- 1, testCompareParavirtOldPVFBFormat, NULL) != 0)
- ret = -1;
- if (virtTestRun("Paravirt new PVFB (Format)",
- 1, testCompareParavirtNewPVFBFormat, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt old PVFB (Format)",
- 1, testCompareFullvirtOldCDROMFormat, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt new PVFB (Format)",
- 1, testCompareFullvirtNewCDROMFormat, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt clock Localtime (Format)",
- 1, testCompareFullvirtClockLocaltimeFormat, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt clock UTC (Format)",
- 1, testCompareFullvirtClockUTCFormat, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt USB mouse (Format)",
- 1, testCompareFullvirtInputUSBMouseFormat, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt USB tablet (Format)",
- 1, testCompareFullvirtInputUSBTabletFormat, NULL) != 0)
- ret = -1;
-
- /* XML -> Config */
- if (virtTestRun("Paravirt old PVFB (Parse)",
- 1, testCompareParavirtOldPVFBParse, NULL) != 0)
- ret = -1;
- if (virtTestRun("Paravirt new PVFB (Parse)",
- 1, testCompareParavirtNewPVFBParse, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt old PVFB (Parse)",
- 1, testCompareFullvirtOldCDROMParse, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt new PVFB (Parse)",
- 1, testCompareFullvirtNewCDROMParse, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt clock Localtime (Parse)",
- 1, testCompareFullvirtClockLocaltimeParse, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt clock UTC (Parse)",
- 1, testCompareFullvirtClockUTCParse, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt USB mouse (Parse)",
- 1, testCompareFullvirtInputUSBMouseParse, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt USB tablet (Parse)",
- 1, testCompareFullvirtInputUSBTabletParse, NULL) != 0)
- ret = -1;
- if (virtTestRun("Fullvirt USB tablet no bus (Parse)",
- 1, testCompareFullvirtInputUSBTabletNoBusParse, NULL) != 0)
- ret = -1;
-
+ abs_srcdir = getenv("abs_srcdir");
+ if (!abs_srcdir)
+ abs_srcdir = getcwd(cwd, sizeof(cwd));
+
+
+#define DO_TEST(name, version) \
+ do { \
+ struct testInfo info0 = { name, version, 0 }; \
+ struct testInfo info1 = { name, version, 1 }; \
+ if (virtTestRun("Xen XM-2-XML Parse " name, \
+ 1, testCompareHelper, &info0) < 0) \
+ ret = -1; \
+ if (virtTestRun("Xen XM-2-XML Format " name, \
+ 1, testCompareHelper, &info1) < 0) \
+ ret = -1; \
+ } while (0)
+
+ DO_TEST("paravirt-old-pvfb", 2);
+ DO_TEST("paravirt-new-pvfb", 3);
+ DO_TEST("fullvirt-old-cdrom", 1);
+ DO_TEST("fullvirt-new-cdrom", 2);
+ DO_TEST("fullvirt-utc", 2);
+ DO_TEST("fullvirt-localtime", 2);
+ DO_TEST("fullvirt-usbtablet", 2);
+ DO_TEST("fullvirt-usbmouse", 2);
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 :|
16 years, 7 months
[Libvir] MinGW patch
by Richard W.M. Jones
I got about 95% of the way towards compiling on MinGW using the MinGW
cross-compiler from http://mirzam.it.vu.nl/mingw/. Attached are some
fairly non-controversial patches which fix some of the problems I
found. Build notes follow below.
Rich.
----------------------------------------------------------------------
Install the MinGW cross-compiler.
Compile and install the following packages:
(1) libgpg-error
(2) libgcrypt
(3) gnutls
(4) libxml2
(5) PortableXDR
I'm building into a local area. Most of them will compile straight
with:
CFLAGS="-I$HOME/win32/include" \
LDFLAGS="-L$HOME/win32/lib" \
./configure --host=i386-mingw32 --prefix=$HOME/win32
make
make install
GnuTLS (3) is troublesome. I ended up using version 1.6.3, upgrading
the gnulib packages in the gl/ subdirectory, and doing a bit of
bug-fixing on the Makefile.am files (mainly just making sure my custom
LDFLAGS gets through everywhere).
Then build libvirt + attached patch:
PKG_CONFIG_PATH=$HOME/win32/lib/pkgconfig \
CFLAGS="-I$HOME/win32/include" \
LDFLAGS="-L$HOME/win32/lib" \
./configure --host=i386-mingw32 --prefix=$HOME/win32 \
--without-xen --without-qemu --without-libvirtd \
--without-sasl --without-python
make
[Currently it fails when linking virsh because of the usual weirdness
in libtool]
--
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
16 years, 7 months
[Libvir] FYI, typo fix
by Jim Meyering
I updated and couldn't compile.
Here's the fix:
avoid compile error when <pthread.h> is absent
* src/internal.h (HAVE_PTHREAD_H): Test with "#ifdef", not "#if".
diff --git a/src/internal.h b/src/internal.h
index 6b2b633..6bed477 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -12,7 +12,7 @@
#include <sys/syslimits.h>
#endif
-#if HAVE_PTHREAD_H
+#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#define PTHREAD_MUTEX_T(v) pthread_mutex_t v
#else
--
1.5.5.68.gd193e
16 years, 7 months
[Libvir] PATCH: Make test suite debug mode more friendly
by Daniel P. Berrange
When the test suites fail, we have a DEBUG_TESTS=1 environment variable
which can be set to show the full XML doc or string pair that failed to
match. Unfortunately these docs can be quite large, so it is hard to
spot the difference between the actual and expected output.
So this patch introduces a virtTestDifference(actual, expect) method
which will trim the head & tail of the actual & expected strings until
the point at which they differ. This gives immediate clear feedback on
where the bug is
Second, it will enumerate each test condition & pretty print align things
a little better.
When I apply this to a test which fails, i now see output like this:
19) Xen SEXPR-2-XML fv-usbmouse -> fv-usbmouse ...
Expect [localtime'/>
<devices>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
<target dev='hda'/>
</disk>
<interface type='network]
Actual [utc'/>
<devices>
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/root/foo.img'/>
<target dev='hda'/>
</disk>
<interface type='bridge]
... FAILED
So you can see immediately that they start to differ in the 'localtime' vs
'utc' value, and the last place at which they differ is the network interface
which has type of 'network' vs 'bridge'.
This has dramatically eased my debugging of tests when adding the serial
device options :-)
This patch is merely the helper routines. I'll include the actualy test
suite changes later.
Dan.
Index: testutils.h
===================================================================
RCS file: /data/cvs/libvirt/tests/testutils.h,v
retrieving revision 1.6
diff -u -p -r1.6 testutils.h
--- testutils.h 10 Apr 2008 16:53:29 -0000 1.6
+++ testutils.h 18 Apr 2008 00:22:55 -0000
@@ -32,6 +32,11 @@ extern "C" {
char **buf,
int buflen);
+
+ int virtTestDifference(FILE *stream,
+ const char *expect,
+ const char *actual);
+
#ifdef __cplusplus
}
#endif
Index: testutils.c
===================================================================
RCS file: /data/cvs/libvirt/tests/testutils.c,v
retrieving revision 1.11
diff -u -p -r1.11 testutils.c
--- testutils.c 10 Apr 2008 16:53:29 -0000 1.11
+++ testutils.c 18 Apr 2008 00:22:55 -0000
@@ -19,6 +19,7 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
+#include <string.h>
#include <fcntl.h>
#include <limits.h>
#include "testutils.h"
@@ -58,6 +59,12 @@ virtTestRun(const char *title, int nloop
{
int i, ret = 0;
double *ts = NULL;
+ static int counter = 0;
+
+ counter++;
+
+ fprintf(stderr, "%2d) %-65s ... ", counter, title);
+ fflush(stderr);
if (nloops > 1 && (ts = calloc(nloops,
sizeof(double)))==NULL)
@@ -76,12 +83,12 @@ virtTestRun(const char *title, int nloop
}
}
if (ret == 0 && ts)
- fprintf(stderr, "%-50s ... OK [%.5f ms]\n", title,
+ fprintf(stderr, "OK [%.5f ms]\n",
virtTestCountAverage(ts, nloops));
else if (ret == 0)
- fprintf(stderr, "%-50s ... OK\n", title);
+ fprintf(stderr, "OK\n");
else
- fprintf(stderr, "%-50s ... FAILED\n", title);
+ fprintf(stderr, "FAILED\n");
free(ts);
return ret;
@@ -206,3 +213,57 @@ int virtTestCaptureProgramOutput(const c
}
}
}
+
+
+/**
+ * @param stream: output stream write to differences to
+ * @param expect: expected output text
+ * @param actual: actual output text
+ *
+ * Display expected and actual output text, trimmed to
+ * first and last characters at which differences occur
+ */
+int virtTestDifference(FILE *stream,
+ const char *expect,
+ const char *actual)
+{
+ const char *expectStart = expect;
+ const char *expectEnd = expect + (strlen(expect)-1);
+ const char *actualStart = actual;
+ const char *actualEnd = actual + (strlen(actual)-1);
+
+ if (getenv("DEBUG_TESTS") == NULL)
+ return 0;
+
+ /* Skip to first character where they differ */
+ while (*expectStart && *actualStart &&
+ *actualStart == *expectStart) {
+ actualStart++;
+ expectStart++;
+ }
+
+ /* Work backwards to last character where they differ */
+ while (actualEnd > actualStart &&
+ expectEnd > expectStart &&
+ *actualEnd == *expectEnd) {
+ actualEnd--;
+ expectEnd--;
+ }
+
+ /* Show the trimmed differences */
+ fprintf(stream, "\nExpect [");
+ if ((expectEnd - expectStart + 1) &&
+ fwrite(expectStart, (expectEnd-expectStart+1), 1, stream) != 1)
+ return -1;
+ fprintf(stream, "]\n");
+ fprintf(stream, "Actual [");
+ if ((actualEnd - actualStart + 1) &&
+ fwrite(actualStart, (actualEnd-actualStart+1), 1, stream) != 1)
+ return -1;
+ fprintf(stream, "]\n");
+
+ /* Pad to line up with test name ... in virTestRun */
+ fprintf(stream, " ... ");
+
+ return 0;
+}
--
|: 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 :|
16 years, 7 months
[Libvir] proposal: remove contradictory indentation directive
by Jim Meyering
Dave Leskovec <dlesko(a)linux.vnet.ibm.com> wrote:
> This is a repost of the start container support. Changes from the last version:
...
> +/*
> + * Local variables:
> + * indent-tabs-mode: nil
> + * c-indent-level: 4
> + * c-basic-offset: 4
> + * tab-width: 4
> + * End:
> + */
Please don't add the "tab-width: 4" specifier.
Specifying a tab-width at all in a new file with "indent-tabs-mode: nil"
is a contradiction. The latter says there should be no TABs, yet
the former says "when there are, give them width 4." Coding style
guidelines are universal in their recommendations to stick with 8-byte
TAB stops, independent of whether you actually use TAB or spaces.
Just yesterday I experienced first hand how adding code with existing
8-byte tab stops to a file with settings like the above mangles the
indentation of the new code.
FYI, a better approach would be to ensure that TAB is never used
for indentation in a file with "indent-tabs-mode: nil".
Both directives are in over 70 files, and I propose to straighten things
out. There are many instances of invalid and misleading indentation,
in part because of this sort of mix-up. To give an idea of the scope,
while 77 files have those settings, removing 'tab-width: 4' would only
affect those that use TABs for indentation in spite of "indent-tabs-mode:
nil" (perhaps added via copy/paste, or added with a non-emacs editor).
Many distro-provided versions of Vim do not honor :se-style settings,
due to security concerns.
Here are counts of lines with TAB indentation in those 77 files.
Each TAB would have to be changed to 4 or 8 spaces, depending
on context. That'd be the minimal change. An alternative
is simply to filter each of these files through indent with
appropriate options.
$ git grep -l tab-width:|xargs grep -c '^ '|grep -v :0
proxy/libvirt_proxy.c:316
python/libvir.c:17
src/buf.c:27
src/conf.c:161
src/conf.h:7
src/driver.h:130
src/internal.h:9
src/libvirt.c:81
src/lxc_conf.c:17
src/openvz_driver.h:6
src/proxy_internal.c:122
src/proxy_internal.h:13
src/qemu_conf.c:1
src/qemu_driver.c:5
src/qparams.h:1
src/remote_internal.c:4
src/stats_linux.h:3
src/virsh.c:33
src/virterror.c:166
src/xen_internal.c:105
src/xen_unified.c:25
src/xen_unified.h:37
src/xend_internal.c:43
src/xm_internal.c:25
src/xml.c:6
src/xs_internal.c:45
tests/nodeinfotest.c:1
tests/sexpr2xmltest.c:83
16 years, 7 months
[Libvir] PATCH: Support serial & parallel devices in QEMU driver
by Daniel P. Berrange
A long time ago I proposed a syntax for serial / parallel port handling
in libvirt XML.
http://www.redhat.com/archives/libvir-list/2007-May/msg00191.html
Currently, Xen uses this for input:
<console tty='pty'/>
And when the guest is active, this comes out as:
<console tty='/dev/pts/2'/>
In PV guests this refers to the xvc0 console, and in FV guests this enables
the first serial port in 'pty' mode. QEMU serial devices support many more
options though, and also parallel ports.
Thus I propose to add the following new syntax which is slightly tweaked
from my original mail:
- For a Psuedo-TTY:
NB. the source tag is output only, since TTYs are autoallocated
<serial type='pty'>
<source path='/dev/pts/1'/>
<target port='0'/>
</serial>
- Passthrough to areal host serial device:
<serial type='dev'>
<source path='/dev/ttyS2'/>
<target port='0'/>
</serial>
- Log output data to a file, no input:
<serial type='file'>
<source path='/tmp/serial.log'/>
<target port='0'/>
</serial>
- Run a TCP server and wait for clients to connect, using telnet
protocol over wire:
<serial type='tcp'>
<source mode='bind' host='127.0.0.1' service='9999' wiremode='telnet'/>
<target port='0'/>
</serial>
- Run a TCP client connecting to a remote host to send data in
raw format:
<serial type='tcp'>
<source mode='connect' host='127.0.0.1' service='9999' wiremode='raw'/>
<target port='0'/>
</serial>
- Run a UDP netconsole facility - nb use of 2 sources so it can both
send and receive data. For output only, the mode=bind source can
be omitted.
<serial type='udp'>
<source mode='bind' host='127.0.0.1' service='9999'/>
<source mode='connect' host='127.0.0.1' service='9998'/>
<target port='0'/>
</serial>
- Run a UNIX socket server
<serial type='unix'>
<source mode='bind' path='/tmp/serial.sock'/>
<target port='0'/>
</serial>
- Run a QEMU virtual console accessible via Ctrl+Alt+'n'
<serial type='vc'>
<target port='0'/>
</serial>
In all these examples the '<target>' tag is an output only element for QEMU
really just there to give an explicit device ordering. It is possible it
might be extended in future to allow specifiction of type of serial device
hardware to emulate, or some such idea.
WRT to the <console> tag, if the application defines a VM with a single
<console/>
tag this will be converted into a <serial type="pty"/> tag. When dumping
XML, if the first serial device has type='pty', then a <console> tag will
be included in the XML dump. This gives compatability with existing tools
which know how to deal with <console> tag.
This format described above will also be pretty much 100% applicable to
the Xen driver, but I've not done the code for that yet. VMWare allows
use of serial/parallel ports, but only enables logging to a file. So we
can trivially cope with VMWare config via type="file".
Finally I've not actaully hooked up the code to determine the path to the
Psuedo-TTY which is auto-allocated at startup. So type="pty" isn't useful
in this patch yet.
Dan.
Index: src/qemu_conf.c
===================================================================
RCS file: /data/cvs/libvirt/src/qemu_conf.c,v
retrieving revision 1.48
diff -u -p -r1.48 qemu_conf.c
--- src/qemu_conf.c 10 Apr 2008 16:54:54 -0000 1.48
+++ src/qemu_conf.c 15 Apr 2008 21:31:32 -0000
@@ -205,6 +205,8 @@ void qemudFreeVMDef(struct qemud_vm_def
struct qemud_vm_disk_def *disk = def->disks;
struct qemud_vm_net_def *net = def->nets;
struct qemud_vm_input_def *input = def->inputs;
+ struct qemud_vm_chr_def *serial = def->serials;
+ struct qemud_vm_chr_def *parallel = def->parallels;
while (disk) {
struct qemud_vm_disk_def *prev = disk;
@@ -221,6 +223,16 @@ void qemudFreeVMDef(struct qemud_vm_def
input = input->next;
free(prev);
}
+ while (serial) {
+ struct qemud_vm_chr_def *prev = serial;
+ serial = serial->next;
+ free(prev);
+ }
+ while (parallel) {
+ struct qemud_vm_chr_def *prev = parallel;
+ parallel = parallel->next;
+ free(prev);
+ }
xmlFree(def->keymap);
free(def);
}
@@ -945,6 +957,334 @@ static int qemudParseInterfaceXML(virCon
}
+/* Parse the XML definition for a character device
+ * @param net pre-allocated & zero'd net record
+ * @param node XML nodeset to parse for net definition
+ * @return 0 on success, -1 on failure
+ *
+ * The XML we're dealing with looks like
+ *
+ * <serial type="pty">
+ * <source path="/dev/pts/3"/>
+ * <target port="1"/>
+ * </serial>
+ *
+ * <serial type="dev">
+ * <source path="/dev/ttyS0"/>
+ * <target port="1"/>
+ * </serial>
+ *
+ * <serial type="tcp">
+ * <source mode="connect" host="0.0.0.0" service="2445"/>
+ * <target port="1"/>
+ * </serial>
+ *
+ * <serial type="tcp">
+ * <source mode="bind" host="0.0.0.0" service="2445"/>
+ * <target port="1"/>
+ * </serial>
+ *
+ * <serial type="udp">
+ * <source mode="bind" host="0.0.0.0" service="2445"/>
+ * <source mode="connect" host="0.0.0.0" service="2445"/>
+ * <target port="1"/>
+ * </serial>
+ *
+ * <serial type="unix">
+ * <source mode="bind" path="/tmp/foo"/>
+ * <target port="1"/>
+ * </serial>
+ *
+ */
+static int qemudParseCharXML(virConnectPtr conn,
+ struct qemud_vm_chr_def *chr,
+ int portNum,
+ xmlNodePtr node) {
+ xmlNodePtr cur;
+ xmlChar *type = NULL;
+ xmlChar *bindHost = NULL;
+ xmlChar *bindService = NULL;
+ xmlChar *connectHost = NULL;
+ xmlChar *connectService = NULL;
+ xmlChar *path = NULL;
+ xmlChar *mode = NULL;
+ xmlChar *wiremode = NULL;
+ int ret = -1;
+
+ chr->srcType = QEMUD_CHR_SRC_TYPE_PTY;
+ type = xmlGetProp(node, BAD_CAST "type");
+ if (type != NULL) {
+ if (xmlStrEqual(type, BAD_CAST "null"))
+ chr->srcType = QEMUD_CHR_SRC_TYPE_NULL;
+ else if (xmlStrEqual(type, BAD_CAST "vc"))
+ chr->srcType = QEMUD_CHR_SRC_TYPE_VC;
+ else if (xmlStrEqual(type, BAD_CAST "pty"))
+ chr->srcType = QEMUD_CHR_SRC_TYPE_PTY;
+ else if (xmlStrEqual(type, BAD_CAST "dev"))
+ chr->srcType = QEMUD_CHR_SRC_TYPE_DEV;
+ else if (xmlStrEqual(type, BAD_CAST "file"))
+ chr->srcType = QEMUD_CHR_SRC_TYPE_FILE;
+ else if (xmlStrEqual(type, BAD_CAST "pipe"))
+ chr->srcType = QEMUD_CHR_SRC_TYPE_PIPE;
+ else if (xmlStrEqual(type, BAD_CAST "stdio"))
+ chr->srcType = QEMUD_CHR_SRC_TYPE_STDIO;
+ else if (xmlStrEqual(type, BAD_CAST "udp"))
+ chr->srcType = QEMUD_CHR_SRC_TYPE_UDP;
+ else if (xmlStrEqual(type, BAD_CAST "tcp"))
+ chr->srcType = QEMUD_CHR_SRC_TYPE_TCP;
+ else if (xmlStrEqual(type, BAD_CAST "unix"))
+ chr->srcType = QEMUD_CHR_SRC_TYPE_UNIX;
+ else
+ chr->srcType = QEMUD_CHR_SRC_TYPE_NULL;
+ }
+
+ cur = node->children;
+ while (cur != NULL) {
+ if (cur->type == XML_ELEMENT_NODE) {
+ if (xmlStrEqual(cur->name, BAD_CAST "source")) {
+ if (mode == NULL)
+ mode = xmlGetProp(cur, BAD_CAST "mode");
+
+ switch (chr->srcType) {
+ case QEMUD_CHR_SRC_TYPE_PTY:
+ case QEMUD_CHR_SRC_TYPE_DEV:
+ case QEMUD_CHR_SRC_TYPE_FILE:
+ case QEMUD_CHR_SRC_TYPE_PIPE:
+ case QEMUD_CHR_SRC_TYPE_UNIX:
+ if (path == NULL)
+ path = xmlGetProp(cur, BAD_CAST "path");
+
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_UDP:
+ case QEMUD_CHR_SRC_TYPE_TCP:
+ if (mode == NULL ||
+ STREQ((const char *)mode, "connect")) {
+
+ if (connectHost == NULL)
+ connectHost = xmlGetProp(cur, BAD_CAST "host");
+ if (connectService == NULL)
+ connectService = xmlGetProp(cur, BAD_CAST "service");
+ } else {
+ if (bindHost == NULL)
+ bindHost = xmlGetProp(cur, BAD_CAST "host");
+ if (bindService == NULL)
+ bindService = xmlGetProp(cur, BAD_CAST "service");
+ }
+
+ if (chr->srcType == QEMUD_CHR_SRC_TYPE_TCP)
+ wiremode = xmlGetProp(cur, BAD_CAST "wiremode");
+
+ if (chr->srcType == QEMUD_CHR_SRC_TYPE_UDP) {
+ xmlFree(mode);
+ mode = NULL;
+ }
+ }
+ }
+ }
+ cur = cur->next;
+ }
+
+
+ chr->dstPort = portNum;
+
+ switch (chr->srcType) {
+ case QEMUD_CHR_SRC_TYPE_NULL:
+ /* Nada */
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_VC:
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_PTY:
+ /* @path attribute is an output only property - pty is auto-allocted */
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_DEV:
+ case QEMUD_CHR_SRC_TYPE_FILE:
+ case QEMUD_CHR_SRC_TYPE_PIPE:
+ if (path == NULL) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing source path attribute for char device"));
+ goto cleanup;
+ }
+
+ strncpy(chr->srcData.file.path, (const char *)path,
+ sizeof(chr->srcData.file.path));
+ chr->srcData.file.path[sizeof(chr->srcData.file.path)-1] = '\0';
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_STDIO:
+ /* Nada */
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_TCP:
+ if (mode == NULL ||
+ STREQ((const char *)mode, "connect")) {
+ if (connectHost == NULL) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing source host attribute for char device"));
+ goto cleanup;
+ }
+ if (connectService == NULL) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing source service attribute for char device"));
+ goto cleanup;
+ }
+
+ strncpy(chr->srcData.tcp.host, (const char *)connectHost,
+ sizeof(chr->srcData.tcp.host));
+ chr->srcData.tcp.host[sizeof(chr->srcData.tcp.host)-1] = '\0';
+ strncpy(chr->srcData.tcp.service, (const char *)connectService,
+ sizeof(chr->srcData.tcp.service));
+ chr->srcData.tcp.service[sizeof(chr->srcData.tcp.service)-1] = '\0';
+
+ chr->srcData.tcp.listen = 0;
+ } else {
+ if (bindHost == NULL) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing source host attribute for char device"));
+ goto cleanup;
+ }
+ if (bindService == NULL) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing source service attribute for char device"));
+ goto cleanup;
+ }
+
+ strncpy(chr->srcData.tcp.host, (const char *)bindHost,
+ sizeof(chr->srcData.tcp.host));
+ chr->srcData.tcp.host[sizeof(chr->srcData.tcp.host)-1] = '\0';
+ strncpy(chr->srcData.tcp.service, (const char *)bindService,
+ sizeof(chr->srcData.tcp.service));
+ chr->srcData.tcp.service[sizeof(chr->srcData.tcp.service)-1] = '\0';
+
+ chr->srcData.tcp.listen = 1;
+ }
+ if (wiremode != NULL &&
+ STREQ((const char *)wiremode, "telnet"))
+ chr->srcData.tcp.wiremode = QEMUD_CHR_SRC_TCP_WIRE_MODE_TELNET;
+ else
+ chr->srcData.tcp.wiremode = QEMUD_CHR_SRC_TCP_WIRE_MODE_RAW;
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_UDP:
+ if (connectService == NULL) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing source service attribute for char device"));
+ goto cleanup;
+ }
+
+ if (connectHost != NULL) {
+ strncpy(chr->srcData.udp.connectHost, (const char *)connectHost,
+ sizeof(chr->srcData.udp.connectHost));
+ chr->srcData.udp.connectHost[sizeof(chr->srcData.udp.connectHost)-1] = '\0';
+ }
+ strncpy(chr->srcData.udp.connectService, (const char *)connectService,
+ sizeof(chr->srcData.udp.connectService));
+ chr->srcData.udp.connectService[sizeof(chr->srcData.udp.connectService)-1] = '\0';
+
+ if (bindHost != NULL) {
+ strncpy(chr->srcData.udp.bindHost, (const char *)bindHost,
+ sizeof(chr->srcData.udp.bindHost));
+ chr->srcData.udp.bindHost[sizeof(chr->srcData.udp.bindHost)-1] = '\0';
+ }
+ if (bindService != NULL) {
+ strncpy(chr->srcData.udp.bindService, (const char *)bindService,
+ sizeof(chr->srcData.udp.bindService));
+ chr->srcData.udp.bindService[sizeof(chr->srcData.udp.bindService)-1] = '\0';
+ }
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_UNIX:
+ if (path == NULL) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Missing source path attribute for char device"));
+ goto cleanup;
+ }
+
+ if (mode != NULL &&
+ STRNEQ((const char *)mode, "connect"))
+ chr->srcData.nix.listen = 1;
+ else
+ chr->srcData.nix.listen = 0;
+
+ strncpy(chr->srcData.nix.path, (const char *)path,
+ sizeof(chr->srcData.nix.path));
+ chr->srcData.nix.path[sizeof(chr->srcData.nix.path)-1] = '\0';
+ break;
+ }
+
+ ret = 0;
+
+cleanup:
+ xmlFree(mode);
+ xmlFree(wiremode);
+ xmlFree(type);
+ xmlFree(bindHost);
+ xmlFree(bindService);
+ xmlFree(connectHost);
+ xmlFree(connectService);
+ xmlFree(path);
+
+ return ret;
+}
+
+
+static int qemudParseCharXMLDevices(virConnectPtr conn,
+ xmlXPathContextPtr ctxt,
+ const char *xpath,
+ int *ndevs,
+ struct qemud_vm_chr_def **devs)
+{
+ xmlXPathObjectPtr obj;
+ int i;
+
+ obj = xmlXPathEval(BAD_CAST xpath, ctxt);
+ if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
+ (obj->nodesetval != NULL) && (obj->nodesetval->nodeNr >= 0)) {
+ struct qemud_vm_chr_def *prev = *devs;
+ if (ndevs == NULL &&
+ obj->nodesetval->nodeNr > 1) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("too many character devices"));
+ goto error;
+ }
+
+ for (i = 0; i < obj->nodesetval->nodeNr; i++) {
+ struct qemud_vm_chr_def *chr = calloc(1, sizeof(*chr));
+ if (!chr) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY,
+ "%s",
+ _("failed to allocate space for char device"));
+ goto error;
+ }
+
+ if (qemudParseCharXML(conn, chr, i, obj->nodesetval->nodeTab[i]) < 0) {
+ free(chr);
+ goto error;
+ }
+ if (ndevs)
+ (*ndevs)++;
+ chr->next = NULL;
+ if (i == 0) {
+ *devs = chr;
+ } else {
+ prev->next = chr;
+ }
+ prev = chr;
+ }
+ }
+ xmlXPathFreeObject(obj);
+
+ return 0;
+
+error:
+ xmlXPathFreeObject(obj);
+ return -1;
+}
+
+
/* Parse the XML definition for a network interface */
static int qemudParseInputXML(virConnectPtr conn,
struct qemud_vm_input_def *input,
@@ -1423,6 +1763,41 @@ static struct qemud_vm_def *qemudParseXM
}
}
xmlXPathFreeObject(obj);
+ obj = NULL;
+
+ /* analysis of the character devices */
+ if (qemudParseCharXMLDevices(conn, ctxt,
+ "/domain/devices/parallel",
+ &def->nparallels,
+ &def->parallels) < 0)
+ goto error;
+ if (qemudParseCharXMLDevices(conn, ctxt,
+ "/domain/devices/serial",
+ &def->nserials,
+ &def->serials) < 0)
+ goto error;
+
+ /*
+ * If no serial devices were listed, then look for console
+ * devices which is the legacy syntax for the same thing
+ */
+ if (def->nserials == 0) {
+ obj = xmlXPathEval(BAD_CAST "/domain/devices/console", ctxt);
+ if ((obj != NULL) && (obj->type == XPATH_NODESET) &&
+ (obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) {
+ struct qemud_vm_chr_def *serial = calloc(1, sizeof(*serial));
+ if (!serial) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY,
+ "%s", _("failed to allocate space for serial device"));
+ goto error;
+ }
+ serial->srcType = QEMUD_CHR_SRC_TYPE_PTY;
+
+ def->serials = serial;
+ def->nserials = 1;
+ }
+ xmlXPathFreeObject(obj);
+ }
/* analysis of the network devices */
@@ -1617,6 +1992,78 @@ qemudNetworkIfaceConnect(virConnectPtr c
return NULL;
}
+static int qemudBuildCommandLineChrDevStr(struct qemud_vm_chr_def *dev,
+ char *buf,
+ int buflen)
+{
+ switch (dev->srcType) {
+ case QEMUD_CHR_SRC_TYPE_NULL:
+ strncpy(buf, "null", buflen);
+ buf[buflen-1] = '\0';
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_VC:
+ strncpy(buf, "vc", buflen);
+ buf[buflen-1] = '\0';
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_PTY:
+ strncpy(buf, "pty", buflen);
+ buf[buflen-1] = '\0';
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_DEV:
+ if (snprintf(buf, buflen, "%s",
+ dev->srcData.file.path) >= buflen)
+ return -1;
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_FILE:
+ if (snprintf(buf, buflen, "file:%s",
+ dev->srcData.file.path) >= buflen)
+ return -1;
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_PIPE:
+ if (snprintf(buf, buflen, "pipe:%s",
+ dev->srcData.file.path) >= buflen)
+ return -1;
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_STDIO:
+ strncpy(buf, "stdio", buflen);
+ buf[buflen-1] = '\0';
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_UDP:
+ if (snprintf(buf, buflen, "udp:%s:%s@%s:%s",
+ dev->srcData.udp.connectHost,
+ dev->srcData.udp.connectService,
+ dev->srcData.udp.bindHost,
+ dev->srcData.udp.bindService) >= buflen)
+ return -1;
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_TCP:
+ if (snprintf(buf, buflen, "%s:%s:%s%s",
+ dev->srcData.tcp.wiremode == QEMUD_CHR_SRC_TCP_WIRE_MODE_TELNET ? "telnet" : "tcp",
+ dev->srcData.tcp.host,
+ dev->srcData.tcp.service,
+ dev->srcData.tcp.listen ? ",listen" : "") >= buflen)
+ return -1;
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_UNIX:
+ if (snprintf(buf, buflen, "unix:%s%s",
+ dev->srcData.nix.path,
+ dev->srcData.nix.listen ? ",listen" : "") >= buflen)
+ return -1;
+ break;
+ }
+
+ return 0;
+}
+
/*
* Constructs a argv suitable for launching qemu with config defined
* for a given virtual machine.
@@ -1633,6 +2080,8 @@ int qemudBuildCommandLine(virConnectPtr
struct qemud_vm_disk_def *disk = vm->def->disks;
struct qemud_vm_net_def *net = vm->def->nets;
struct qemud_vm_input_def *input = vm->def->inputs;
+ struct qemud_vm_chr_def *serial = vm->def->serials;
+ struct qemud_vm_chr_def *parallel = vm->def->parallels;
struct utsname ut;
int disableKQEMU = 0;
@@ -1681,6 +2130,8 @@ int qemudBuildCommandLine(virConnectPtr
(vm->def->nnets > 0 ? (4 * vm->def->nnets) : 2) + /* networks */
1 + /* usb */
2 * vm->def->ninputs + /* input devices */
+ (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 */
@@ -1913,6 +2364,48 @@ int qemudBuildCommandLine(virConnectPtr
}
}
+ if (!serial) {
+ if (!((*argv)[++n] = strdup("-serial")))
+ goto no_memory;
+ if (!((*argv)[++n] = strdup("none")))
+ goto no_memory;
+ } else {
+ while (serial) {
+ char buf[4096];
+
+ 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;
+
+ serial = serial->next;
+ }
+ }
+
+ if (!parallel) {
+ if (!((*argv)[++n] = strdup("-parallel")))
+ goto no_memory;
+ if (!((*argv)[++n] = strdup("none")))
+ goto no_memory;
+ } else {
+ while (parallel) {
+ char buf[4096];
+
+ 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;
+
+ parallel = parallel->next;
+ }
+ }
+
if (!((*argv)[++n] = strdup("-usb")))
goto no_memory;
while (input) {
@@ -2838,6 +3331,110 @@ int qemudScanConfigs(struct qemud_driver
return 0;
}
+static int qemudGenerateXMLChar(virBufferPtr buf,
+ struct qemud_vm_chr_def *dev,
+ const char *type)
+{
+ const char *types[] = {
+ "null",
+ "vc",
+ "pty",
+ "dev",
+ "file",
+ "pipe",
+ "stdio",
+ "udp",
+ "tcp",
+ "unix"
+ };
+ if (virBufferVSprintf(buf, " <%s type='%s'>\n",
+ type, types[dev->srcType]) < 0)
+ return -1;
+
+ switch (dev->srcType) {
+ case QEMUD_CHR_SRC_TYPE_NULL:
+ case QEMUD_CHR_SRC_TYPE_VC:
+ case QEMUD_CHR_SRC_TYPE_STDIO:
+ /* nada */
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_PTY:
+ case QEMUD_CHR_SRC_TYPE_DEV:
+ case QEMUD_CHR_SRC_TYPE_FILE:
+ case QEMUD_CHR_SRC_TYPE_PIPE:
+ if (dev->srcType != QEMUD_CHR_SRC_TYPE_PTY ||
+ dev->srcData.file.path[0]) {
+ if (virBufferVSprintf(buf, " <source path='%s'/>\n",
+ dev->srcData.file.path) < 0)
+ return -1;
+ }
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_UDP:
+ if (dev->srcData.udp.bindService[0] != '\0' &&
+ dev->srcData.udp.bindHost[0] != '\0') {
+ if (virBufferVSprintf(buf, " <source mode='bind' host='%s' service='%s'/>\n",
+ dev->srcData.udp.bindHost,
+ dev->srcData.udp.bindService) < 0)
+ return -1;
+ } else if (dev->srcData.udp.bindHost[0] !='\0') {
+ if (virBufferVSprintf(buf, " <source mode='bind' host='%s'/>\n",
+ dev->srcData.udp.bindHost) < 0)
+ return -1;
+ } else if (dev->srcData.udp.bindService[0] != '\0') {
+ if (virBufferVSprintf(buf, " <source mode='bind' service='%s'/>\n",
+ dev->srcData.udp.bindService) < 0)
+ return -1;
+ }
+
+ if (dev->srcData.udp.connectService[0] != '\0' &&
+ dev->srcData.udp.connectHost[0] != '\0') {
+ if (virBufferVSprintf(buf, " <source mode='connect' host='%s' service='%s'/>\n",
+ dev->srcData.udp.connectHost,
+ dev->srcData.udp.connectService) < 0)
+ return -1;
+ } else if (dev->srcData.udp.connectHost[0] != '\0') {
+ if (virBufferVSprintf(buf, " <source mode='connect' host='%s'/>\n",
+ dev->srcData.udp.connectHost) < 0)
+ return -1;
+ } else if (dev->srcData.udp.connectService[0] != '\0') {
+ if (virBufferVSprintf(buf, " <source mode='connect' service='%s'/>\n",
+ dev->srcData.udp.connectService) < 0)
+ return -1;
+ }
+
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_TCP:
+ if (virBufferVSprintf(buf, " <source mode='%s' host='%s' service='%s' wiremode='%s'/>\n",
+ dev->srcData.tcp.listen ? "bind" : "connect",
+ dev->srcData.tcp.host,
+ dev->srcData.tcp.service,
+ dev->srcData.tcp.wiremode == QEMUD_CHR_SRC_TCP_WIRE_MODE_TELNET
+ ? "telnet" : "raw") < 0)
+ return -1;
+ break;
+
+ case QEMUD_CHR_SRC_TYPE_UNIX:
+ if (virBufferVSprintf(buf, " <source mode='%s' path='%s'/>\n",
+ dev->srcData.nix.listen ? "bind" : "connect",
+ dev->srcData.nix.path) < 0)
+ return -1;
+ break;
+ }
+
+ if (virBufferVSprintf(buf, " <target port='%d'/>\n",
+ dev->dstPort) < 0)
+ return -1;
+
+ if (virBufferVSprintf(buf, " </%s>\n",
+ type) < 0)
+ return -1;
+
+ return 0;
+}
+
+
/* Generate an XML document describing the guest's configuration */
char *qemudGenerateXML(virConnectPtr conn,
struct qemud_driver *driver ATTRIBUTE_UNUSED,
@@ -2850,6 +3447,7 @@ char *qemudGenerateXML(virConnectPtr con
struct qemud_vm_disk_def *disk;
struct qemud_vm_net_def *net;
struct qemud_vm_input_def *input;
+ struct qemud_vm_chr_def *chr;
const char *type = NULL;
int n;
@@ -3078,6 +3676,30 @@ char *qemudGenerateXML(virConnectPtr con
net = net->next;
}
+ chr = def->serials;
+ while (chr) {
+ if (qemudGenerateXMLChar(buf, chr, "serial") < 0)
+ goto no_memory;
+
+ chr = chr->next;
+ }
+
+ chr = def->parallels;
+ while (chr) {
+ if (qemudGenerateXMLChar(buf, chr, "parallel") < 0)
+ goto no_memory;
+
+ chr = chr->next;
+ }
+
+ if (def->nserials > 0 &&
+ def->serials->srcType == QEMUD_CHR_SRC_TYPE_PTY) {
+ if (virBufferVSprintf(buf, " <console tty='%s'/>\n",
+ def->serials->srcData.file.path[0] ?
+ def->serials->srcData.file.path : "pty") < 0)
+ goto no_memory;
+ }
+
input = def->inputs;
while (input) {
if (input->bus != QEMU_INPUT_BUS_PS2 &&
@@ -3125,9 +3747,6 @@ char *qemudGenerateXML(virConnectPtr con
break;
}
- if (def->graphicsType == QEMUD_GRAPHICS_VNC) {
- }
-
if (virBufferAddLit(buf, " </devices>\n") < 0)
goto no_memory;
Index: src/qemu_conf.h
===================================================================
RCS file: /data/cvs/libvirt/src/qemu_conf.h,v
retrieving revision 1.22
diff -u -p -r1.22 qemu_conf.h
--- src/qemu_conf.h 10 Apr 2008 16:53:29 -0000 1.22
+++ src/qemu_conf.h 15 Apr 2008 21:31:32 -0000
@@ -119,6 +119,52 @@ struct qemud_vm_net_def {
struct qemud_vm_net_def *next;
};
+enum qemu_vm_chr_dst_type {
+ QEMUD_CHR_SRC_TYPE_NULL,
+ QEMUD_CHR_SRC_TYPE_VC,
+ QEMUD_CHR_SRC_TYPE_PTY,
+ QEMUD_CHR_SRC_TYPE_DEV,
+ QEMUD_CHR_SRC_TYPE_FILE,
+ QEMUD_CHR_SRC_TYPE_PIPE,
+ QEMUD_CHR_SRC_TYPE_STDIO,
+ QEMUD_CHR_SRC_TYPE_UDP,
+ QEMUD_CHR_SRC_TYPE_TCP,
+ QEMUD_CHR_SRC_TYPE_UNIX,
+};
+
+enum {
+ QEMUD_CHR_SRC_TCP_WIRE_MODE_RAW,
+ QEMUD_CHR_SRC_TCP_WIRE_MODE_TELNET,
+};
+
+struct qemud_vm_chr_def {
+ int dstPort;
+
+ int srcType;
+ union {
+ struct {
+ char path[PATH_MAX];
+ } file; /* pty, file, pipe, or device */
+ struct {
+ char host[BR_INET_ADDR_MAXLEN];
+ char service[BR_INET_ADDR_MAXLEN];
+ int listen;
+ int wiremode;
+ } tcp;
+ struct {
+ char bindHost[BR_INET_ADDR_MAXLEN];
+ char bindService[BR_INET_ADDR_MAXLEN];
+ char connectHost[BR_INET_ADDR_MAXLEN];
+ char connectService[BR_INET_ADDR_MAXLEN];
+ } udp;
+ struct {
+ char path[PATH_MAX];
+ int listen;
+ } nix;
+ } srcData;
+
+ struct qemud_vm_chr_def *next;
+};
enum qemu_vm_input_type {
QEMU_INPUT_TYPE_MOUSE,
@@ -223,6 +269,12 @@ struct qemud_vm_def {
int ninputs;
struct qemud_vm_input_def *inputs;
+
+ int nserials;
+ struct qemud_vm_chr_def *serials;
+
+ int nparallels;
+ struct qemud_vm_chr_def *parallels;
};
/* Guest VM runtime state */
Index: tests/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/tests/Makefile.am,v
retrieving revision 1.40
diff -u -p -r1.40 Makefile.am
--- tests/Makefile.am 8 Apr 2008 15:33:17 -0000 1.40
+++ tests/Makefile.am 15 Apr 2008 21:31:32 -0000
@@ -66,6 +66,8 @@ path_add = $$abs_top_builddir/src$(PATH_
TESTS_ENVIRONMENT = \
abs_top_builddir=`cd '$(top_builddir)'; pwd` \
abs_top_srcdir=`cd '$(top_srcdir)'; pwd` \
+ abs_builddir=`cd '$(builddir)'; pwd` \
+ abs_srcdir=`cd '$(srcdir)'; pwd` \
PATH="$(path_add)$(PATH_SEPARATOR)$$PATH" \
SHELL="$(SHELL)" \
$(VG)
Index: tests/qemuxml2argvtest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvtest.c,v
retrieving revision 1.14
diff -u -p -r1.14 qemuxml2argvtest.c
--- tests/qemuxml2argvtest.c 10 Apr 2008 16:53:29 -0000 1.14
+++ tests/qemuxml2argvtest.c 15 Apr 2008 21:31:32 -0000
@@ -15,7 +15,7 @@
#include "qemu_conf.h"
static char *progname;
-static char *abs_top_srcdir;
+static char *abs_srcdir;
static struct qemud_driver driver;
#define MAX_FILE 4096
@@ -100,10 +100,10 @@ static int testCompareXMLToArgvFiles(con
static int testCompareXMLToArgvHelper(const void *data) {
char xml[PATH_MAX];
char args[PATH_MAX];
- snprintf(xml, PATH_MAX, "%s/tests/qemuxml2argvdata/qemuxml2argv-%s.xml",
- abs_top_srcdir, (const char*)data);
- snprintf(args, PATH_MAX, "%s/tests/qemuxml2argvdata/qemuxml2argv-%s.args",
- abs_top_srcdir, (const char*)data);
+ snprintf(xml, PATH_MAX, "%s/qemuxml2argvdata/qemuxml2argv-%s.xml",
+ abs_srcdir, (const char*)data);
+ snprintf(args, PATH_MAX, "%s/qemuxml2argvdata/qemuxml2argv-%s.args",
+ abs_srcdir, (const char*)data);
return testCompareXMLToArgvFiles(xml, args);
}
@@ -113,6 +113,7 @@ int
main(int argc, char **argv)
{
int ret = 0;
+ char cwd[PATH_MAX];
progname = argv[0];
@@ -121,76 +122,45 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
- abs_top_srcdir = getenv("abs_top_srcdir");
- if (!abs_top_srcdir)
- return 1;
+ abs_srcdir = getenv("abs_srcdir");
+ if (!abs_srcdir)
+ abs_srcdir = getcwd(cwd, sizeof(cwd));
driver.caps = qemudCapsInit();
- if (virtTestRun("QEMU XML-2-ARGV minimal",
- 1, testCompareXMLToArgvHelper, "minimal") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Boot CDROM",
- 1, testCompareXMLToArgvHelper, "boot-cdrom") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Boot Network",
- 1, testCompareXMLToArgvHelper, "boot-network") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Boot Floppy",
- 1, testCompareXMLToArgvHelper, "boot-floppy") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Clock UTC",
- 1, testCompareXMLToArgvHelper, "clock-utc") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Clock Localtime",
- 1, testCompareXMLToArgvHelper, "clock-localtime") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Disk CDROM",
- 1, testCompareXMLToArgvHelper, "disk-cdrom") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Disk Floppy",
- 1, testCompareXMLToArgvHelper, "disk-floppy") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Disk Many",
- 1, testCompareXMLToArgvHelper, "disk-many") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Graphics VNC",
- 1, testCompareXMLToArgvHelper, "graphics-vnc") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Graphics SDL",
- 1, testCompareXMLToArgvHelper, "graphics-sdl") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Input USB Mouse",
- 1, testCompareXMLToArgvHelper, "input-usbmouse") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Input USB Tablet",
- 1, testCompareXMLToArgvHelper, "input-usbtablet") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Misc ACPI",
- 1, testCompareXMLToArgvHelper, "misc-acpi") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Misc No Reboot",
- 1, testCompareXMLToArgvHelper, "misc-no-reboot") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Net User",
- 1, testCompareXMLToArgvHelper, "net-user") < 0)
- ret = -1;
-
+#define DO_TEST(name) \
+ if (virtTestRun("QEMU XML-2-ARGV " name, \
+ 1, testCompareXMLToArgvHelper, (name)) < 0) \
+ ret = -1
+
+ DO_TEST("minimal");
+ DO_TEST("boot-cdrom");
+ DO_TEST("boot-network");
+ DO_TEST("boot-floppy");
+ DO_TEST("clock-utc");
+ DO_TEST("clock-localtime");
+ DO_TEST("disk-cdrom");
+ DO_TEST("disk-floppy");
+ DO_TEST("disk-many");
+ DO_TEST("graphics-vnc");
+ DO_TEST("graphics-sdl");
+ DO_TEST("input-usbmouse");
+ DO_TEST("input-usbtablet");
+ DO_TEST("misc-acpi");
+ DO_TEST("misc-no-reboot");
+ DO_TEST("net-user");
+
+ DO_TEST("serial-vc");
+ DO_TEST("serial-pty");
+ DO_TEST("serial-dev");
+ DO_TEST("serial-file");
+ DO_TEST("serial-unix");
+ DO_TEST("serial-tcp");
+ DO_TEST("serial-udp");
+ DO_TEST("serial-tcp-telnet");
+ DO_TEST("serial-many");
+ DO_TEST("parallel-tcp");
+ DO_TEST("console-compat");
virCapabilitiesFree(driver.caps);
Index: tests/qemuxml2xmltest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2xmltest.c,v
retrieving revision 1.12
diff -u -p -r1.12 qemuxml2xmltest.c
--- tests/qemuxml2xmltest.c 10 Apr 2008 16:53:29 -0000 1.12
+++ tests/qemuxml2xmltest.c 15 Apr 2008 21:31:32 -0000
@@ -15,7 +15,7 @@
#include "qemu_conf.h"
static char *progname;
-static char *abs_top_srcdir;
+static char *abs_srcdir;
static struct qemud_driver driver;
#define MAX_FILE 4096
@@ -66,8 +66,8 @@ static int testCompareXMLToXMLFiles(cons
static int testCompareXMLToXMLHelper(const void *data) {
char xml[PATH_MAX];
- snprintf(xml, PATH_MAX, "%s/tests/qemuxml2argvdata/qemuxml2argv-%s.xml",
- abs_top_srcdir, (const char*)data);
+ snprintf(xml, PATH_MAX, "%s/qemuxml2argvdata/qemuxml2argv-%s.xml",
+ abs_srcdir, (const char*)data);
return testCompareXMLToXMLFiles(xml);
}
@@ -76,6 +76,7 @@ int
main(int argc, char **argv)
{
int ret = 0;
+ char cwd[PATH_MAX];
progname = argv[0];
@@ -84,76 +85,45 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
- abs_top_srcdir = getenv("abs_top_srcdir");
- if (!abs_top_srcdir)
- return 1;
-
+ abs_srcdir = getenv("abs_srcdir");
+ if (!abs_srcdir)
+ abs_srcdir = getcwd(cwd, sizeof(cwd));
driver.caps = qemudCapsInit();
- if (virtTestRun("QEMU XML-2-ARGV minimal",
- 1, testCompareXMLToXMLHelper, "minimal") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Boot CDROM",
- 1, testCompareXMLToXMLHelper, "boot-cdrom") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Boot Network",
- 1, testCompareXMLToXMLHelper, "boot-network") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Boot Floppy",
- 1, testCompareXMLToXMLHelper, "boot-floppy") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Clock UTC",
- 1, testCompareXMLToXMLHelper, "clock-utc") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Clock Localtime",
- 1, testCompareXMLToXMLHelper, "clock-localtime") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Disk CDROM",
- 1, testCompareXMLToXMLHelper, "disk-cdrom") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Disk Floppy",
- 1, testCompareXMLToXMLHelper, "disk-floppy") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Disk Many",
- 1, testCompareXMLToXMLHelper, "disk-many") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Graphics VNC",
- 1, testCompareXMLToXMLHelper, "graphics-vnc") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Graphics SDL",
- 1, testCompareXMLToXMLHelper, "graphics-sdl") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Input USB Mouse",
- 1, testCompareXMLToXMLHelper, "input-usbmouse") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Input USB Tablet",
- 1, testCompareXMLToXMLHelper, "input-usbtablet") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Misc ACPI",
- 1, testCompareXMLToXMLHelper, "misc-acpi") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Misc No Reboot",
- 1, testCompareXMLToXMLHelper, "misc-no-reboot") < 0)
- ret = -1;
-
- if (virtTestRun("QEMU XML-2-ARGV Net User",
- 1, testCompareXMLToXMLHelper, "net-user") < 0)
- ret = -1;
+#define DO_TEST(name) \
+ if (virtTestRun("QEMU XML-2-XML " name, \
+ 1, testCompareXMLToXMLHelper, (name)) < 0) \
+ ret = -1
+
+ DO_TEST("minimal");
+ DO_TEST("boot-cdrom");
+ DO_TEST("boot-network");
+ DO_TEST("boot-floppy");
+ DO_TEST("clock-utc");
+ DO_TEST("clock-localtime");
+ DO_TEST("disk-cdrom");
+ DO_TEST("disk-floppy");
+ DO_TEST("disk-many");
+ DO_TEST("graphics-vnc");
+ DO_TEST("graphics-sdl");
+ DO_TEST("input-usbmouse");
+ DO_TEST("input-usbtablet");
+ DO_TEST("misc-acpi");
+ DO_TEST("misc-no-reboot");
+ DO_TEST("net-user");
+
+ DO_TEST("serial-vc");
+ DO_TEST("serial-pty");
+ DO_TEST("serial-dev");
+ DO_TEST("serial-file");
+ DO_TEST("serial-unix");
+ DO_TEST("serial-tcp");
+ DO_TEST("serial-udp");
+ DO_TEST("serial-tcp-telnet");
+ DO_TEST("serial-many");
+ DO_TEST("parallel-tcp");
+ DO_TEST("console-compat");
virCapabilitiesFree(driver.caps);
Index: tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-boot-cdrom.args
--- tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args 15 Apr 2008 21:31:32 -0000
@@ -1 +1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot d -cdrom /dev/cdrom -net none -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-boot-floppy.args
--- tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args 15 Apr 2008 21:31:32 -0000
@@ -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 -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-boot-network.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-boot-network.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-boot-network.args
--- tests/qemuxml2argvdata/qemuxml2argv-boot-network.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-boot-network.args 15 Apr 2008 21:31:32 -0000
@@ -1 +1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot n -hda /dev/HostVG/QEMUGuest1 -net none -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-clock-localtime.args
--- tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args 15 Apr 2008 21:31:32 -0000
@@ -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 -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-clock-utc.args
--- tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args 15 Apr 2008 21:31:32 -0000
@@ -1 +1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-console-compat.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-console-compat.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-console-compat.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-console-compat.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-console-compat.xml 15 Apr 2008 21:31:32 -0000
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console tty='pty'/>
+ </devices>
+</domain>
Index: tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-disk-cdrom.args
--- tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args 15 Apr 2008 21:31:32 -0000
@@ -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 -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-disk-floppy.args
--- tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args 15 Apr 2008 21:31:32 -0000
@@ -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 -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-disk-many.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-disk-many.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-disk-many.args
--- tests/qemuxml2argvdata/qemuxml2argv-disk-many.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-disk-many.args 15 Apr 2008 21:31:32 -0000
@@ -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 -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-graphics-sdl.args
--- tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args 15 Apr 2008 21:31:32 -0000
@@ -1 +1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args,v
retrieving revision 1.1
diff -u -p -r1.1 qemuxml2argv-graphics-vnc.args
--- tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args 18 Jul 2007 21:34:22 -0000 1.1
+++ tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args 15 Apr 2008 21:31:32 -0000
@@ -1 +1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -vnc 127.0.0.1:3
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-input-usbmouse.args
--- tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args 15 Apr 2008 21:31:32 -0000
@@ -1 +1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -usbdevice mouse
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-input-usbtablet.args
--- tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args 15 Apr 2008 21:31:32 -0000
@@ -1 +1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -usbdevice tablet
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-minimal.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-minimal.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-minimal.args
--- tests/qemuxml2argvdata/qemuxml2argv-minimal.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-minimal.args 15 Apr 2008 21:31:32 -0000
@@ -1 +1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-misc-acpi.args
--- tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args 15 Apr 2008 21:31:32 -0000
@@ -1 +1 @@
-/usr/bin/qemu -M pc -m 214 -smp 1 -nographic -monitor pty -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-misc-no-reboot.args
--- tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args 15 Apr 2008 21:31:32 -0000
@@ -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 -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-net-user.args
===================================================================
RCS file: /data/cvs/libvirt/tests/qemuxml2argvdata/qemuxml2argv-net-user.args,v
retrieving revision 1.2
diff -u -p -r1.2 qemuxml2argv-net-user.args
--- tests/qemuxml2argvdata/qemuxml2argv-net-user.args 24 Jul 2007 14:30:06 -0000 1.2
+++ tests/qemuxml2argvdata/qemuxml2argv-net-user.args 15 Apr 2008 21:31:32 -0000
@@ -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 -usb
\ No newline at end of file
+/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
Index: tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-parallel-tcp.xml 15 Apr 2008 21:31:32 -0000
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <parallel type='tcp'>
+ <source mode='bind' host='127.0.0.1' service='9999' wiremode='raw'/>
+ <target port='0'/>
+ </parallel>
+ </devices>
+</domain>
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-dev.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-dev.xml 15 Apr 2008 21:31:32 -0000
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <serial type='dev'>
+ <source path='/dev/ttyS2'/>
+ <target port='0'/>
+ </serial>
+ </devices>
+</domain>
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-file.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-file.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-file.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-file.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-file.xml 15 Apr 2008 21:31:32 -0000
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <serial type='file'>
+ <source path='/tmp/serial.log'/>
+ <target port='0'/>
+ </serial>
+ </devices>
+</domain>
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-many.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-many.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-many.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-many.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-many.xml 15 Apr 2008 21:31:32 -0000
@@ -0,0 +1,30 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <serial type='file'>
+ <source path='/tmp/serial.log'/>
+ <target port='1'/>
+ </serial>
+ <console tty='pty'/>
+ </devices>
+</domain>
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-pty.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-pty.xml 15 Apr 2008 21:31:32 -0000
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console tty='pty'/>
+ </devices>
+</domain>
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-telnet.xml 15 Apr 2008 21:31:32 -0000
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <serial type='tcp'>
+ <source mode='bind' host='127.0.0.1' service='9999' wiremode='telnet'/>
+ <target port='0'/>
+ </serial>
+ </devices>
+</domain>
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-tcp.xml 15 Apr 2008 21:31:32 -0000
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <serial type='tcp'>
+ <source mode='connect' host='127.0.0.1' service='9999' wiremode='raw'/>
+ <target port='0'/>
+ </serial>
+ </devices>
+</domain>
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-udp.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-udp.xml 15 Apr 2008 21:31:32 -0000
@@ -0,0 +1,27 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <serial type='udp'>
+ <source mode='bind' host='127.0.0.1' service='9999'/>
+ <source mode='connect' host='127.0.0.1' service='9998'/>
+ <target port='0'/>
+ </serial>
+ </devices>
+</domain>
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-unix.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-unix.xml 15 Apr 2008 21:31:32 -0000
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <serial type='unix'>
+ <source mode='connect' path='/tmp/serial.sock'/>
+ <target port='0'/>
+ </serial>
+ </devices>
+</domain>
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args 15 Apr 2008 21:31:32 -0000
@@ -0,0 +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
Index: tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
===================================================================
RCS file: tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
diff -N tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/qemuxml2argvdata/qemuxml2argv-serial-vc.xml 15 Apr 2008 21:31:33 -0000
@@ -0,0 +1,25 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda'/>
+ </disk>
+ <serial type='vc'>
+ <target port='0'/>
+ </serial>
+ </devices>
+</domain>
--
|: 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 :|
16 years, 7 months