Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2:Test
libvirt
CVE-2010-223x-0009.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File CVE-2010-223x-0009.patch of Package libvirt
>From f087f0656f882be305783e24d55921b57fbbcb97 Mon Sep 17 00:00:00 2001 From: Daniel P. Berrange <berrange@redhat.com> Date: Mon, 14 Jun 2010 16:08:55 +0100 Subject: [PATCH 09/10] Add ability to set a default driver name/type when parsing disks Record a default driver name/type in capabilities struct. Use this when parsing disks if value is not set in XML config. * src/conf/capabilities.h: Record default driver name/type for disks * src/conf/domain_conf.c: Fallback to default driver name/type when parsing disks * src/qemu/qemu_driver.c: Set default driver name/type to raw --- src/conf/capabilities.h | 2 ++ src/conf/domain_conf.c | 21 ++++++++++++++++++--- src/qemu/qemu_driver.c | 8 ++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) Index: libvirt-0.7.2/src/conf/capabilities.h =================================================================== --- libvirt-0.7.2.orig/src/conf/capabilities.h +++ libvirt-0.7.2/src/conf/capabilities.h @@ -115,6 +115,8 @@ struct _virCaps { virCapsGuestPtr *guests; unsigned char macPrefix[VIR_MAC_PREFIX_BUFLEN]; unsigned int emulatorRequired : 1; + const char *defaultDiskDriverName; + const char *defaultDiskDriverType; }; Index: libvirt-0.7.2/src/conf/domain_conf.c =================================================================== --- libvirt-0.7.2.orig/src/conf/domain_conf.c +++ libvirt-0.7.2/src/conf/domain_conf.c @@ -642,6 +642,7 @@ void virDomainRemoveInactive(virDomainOb */ static virDomainDiskDefPtr virDomainDiskDefParseXML(virConnectPtr conn, + virCapsPtr caps, xmlNodePtr node, int flags) { virDomainDiskDefPtr def; @@ -846,6 +847,16 @@ virDomainDiskDefParseXML(virConnectPtr c def->serial = serial; serial = NULL; + if (!def->driverType && + caps->defaultDiskDriverType && + !(def->driverType = strdup(caps->defaultDiskDriverType))) + goto no_memory; + + if (!def->driverName && + caps->defaultDiskDriverName && + !(def->driverName = strdup(caps->defaultDiskDriverName))) + goto no_memory; + cleanup: VIR_FREE(bus); VIR_FREE(type); @@ -861,6 +872,9 @@ cleanup: return def; +no_memory: + virReportOOMError(conn); + error: virDomainDiskDefFree(def); def = NULL; @@ -2347,7 +2361,7 @@ virDomainDeviceDefPtr virDomainDeviceDef if (xmlStrEqual(node->name, BAD_CAST "disk")) { dev->type = VIR_DOMAIN_DEVICE_DISK; - if (!(dev->data.disk = virDomainDiskDefParseXML(conn, node, flags))) + if (!(dev->data.disk = virDomainDiskDefParseXML(conn, caps, node, flags))) goto error; } else if (xmlStrEqual(node->name, BAD_CAST "filesystem")) { dev->type = VIR_DOMAIN_DEVICE_FS; @@ -2752,6 +2766,7 @@ static virDomainDefPtr virDomainDefParse goto no_memory; for (i = 0 ; i < n ; i++) { virDomainDiskDefPtr disk = virDomainDiskDefParseXML(conn, + caps, nodes[i], flags); if (!disk) Index: libvirt-0.7.2/src/qemu/qemu_driver.c =================================================================== --- libvirt-0.7.2.orig/src/qemu/qemu_driver.c +++ libvirt-0.7.2/src/qemu/qemu_driver.c @@ -2453,6 +2453,14 @@ static char *qemudGetCapabilities(virCon goto cleanup; } + if (driver->allowDiskFormatProbing) { + caps->defaultDiskDriverName = NULL; + caps->defaultDiskDriverType = NULL; + } else { + caps->defaultDiskDriverName = "qemu"; + caps->defaultDiskDriverType = "raw"; + } + if (qemu_driver->securityDriver && qemudSecurityCapsInit(qemu_driver->securityDriver, caps) < 0) { virCapabilitiesFree(caps);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor