* Mon Oct 19 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-13
- Misc fixes to qemu machine types handling - A couple of XML formatting fixes
This commit is contained in:
parent
3cfccddffa
commit
7d9775ba12
32
libvirt-network-delay-attribute-formatting.patch
Normal file
32
libvirt-network-delay-attribute-formatting.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From ba3bc9b22a21b8e9e110166c98be70e2ad6469cb Mon Sep 17 00:00:00 2001
|
||||||
|
From: Cole Robinson <crobinso@redhat.com>
|
||||||
|
Date: Tue, 13 Oct 2009 11:31:27 -0400
|
||||||
|
Subject: [PATCH] network: Fix printing XML 'delay' attribute
|
||||||
|
|
||||||
|
When specifying bridge delay via network XML define, we were looking for
|
||||||
|
the 'delay' attribute, but would dump the value as 'forwardDelay'. Have
|
||||||
|
the output match the expected input (and schema).
|
||||||
|
|
||||||
|
(cherry picked from commit 3b13aa3db37bf5a692bccfa015a01999043e797b)
|
||||||
|
|
||||||
|
Fedora-patch: libvirt-network-delay-attribute-formatting.patch
|
||||||
|
---
|
||||||
|
src/network_conf.c | 2 +-
|
||||||
|
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/network_conf.c b/src/network_conf.c
|
||||||
|
index 3764bb4..f75c457 100644
|
||||||
|
--- a/src/network_conf.c
|
||||||
|
+++ b/src/network_conf.c
|
||||||
|
@@ -587,7 +587,7 @@ char *virNetworkDefFormat(virConnectPtr conn,
|
||||||
|
virBufferAddLit(&buf, " <bridge");
|
||||||
|
if (def->bridge)
|
||||||
|
virBufferEscapeString(&buf, " name='%s'", def->bridge);
|
||||||
|
- virBufferVSprintf(&buf, " stp='%s' forwardDelay='%ld' />\n",
|
||||||
|
+ virBufferVSprintf(&buf, " stp='%s' delay='%ld' />\n",
|
||||||
|
def->stp ? "on" : "off",
|
||||||
|
def->delay);
|
||||||
|
|
||||||
|
--
|
||||||
|
1.6.2.5
|
||||||
|
|
177
libvirt-qemu-machine-type-fixes1.patch
Normal file
177
libvirt-qemu-machine-type-fixes1.patch
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
From d7722ed1cb04aa8a7b9fbf880882841867b69ab0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mark McLoughlin <markmc@redhat.com>
|
||||||
|
Date: Mon, 12 Oct 2009 10:52:13 +0100
|
||||||
|
Subject: [PATCH] Take domain type into account when looking up default machine
|
||||||
|
|
||||||
|
If one has e.g.
|
||||||
|
|
||||||
|
<guest>
|
||||||
|
<os_type>hvm</os_type>
|
||||||
|
<arch name='x86_64'>
|
||||||
|
<wordsize>64</wordsize>
|
||||||
|
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||||
|
<machine>pc-0.11</machine>
|
||||||
|
<machine canonical='pc-0.11'>pc</machine>
|
||||||
|
<machine>pc-0.10</machine>
|
||||||
|
<machine>isapc</machine>
|
||||||
|
<domain type='qemu'>
|
||||||
|
</domain>
|
||||||
|
<domain type='kvm'>
|
||||||
|
<emulator>/usr/bin/kvm</emulator>
|
||||||
|
<machine>pc</machine>
|
||||||
|
<machine>isapc</machine>
|
||||||
|
</domain>
|
||||||
|
</arch>
|
||||||
|
</guest>
|
||||||
|
|
||||||
|
and start a guest with:
|
||||||
|
|
||||||
|
<domain type='kvm'>
|
||||||
|
...
|
||||||
|
<os>
|
||||||
|
<type arch='x86_64'>hvm</type>
|
||||||
|
...
|
||||||
|
</os>
|
||||||
|
</domain>
|
||||||
|
|
||||||
|
then the default machine type should be 'pc' and not 'pc-0.11'
|
||||||
|
|
||||||
|
Issue was reported by Anton Protopopov.
|
||||||
|
|
||||||
|
* src/capabilities.[ch]: pass the domain type to
|
||||||
|
virCapabilitiesDefaultGuestArch() and use it to look up the default
|
||||||
|
machine type from a specific guest domain if needed.
|
||||||
|
|
||||||
|
* src/conf/domain_conf.c, src/xen/xm_internal.c: update
|
||||||
|
|
||||||
|
* tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml: update
|
||||||
|
the domain type to 'kvm' and remove the machine type to check
|
||||||
|
that the default gets looked up correctly
|
||||||
|
|
||||||
|
(cherry picked from commit 73c901a8075c09203545fc81164c1e5f11c67c89)
|
||||||
|
|
||||||
|
Fedora-patch: libvirt-qemu-machine-type-fixes1.patch
|
||||||
|
---
|
||||||
|
src/capabilities.c | 31 ++++++++++++++++---
|
||||||
|
src/capabilities.h | 3 +-
|
||||||
|
src/domain_conf.c | 3 +-
|
||||||
|
src/xm_internal.c | 3 +-
|
||||||
|
.../qemuxml2argv-machine-aliases2.xml | 4 +-
|
||||||
|
5 files changed, 34 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/capabilities.c b/src/capabilities.c
|
||||||
|
index 38fe7fc..6ebddf5 100644
|
||||||
|
--- a/src/capabilities.c
|
||||||
|
+++ b/src/capabilities.c
|
||||||
|
@@ -549,22 +549,43 @@ virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
||||||
|
* @caps: capabilities to query
|
||||||
|
* @ostype: OS type to search for
|
||||||
|
* @arch: architecture to search for
|
||||||
|
+ * @domain: domain type to search for
|
||||||
|
*
|
||||||
|
* Returns the first machine variant associated with
|
||||||
|
- * the requested operating system type and architecture
|
||||||
|
+ * the requested operating system type, architecture
|
||||||
|
+ * and domain type
|
||||||
|
*/
|
||||||
|
extern const char *
|
||||||
|
virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
|
||||||
|
const char *ostype,
|
||||||
|
- const char *arch)
|
||||||
|
+ const char *arch,
|
||||||
|
+ const char *domain)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
+
|
||||||
|
for (i = 0 ; i < caps->nguests ; i++) {
|
||||||
|
- if (STREQ(caps->guests[i]->ostype, ostype) &&
|
||||||
|
- STREQ(caps->guests[i]->arch.name, arch) &&
|
||||||
|
- caps->guests[i]->arch.defaultInfo.nmachines)
|
||||||
|
+ virCapsGuestPtr guest = caps->guests[i];
|
||||||
|
+ int j;
|
||||||
|
+
|
||||||
|
+ if (!STREQ(guest->ostype, ostype) || !STREQ(guest->arch.name, arch))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ for (j = 0; j < guest->arch.ndomains; j++) {
|
||||||
|
+ virCapsGuestDomainPtr dom= guest->arch.domains[j];
|
||||||
|
+
|
||||||
|
+ if (!STREQ(dom->type, domain))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ if (!dom->info.nmachines)
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ return dom->info.machines[0]->name;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (guest->arch.defaultInfo.nmachines)
|
||||||
|
return caps->guests[i]->arch.defaultInfo.machines[0]->name;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/capabilities.h b/src/capabilities.h
|
||||||
|
index b958d95..2f24605 100644
|
||||||
|
--- a/src/capabilities.h
|
||||||
|
+++ b/src/capabilities.h
|
||||||
|
@@ -207,7 +207,8 @@ virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
||||||
|
extern const char *
|
||||||
|
virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
|
||||||
|
const char *ostype,
|
||||||
|
- const char *arch);
|
||||||
|
+ const char *arch,
|
||||||
|
+ const char *domain);
|
||||||
|
extern const char *
|
||||||
|
virCapabilitiesDefaultGuestEmulator(virCapsPtr caps,
|
||||||
|
const char *ostype,
|
||||||
|
diff --git a/src/domain_conf.c b/src/domain_conf.c
|
||||||
|
index 5ae0775..c424c67 100644
|
||||||
|
--- a/src/domain_conf.c
|
||||||
|
+++ b/src/domain_conf.c
|
||||||
|
@@ -2664,7 +2664,8 @@ static virDomainDefPtr virDomainDefParseXML(virConnectPtr conn,
|
||||||
|
if (!def->os.machine) {
|
||||||
|
const char *defaultMachine = virCapabilitiesDefaultGuestMachine(caps,
|
||||||
|
def->os.type,
|
||||||
|
- def->os.arch);
|
||||||
|
+ def->os.arch,
|
||||||
|
+ virDomainVirtTypeToString(def->virtType));
|
||||||
|
if (defaultMachine != NULL) {
|
||||||
|
if (!(def->os.machine = strdup(defaultMachine))) {
|
||||||
|
virReportOOMError(conn);
|
||||||
|
diff --git a/src/xm_internal.c b/src/xm_internal.c
|
||||||
|
index de3aca9..6d351d4 100644
|
||||||
|
--- a/src/xm_internal.c
|
||||||
|
+++ b/src/xm_internal.c
|
||||||
|
@@ -720,7 +720,8 @@ xenXMDomainConfigParse(virConnectPtr conn, virConfPtr conf) {
|
||||||
|
|
||||||
|
defaultMachine = virCapabilitiesDefaultGuestMachine(priv->caps,
|
||||||
|
def->os.type,
|
||||||
|
- def->os.arch);
|
||||||
|
+ def->os.arch,
|
||||||
|
+ virDomainVirtTypeToString(def->virtType));
|
||||||
|
if (defaultMachine != NULL) {
|
||||||
|
if (!(def->os.machine = strdup(defaultMachine)))
|
||||||
|
goto no_memory;
|
||||||
|
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml b/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml
|
||||||
|
index 6f62243..a2c6254 100644
|
||||||
|
--- a/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml
|
||||||
|
+++ b/tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml
|
||||||
|
@@ -1,11 +1,11 @@
|
||||||
|
-<domain type='qemu'>
|
||||||
|
+<domain type='kvm'>
|
||||||
|
<name>QEMUGuest1</name>
|
||||||
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
|
<memory>219200</memory>
|
||||||
|
<currentMemory>219200</currentMemory>
|
||||||
|
<vcpu>1</vcpu>
|
||||||
|
<os>
|
||||||
|
- <type arch='x86_64' machine='pc'>hvm</type>
|
||||||
|
+ <type arch='x86_64'>hvm</type>
|
||||||
|
<boot dev='hd'/>
|
||||||
|
</os>
|
||||||
|
<clock offset='utc'/>
|
||||||
|
--
|
||||||
|
1.6.2.5
|
||||||
|
|
42
libvirt-qemu-machine-type-fixes2.patch
Normal file
42
libvirt-qemu-machine-type-fixes2.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
From bb64cc4cbe5d3c69057f63be2c1acaca72038e5a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mark McLoughlin <markmc@redhat.com>
|
||||||
|
Date: Thu, 15 Oct 2009 12:09:17 +0100
|
||||||
|
Subject: [PATCH] Don't copy old machines from a domain which has none
|
||||||
|
|
||||||
|
If the the qemu and kvm binaries are the same, we don't include machine
|
||||||
|
types in the kvm domain info.
|
||||||
|
|
||||||
|
However, the code which refreshes the machine types info from the
|
||||||
|
previous capabilities structure first looks at the kvm domain's info,
|
||||||
|
finds it matches and then copies the empty machine types list over
|
||||||
|
for the top-level qemu domain.
|
||||||
|
|
||||||
|
That doesn't make sense, we shouldn't copy an empty machin types list.
|
||||||
|
|
||||||
|
* src/qemu/qemu_conf.c: qemudGetOldMachinesFromInfo(): don't copy an
|
||||||
|
empty machine types list.
|
||||||
|
|
||||||
|
(cherry picked from commit 2210f8a3a8e2774ca4fb8b42e21899e5b85ca913)
|
||||||
|
|
||||||
|
Fedora-patch: libvirt-qemu-machine-type-fixes2.patch
|
||||||
|
---
|
||||||
|
src/qemu_conf.c | 3 +++
|
||||||
|
1 files changed, 3 insertions(+), 0 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
|
||||||
|
index 0dd0624..34a7fe1 100644
|
||||||
|
--- a/src/qemu_conf.c
|
||||||
|
+++ b/src/qemu_conf.c
|
||||||
|
@@ -505,6 +505,9 @@ qemudGetOldMachinesFromInfo(virCapsGuestDomainInfoPtr info,
|
||||||
|
virCapsGuestMachinePtr *list;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
+ if (!info->nmachines)
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
if (!info->emulator || !STREQ(emulator, info->emulator))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
--
|
||||||
|
1.6.2.5
|
||||||
|
|
30
libvirt-storage-iscsi-auth-xml-formatting.patch
Normal file
30
libvirt-storage-iscsi-auth-xml-formatting.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
From a44bce591a8d746a4a00c8609cb0111c76271cab Mon Sep 17 00:00:00 2001
|
||||||
|
From: Cole Robinson <crobinso@redhat.com>
|
||||||
|
Date: Thu, 8 Oct 2009 18:05:36 -0400
|
||||||
|
Subject: [PATCH] storage: Fix generating iscsi 'auth' xml
|
||||||
|
|
||||||
|
We were missing a closing tag, so the XML wasn't proper.
|
||||||
|
|
||||||
|
(cherry picked from commit 826cbac4591fd5929b497299a90d3a65226b2825)
|
||||||
|
|
||||||
|
Fedora-patch: libvirt-storage-iscsi-auth-xml-formatting.patch
|
||||||
|
---
|
||||||
|
src/storage_conf.c | 2 +-
|
||||||
|
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/storage_conf.c b/src/storage_conf.c
|
||||||
|
index 788de15..1633aac 100644
|
||||||
|
--- a/src/storage_conf.c
|
||||||
|
+++ b/src/storage_conf.c
|
||||||
|
@@ -799,7 +799,7 @@ virStoragePoolSourceFormat(virConnectPtr conn,
|
||||||
|
|
||||||
|
|
||||||
|
if (src->authType == VIR_STORAGE_POOL_AUTH_CHAP)
|
||||||
|
- virBufferVSprintf(buf," <auth type='chap' login='%s' passwd='%s'>\n",
|
||||||
|
+ virBufferVSprintf(buf," <auth type='chap' login='%s' passwd='%s'/>\n",
|
||||||
|
src->auth.chap.login,
|
||||||
|
src->auth.chap.passwd);
|
||||||
|
virBufferAddLit(buf," </source>\n");
|
||||||
|
--
|
||||||
|
1.6.2.5
|
||||||
|
|
18
libvirt.spec
18
libvirt.spec
@ -151,7 +151,7 @@
|
|||||||
Summary: Library providing a simple API virtualization
|
Summary: Library providing a simple API virtualization
|
||||||
Name: libvirt
|
Name: libvirt
|
||||||
Version: 0.7.1
|
Version: 0.7.1
|
||||||
Release: 12%{?dist}%{?extra_release}
|
Release: 13%{?dist}%{?extra_release}
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
Source: http://libvirt.org/sources/libvirt-%{version}.tar.gz
|
Source: http://libvirt.org/sources/libvirt-%{version}.tar.gz
|
||||||
@ -191,6 +191,14 @@ Patch13: libvirt-fix-libvirtd-leak-in-error-reply.patch
|
|||||||
Patch14: libvirt-fix-qemu-restore-from-raw1.patch
|
Patch14: libvirt-fix-qemu-restore-from-raw1.patch
|
||||||
Patch15: libvirt-fix-qemu-restore-from-raw2.patch
|
Patch15: libvirt-fix-qemu-restore-from-raw2.patch
|
||||||
|
|
||||||
|
# Misc fixes to qemu machine types handling
|
||||||
|
Patch16: libvirt-qemu-machine-type-fixes1.patch
|
||||||
|
Patch17: libvirt-qemu-machine-type-fixes2.patch
|
||||||
|
|
||||||
|
# A couple of XML formatting fixes
|
||||||
|
Patch18: libvirt-storage-iscsi-auth-xml-formatting.patch
|
||||||
|
Patch19: libvirt-network-delay-attribute-formatting.patch
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||||
URL: http://libvirt.org/
|
URL: http://libvirt.org/
|
||||||
BuildRequires: python-devel
|
BuildRequires: python-devel
|
||||||
@ -421,6 +429,10 @@ of recent versions of Linux (and other OSes).
|
|||||||
%patch13 -p1
|
%patch13 -p1
|
||||||
%patch14 -p1
|
%patch14 -p1
|
||||||
%patch15 -p1
|
%patch15 -p1
|
||||||
|
%patch16 -p1
|
||||||
|
%patch17 -p1
|
||||||
|
%patch18 -p1
|
||||||
|
%patch19 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Needed for libvirt-logrotate-create-lxc-uml-dirs.patch
|
# Needed for libvirt-logrotate-create-lxc-uml-dirs.patch
|
||||||
@ -815,6 +827,10 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Oct 19 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-13
|
||||||
|
- Misc fixes to qemu machine types handling
|
||||||
|
- A couple of XML formatting fixes
|
||||||
|
|
||||||
* Tue Oct 13 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-12
|
* Tue Oct 13 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-12
|
||||||
- Fix restore of qemu guest using raw save format (#523158)
|
- Fix restore of qemu guest using raw save format (#523158)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user