[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2] libvirt: xen: do not use ioemu type for any emulated NIC

On 2012年04月17日 10:44, Eric Blake wrote:
On 04/16/2012 08:05 PM, Osier Yang wrote:
[09:31]    danpb1    eblake: the fact that we see that error message
suggest a
pre-existing bug in the test suite - the XML being used to define the
test domain is missing a UUID
[09:31]    danpb1    eblake: so the 2 repeated defines get different
auto-generated UUIDs&   thus violate the uniqueness check
[09:31]    danpb1    eblake: i expect if you fixed that problem, then
now see the 'define' operation actually suceed

Not true, there is UUID in the dumped xml:

A generated UUID - that is, we have a latent bug, in that since we
aren't locking down a specific UUID, the generated one is different each
time, and the test failed (as expected), but for the wrong reason
(mismatch in UUID, instead of the intended failure due to a cpuset
syntax error).

Yeah, just because the cpuset syntax error comes up earlier before
the UUID checking. I post a patch to set the fixed UUID for the
objects which support UUID in test driver, see the attachment.

>From e88a6d45bf5b14d29ce089afcb1255e24e2f222c Mon Sep 17 00:00:00 2001
From: Osier Yang <jyang redhat com>
Date: Tue, 17 Apr 2012 10:52:44 +0800
Subject: [PATCH] test: Set the fixed uuid for the default XMLs

The objects (domain, pool, network, etc) for testing are defined/
started each time when opening a connect to test driver, and thus
the UUID for the objects will be generated each time, with different
values. e.g.

% for i in {1..3}; do ./tools/virsh --connect \
  test:///default dumpxml test | grep uuid; done

It's the potential bug which can cause operations like below to fail:

$ virsh -c test:///default dumpxml test > test.xml

[ Some modificatons, though it's not supported, but it should work ]

$ virsh -c test:///default define test.xml

This patch set fixed UUID for objects which support it. (domain,
pool, network).
 src/test/test_driver.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 1587958..39ac503 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -230,6 +230,7 @@ no_memory:
 static const char *defaultDomainXML =
 "<domain type='test'>"
 "  <name>test</name>"
+"  <uuid>6695eb01-f6a4-8304-79aa-97f2502e193f</uuid>"
 "  <memory>8388608</memory>"
 "  <currentMemory>2097152</currentMemory>"
 "  <vcpu>2</vcpu>"
@@ -242,6 +243,7 @@ static const char *defaultDomainXML =
 static const char *defaultNetworkXML =
 "  <name>default</name>"
+"  <uuid>dd8fe884-6c02-601e-7551-cca97df1c5df</uuid>"
 "  <bridge name='virbr0' />"
 "  <forward/>"
 "  <ip address='' netmask=''>"
@@ -265,6 +267,7 @@ static const char *defaultInterfaceXML =
 static const char *defaultPoolXML =
 "<pool type='dir'>"
 "  <name>default-pool</name>"
+"  <uuid>dfe224cb-28fb-8dd0-c4b2-64eb3f0f4566</uuid>"
 "  <target>"
 "    <path>/default-pool</path>"
 "  </target>"

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]