[libvirt] [PATCH v2] qemu: Fix domxml-to-native network model conversion

https://bugzilla.redhat.com/show_bug.cgi?id=636832 --- v2: Don't needlessly reallocate model src/qemu/qemu_driver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index feda4d9..7c462a2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5362,6 +5362,8 @@ static char *qemuDomainXMLToNative(virConnectPtr conn, for (i = 0 ; i < def->nnets ; i++) { virDomainNetDefPtr net = def->nets[i]; int bootIndex = net->info.bootIndex; + char *model = net->model; + if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) { int actualType = virDomainNetGetActualType(net); const char *brname; @@ -5418,8 +5420,10 @@ static char *qemuDomainXMLToNative(virConnectPtr conn, net->data.ethernet.dev = brname; net->data.ethernet.ipaddr = ipaddr; } + VIR_FREE(net->virtPortProfile); net->info.bootIndex = bootIndex; + net->model = model; } monitor_json = qemuCapsGet(caps, QEMU_CAPS_MONITOR_JSON); -- 1.7.11.7

On 10/21/2012 04:46 PM, Cole Robinson wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=636832 ---
v2: Don't needlessly reallocate model
src/qemu/qemu_driver.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index feda4d9..7c462a2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5362,6 +5362,8 @@ static char *qemuDomainXMLToNative(virConnectPtr conn, for (i = 0 ; i < def->nnets ; i++) { virDomainNetDefPtr net = def->nets[i]; int bootIndex = net->info.bootIndex; + char *model = net->model; + if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) { int actualType = virDomainNetGetActualType(net); const char *brname; @@ -5418,8 +5420,10 @@ static char *qemuDomainXMLToNative(virConnectPtr conn, net->data.ethernet.dev = brname; net->data.ethernet.ipaddr = ipaddr; } + VIR_FREE(net->virtPortProfile); net->info.bootIndex = bootIndex; + net->model = model; }
monitor_json = qemuCapsGet(caps, QEMU_CAPS_MONITOR_JSON);
Ping, could someone look this over? Fixes a (minor) fedora bug but I'd like to get the patch into 0.10.2-maint before cutting a release. Thanks, Cole

On 10/21/12 22:46, Cole Robinson wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=636832 ---
v2: Don't needlessly reallocate model
src/qemu/qemu_driver.c | 4 ++++ 1 file changed, 4 insertions(+)
ACK, you resolved what I pointed out in the review of v1. Peter

On 10/25/2012 06:12 PM, Peter Krempa wrote:
On 10/21/12 22:46, Cole Robinson wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=636832 ---
v2: Don't needlessly reallocate model
src/qemu/qemu_driver.c | 4 ++++ 1 file changed, 4 insertions(+)
ACK, you resolved what I pointed out in the review of v1.
Peter
Thanks Peter, pushed now. - Cole
participants (2)
-
Cole Robinson
-
Peter Krempa