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

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

 



On 2012年04月17日 11:38, Eric Blake wrote:
On 04/16/2012 09:03 PM, Osier Yang wrote:
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
you'd
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.

ACK.


Two follow up patches, one is to update test read-bufsiz to delete
the UUID, as domain UUID for test driver is fixed now. The other
is to allow the parsing of "cpuset" if the "placement" is not
specified, but "cpuset" is specified, and in this case the "placement"
mode will be set as "static".

>From 270bb38c25e4fbed32193838dc81ec52a46780c3 Mon Sep 17 00:00:00 2001
From: Osier Yang <jyang@xxxxxxxxxx>
Date: Tue, 17 Apr 2012 12:40:03 +0800
Subject: [PATCH] conf: Do not parse cpuset only if the placement is auto

So that a domain xml which doesn't have "placement" specified, but
"cpuset" is specified, could be parsed. And in this case, the
"placement" mode will be set as "static".
---
 src/conf/domain_conf.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b28ae5c..65a35c3 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7896,11 +7896,10 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
         }
         VIR_FREE(tmp);
     } else {
-        if (def->cpumasklen)
-            def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC;
+        def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_DEFAULT;
     }
 
-    if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC) {
+    if (def->placement_mode != VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) {
         tmp = virXPathString("string(./vcpu[1]/@cpuset)", ctxt);
         if (tmp) {
             char *set = tmp;
@@ -7912,6 +7911,8 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
                                      def->cpumasklen) < 0)
                 goto error;
             VIR_FREE(tmp);
+            if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_DEFAULT)
+                def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC;
         }
     }
 
-- 
1.7.7.3

>From 6ddb803f074e9d5ce59ac90444d7ebf60d997ba1 Mon Sep 17 00:00:00 2001
From: Osier Yang <jyang@xxxxxxxxxx>
Date: Tue, 17 Apr 2012 12:23:33 +0800
Subject: [PATCH] tests: Update read-bufsiz to delete the UUID of vm XML

Since now we have fixed domain UUID for test driver, defining
a domain with different name but same UUID doesn't work any
more. This patch delete the UUID from the dumped XML so that
it could be generated.
---
 tests/read-bufsiz |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/read-bufsiz b/tests/read-bufsiz
index 2a91bcf..a4c6007 100755
--- a/tests/read-bufsiz
+++ b/tests/read-bufsiz
@@ -32,8 +32,10 @@ fail=0
 # Output a valid definition, to be used as input.
 $abs_top_builddir/tools/virsh -c test:///default dumpxml 1 > xml.t || fail=1
 
-# Change the VM name
-sed -e "s|<name>test</name>|<name>newtest</name>|g" xml.t > xml
+# Change the VM name and UUID
+sed -e "s|<name>test</name>|<name>newtest</name>|g" \
+  -e "\|<uuid>.*</uuid>|d" \
+  xml.t > xml
 
 for i in before after; do
   # The largest BUFSIZ I've seen is 128K.  This is slightly larger.
-- 
1.7.7.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]