increase buffer used for xend response

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=150
This commit is contained in:
James Fehlig 2011-09-14 22:20:31 +00:00 committed by Git OBS Bridge
parent 66a9d8b90f
commit 2753a14226
6 changed files with 94 additions and 10 deletions

View File

@ -0,0 +1,47 @@
commit 32620dabb12df70e14a645c20797b7658cd89e02
Author: Jim Fehlig <jfehlig@suse.com>
Date: Thu Sep 1 16:22:38 2011 -0600
Don't overwrite errors from xend_{get,req}
xenDaemonDomainFetch() was overwriting errors reported by
xend_get() and xend_req(). E.g. without patch
error: failed Xen syscall xenDaemonDomainFetch failed to find this domain
with patch
error: internal error Xend returned HTTP Content-Length of 73817, which exceeds
maximum of 65536
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index f44d674..957cd17 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -359,8 +359,10 @@ xend_get(virConnectPtr xend, const char *path,
ret = xend_req(s, content);
VIR_FORCE_CLOSE(s);
- if (((ret < 0) || (ret >= 300)) &&
- ((ret != 404) || (!STRPREFIX(path, "/xend/domain/")))) {
+ if (ret < 0)
+ return ret;
+
+ if ((ret >= 300) && ((ret != 404) || (!STRPREFIX(path, "/xend/domain/")))) {
virXendError(VIR_ERR_GET_FAILED,
_("%d status from xen daemon: %s:%s"),
ret, path, NULLSTR(*content));
@@ -1810,12 +1812,8 @@ xenDaemonDomainFetch(virConnectPtr conn,
root = sexpr_get(conn, "/xend/domain/%s?detail=1", name);
else
root = sexpr_get(conn, "/xend/domain/%d?detail=1", domid);
- if (root == NULL) {
- virXendError(VIR_ERR_XEN_CALL,
- "%s", _("xenDaemonDomainFetch failed to"
- " find this domain"));
+ if (root == NULL)
return (NULL);
- }
priv = (xenUnifiedPrivatePtr) conn->privateData;

View File

@ -0,0 +1,24 @@
commit 57c95175e271ca63b3f1be44efef8997f20ffe13
Author: Jim Fehlig <jfehlig@suse.com>
Date: Thu Sep 1 16:40:46 2011 -0600
Increase size of buffer for xend response
On systems with many pcpus, the sexpr returned by xend can be quite
large for dom0 when it is configured to have #vcpus = #pcpus (default).
E.g. on a 80 pcpu system, where dom0 had 80 vcpus, the sexpr details
for dom0 was 73817 bytes! Increase maximum buffer size to 256k.
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 957cd17..0a7fb48 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -56,7 +56,7 @@
* The number of Xen scheduler parameters
*/
-#define XEND_RCV_BUF_MAX_LEN 65536
+#define XEND_RCV_BUF_MAX_LEN (256 * 1024)
static int
virDomainXMLDevID(virDomainPtr domain,

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Sep 14 16:12:49 MDT 2011 - jfehlig@suse.com
- Increase max size of buffer used to receive xend response
57c95175-xend-buff-size.patch
- Don't overwrite useful error messages in legacy xen driver
32620dab-fix-xen-err-msg.patch
bnc#711096
-------------------------------------------------------------------
Wed Sep 14 15:49:37 MDT 2011 - jfehlig@suse.com

View File

@ -361,8 +361,10 @@ Source2: libvirtd-relocation-server.fw
Source99: baselibs.conf
# Upstream patches
Patch0: 9e093f0b-libvirtd-sighup.patch
Patch1: 6ff9fc26-quiet-libxl-logging.patch
Patch2: 7f2498ef-no-log-invalid.patch
Patch1: 32620dab-fix-xen-err-msg.patch
Patch2: 57c95175-xend-buff-size.patch
Patch3: 6ff9fc26-quiet-libxl-logging.patch
Patch4: 7f2498ef-no-log-invalid.patch
# Need to go upstream
Patch100: xen-name-for-devid.patch
Patch101: clone.patch
@ -484,6 +486,8 @@ Authors:
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch100 -p1
%patch101
%patch102 -p1

View File

@ -32,7 +32,7 @@ Index: libvirt-0.9.4/daemon/libvirtd.c
===================================================================
--- libvirt-0.9.4.orig/daemon/libvirtd.c
+++ libvirt-0.9.4/daemon/libvirtd.c
@@ -880,7 +880,7 @@ daemonConfigNew(bool privileged ATTRIBUT
@@ -881,7 +881,7 @@ daemonConfigNew(bool privileged ATTRIBUT
return NULL;
}
@ -41,7 +41,7 @@ Index: libvirt-0.9.4/daemon/libvirtd.c
data->listen_tcp = 0;
if (!(data->tls_port = strdup(LIBVIRTD_TLS_PORT)))
@@ -917,7 +917,7 @@ daemonConfigNew(bool privileged ATTRIBUT
@@ -918,7 +918,7 @@ daemonConfigNew(bool privileged ATTRIBUT
#endif
data->auth_tls = REMOTE_AUTH_NONE;

View File

@ -25,7 +25,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
virDomainDeviceDefPtr dev,
char *class,
char *ref,
@@ -2807,7 +2808,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
@@ -2805,7 +2806,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
sexpr = virBufferContentAndReset(&buf);
@ -34,7 +34,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
/* device doesn't exist, define it */
ret = xend_op(domain->conn, domain->name, "op", "device_create",
"config", sexpr, NULL);
@@ -2928,7 +2929,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr
@@ -2926,7 +2927,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr
sexpr = virBufferContentAndReset(&buf);
@ -43,7 +43,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
_("requested device does not exist"));
goto cleanup;
@@ -3023,7 +3024,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
@@ -3021,7 +3022,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
def, xml, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
@ -52,7 +52,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
goto cleanup;
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
@@ -3979,6 +3980,7 @@ struct xenUnifiedDriver xenDaemonDriver
@@ -3977,6 +3978,7 @@ struct xenUnifiedDriver xenDaemonDriver
*/
static int
virDomainXMLDevID(virDomainPtr domain,
@ -60,7 +60,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
virDomainDeviceDefPtr dev,
char *class,
char *ref,
@@ -3987,8 +3989,12 @@ virDomainXMLDevID(virDomainPtr domain,
@@ -3985,8 +3987,12 @@ virDomainXMLDevID(virDomainPtr domain,
xenUnifiedPrivatePtr priv = domain->conn->privateData;
char *xref;
char *tmp;
@ -73,7 +73,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
if (dev->data.disk->driverName &&
STREQ(dev->data.disk->driverName, "tap"))
strcpy(class, "tap");
@@ -3998,19 +4004,21 @@ virDomainXMLDevID(virDomainPtr domain,
@@ -3996,19 +4002,21 @@ virDomainXMLDevID(virDomainPtr domain,
else
strcpy(class, "vbd");