Fix a memory error on Xen device removal

* src/xm_internals.c: the memory shrinking on device removal
  didn't copy the right amount of memory, patch by Daniel Berrange
  fixes #497051
daniel
This commit is contained in:
Daniel Veillard 2009-06-04 13:56:49 +00:00
parent 3166570f7c
commit f969e393a9
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
Thu Jun 4 15:54:24 CEST 2009 Daniel Veillard <veillard@redhat.com>
* src/xm_internals.c: the memory shrinking on device removal
didn't copy the right amount of memory, patch by Daniel Berrange
fixes #497051
Wed Jun 3 15:32:52 BST 2009 Daniel P. Berrange <berrange@redhat.com>
* src/vbox/vbox_tmpl.c: Add NUMA memory APIs

View File

@ -2943,7 +2943,8 @@ xenXMDomainDetachDevice(virDomainPtr domain, const char *xml) {
if (i < (def->ndisks - 1))
memmove(def->disks + i,
def->disks + i + 1,
def->ndisks - (i + 1));
sizeof(*def->disks) *
(def->ndisks - (i + 1)));
break;
}
}
@ -2960,7 +2961,8 @@ xenXMDomainDetachDevice(virDomainPtr domain, const char *xml) {
if (i < (def->nnets - 1))
memmove(def->nets + i,
def->nets + i + 1,
def->nnets - (i + 1));
sizeof(*def->nets) *
(def->nnets - (i + 1)));
break;
}
}