conf: add net device prefix for Xen
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 16 lines · Jim Fehlig
In commit
d2e5538b1, the libxl driver was changed to copy interface names autogenerated by libxl to the corresponding network def in the domain's virDomainDef object. The copied name is freed when the domain transitions to the shutoff state. But when migrating a domain, the autogenerated name is included in the XML sent to the destination host. It is possible an interface with the same name already exists on the destination host, causing migration to fail. Indeed the Xen project's OSSTEST CI already encountered such a failure.This patch defines another
VIR_NET_GENERATED_PREFIXfor Xen, allowing the autogenerated names to be excluded when parsing and formatting inactive config.Signed-off-by Jim Fehlig <[email protected]>---
Quoted 8 lines
This is an alternative approach to Joao's fix for this regression
https://www.redhat.com/archives/libvir-list/2015-December/msg00197.html
I think it is the same approach used by the qemu driver. My only reservation is that it expands the potential for clashes with user-defined names. I.e. with this change both 'vnet' and 'vif' are reserved prefixes.
Hmm, yes, tricky one.
If we only care about XML parsing, then you could register a post parse callback instead to do this.
I'm not clear why we also have it in the virDomainNetDefFormat method - and we can't solve that with a post-parse callback.
The other option would be to make the reserved prefix be a capability that the parser/formatter could read.
Quoted 75 lines
src/conf/domain_conf.c | 6 ++++-- src/conf/domain_conf.h | 4 ++++ src/libxl/libxl_domain.c | 5 +++-- 3 files changed, 11 insertions(+), 4 deletions(-)src/conf/domain_conf.c +4
-2@@ -8428,7 +8428,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, ifname =virXMLPropString (cur,"dev" );if (ifname && (flags &VIR_DOMAIN_DEF_PARSE_INACTIVE ) && -STRPREFIX (ifname,VIR_NET_GENERATED_PREFIX )) { + (STRPREFIX (ifname,VIR_NET_GENERATED_PREFIX ) || +STRPREFIX (ifname,VIR_NET_GENERATED_PREFIX_XEN ))) {/* An auto-generated target name, blank it out */ VIR_FREE (ifname); }@@ -19790,7 +19791,8 @@ virDomainNetDefFormat(virBufferPtr buf,virBufferEscapeString (buf,"<backenddomain name='%s'/>\n" , def->domain_name);if (def->ifname && !((flags &VIR_DOMAIN_DEF_FORMAT_INACTIVE ) && - (STRPREFIX (def->ifname,VIR_NET_GENERATED_PREFIX )))) { + (STRPREFIX (def->ifname,VIR_NET_GENERATED_PREFIX ) || +STRPREFIX (def->ifname,VIR_NET_GENERATED_PREFIX_XEN )))) {/* Skip auto-generated target names for inactive config. */ virBufferEscapeString (buf,"<target dev='%s'/>\n" , def->ifname); }src/conf/domain_conf.h +4
-0@@ -1085,6 +1085,10 @@ struct _virDomainNetDef {* by libvirt, and cannot be used for a persistent network name. */ # define VIR_NET_GENERATED_PREFIX "vnet" +/* Used for prefix of ifname of any network name generated dynamically +* by libvirt for Xen, and cannot be used for a persistent network name. */ +# define VIR_NET_GENERATED_PREFIX_XEN "vif" + typedef enum { VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT = 0, VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED,src/libxl/libxl_domain.c +3
-2@@ -734,7 +734,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,for (i =0 ; i < vm->def->nnets; i++) {virDomainNetDefPtr net = vm->def->nets[i]; -if (STRPREFIX (net->ifname,"vif" )) +if (STRPREFIX (net->ifname,VIR_NET_GENERATED_PREFIX_XEN ))VIR_FREE (net->ifname); } }@@ -918,7 +918,8 @@ libxlDomainCreateIfaceNames(virDomainDefPtr def, libxl_domain_config *d_config)if (net->ifname)continue ; -ignore_value (virAsprintf (&net->ifname,"vif%d.%d%s" , +ignore_value (virAsprintf (&net->ifname, +VIR_NET_GENERATED_PREFIX_XEN "%d.%d%s" , def->id, x_nic->devid, suffix)); } }Signature · 6 lines
2.6.1 -- libvir-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/libvir-list
Regards,
Daniel
Signature · 4 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 21 lines · Daniel P. Berrange
Quoted 20 lines · Jim Fehlig
In commit
d2e5538b1, the libxl driver was changed to copy interface names autogenerated by libxl to the corresponding network def in the domain's virDomainDef object. The copied name is freed when the domain transitions to the shutoff state. But when migrating a domain, the autogenerated name is included in the XML sent to the destination host. It is possible an interface with the same name already exists on the destination host, causing migration to fail. Indeed the Xen project's OSSTEST CI already encountered such a failure.This patch defines another
VIR_NET_GENERATED_PREFIXfor Xen, allowing the autogenerated names to be excluded when parsing and formatting inactive config.Signed-off-by Jim Fehlig <[email protected]>---
This is an alternative approach to Joao's fix for this regression
https://www.redhat.com/archives/libvir-list/2015-December/msg00197.html
Quoted 8 lines
Quoted 4 lines
I think it is the same approach used by the qemu driver. My only reservation is that it expands the potential for clashes with user-defined names. I.e. with this change both 'vnet' and 'vif' are reserved prefixes.
Hmm, yes, tricky one.
If we only care about XML parsing, then you could register a post parse callback instead to do this.
AFAIK, XML parsing is all that's in play here.
Quoted 6 lines
I'm not clear why we also have it in the virDomainNetDefFormat method - and we can't solve that with a post-parse callback.
The other option would be to make the reserved prefix be a capability that the parser/formatter could read.
This seems like the best option, since a post-parse callback doesn't solve the problem in virDomainNetDefFormat. It also has the upshot of making the prefix visible and known to users. But I doubt such a change is suitable during 1.3.0 freeze. With the freeze in mind, seems the best solution to the libxl migration regression is revert d2e5538b1. It can be added again post-1.3.0 release, after adding the prefix to capabilities.
DV, since you may be making the release soon, feel free to revert d2e5538b1 if you agree.
Regards,
Jim
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 47 lines · Jim Fehlig
Quoted 21 lines · Daniel P. Berrange
Quoted 20 lines · Jim Fehlig
In commit
d2e5538b1, the libxl driver was changed to copy interface names autogenerated by libxl to the corresponding network def in the domain's virDomainDef object. The copied name is freed when the domain transitions to the shutoff state. But when migrating a domain, the autogenerated name is included in the XML sent to the destination host. It is possible an interface with the same name already exists on the destination host, causing migration to fail. Indeed the Xen project's OSSTEST CI already encountered such a failure.This patch defines another
VIR_NET_GENERATED_PREFIXfor Xen, allowing the autogenerated names to be excluded when parsing and formatting inactive config.Signed-off-by Jim Fehlig <[email protected]>---
This is an alternative approach to Joao's fix for this regression
https://www.redhat.com/archives/libvir-list/2015-December/msg00197.html
Quoted 8 lines
Quoted 4 lines
I think it is the same approach used by the qemu driver. My only reservation is that it expands the potential for clashes with user-defined names. I.e. with this change both 'vnet' and 'vif' are reserved prefixes.
Hmm, yes, tricky one.
If we only care about XML parsing, then you could register a post parse callback instead to do this.
AFAIK, XML parsing is all that's in play here.
Quoted 6 lines
I'm not clear why we also have it in the virDomainNetDefFormat method - and we can't solve that with a post-parse callback.
The other option would be to make the reserved prefix be a capability that the parser/formatter could read.
This seems like the best option, since a post-parse callback doesn't solve the problem in virDomainNetDefFormat. It also has the upshot of making the prefix visible and known to users. But I doubt such a change is suitable during 1.3.0 freeze. With the freeze in mind, seems the best solution to the libxl migration regression is revert
d2e5538b1. It can be added again post-1.3.0 release, after adding the prefix to capabilities.
Quoted 2 lines
DV, since you may be making the release soon, feel free to revert
d2e5538b1if you agree.
Yeah, just go ahead & revert it Jim, DV isn't doing the releae until tomorrow morning
Regards,
Daniel
Signature · 4 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 46 lines · Daniel P. Berrange
Quoted 45 lines · Jim Fehlig
Quoted 21 lines · Daniel P. Berrange
Quoted 20 lines · Jim Fehlig
In commit
d2e5538b1, the libxl driver was changed to copy interface names autogenerated by libxl to the corresponding network def in the domain's virDomainDef object. The copied name is freed when the domain transitions to the shutoff state. But when migrating a domain, the autogenerated name is included in the XML sent to the destination host. It is possible an interface with the same name already exists on the destination host, causing migration to fail. Indeed the Xen project's OSSTEST CI already encountered such a failure.This patch defines another
VIR_NET_GENERATED_PREFIXfor Xen, allowing the autogenerated names to be excluded when parsing and formatting inactive config.Signed-off-by Jim Fehlig <[email protected]>---
This is an alternative approach to Joao's fix for this regression
https://www.redhat.com/archives/libvir-list/2015-December/msg00197.html
Quoted 8 lines
Quoted 4 lines
I think it is the same approach used by the qemu driver. My only reservation is that it expands the potential for clashes with user-defined names. I.e. with this change both 'vnet' and 'vif' are reserved prefixes.
Hmm, yes, tricky one.
If we only care about XML parsing, then you could register a post parse callback instead to do this.
AFAIK, XML parsing is all that's in play here.
Quoted 6 lines
I'm not clear why we also have it in the virDomainNetDefFormat method - and we can't solve that with a post-parse callback.
The other option would be to make the reserved prefix be a capability that the parser/formatter could read.
This seems like the best option, since a post-parse callback doesn't solve the problem in virDomainNetDefFormat. It also has the upshot of making the prefix visible and known to users. But I doubt such a change is suitable during 1.3.0 freeze. With the freeze in mind, seems the best solution to the libxl migration regression is revert
d2e5538b1. It can be added again post-1.3.0 release, after adding the prefix to capabilities.
Quoted 5 lines
Quoted 2 lines
DV, since you may be making the release soon, feel free to revert
d2e5538b1if you agree.Yeah, just go ahead & revert it Jim, DV isn't doing the releae until tomorrow morning
I've pushed the revert.
Joao, sorry for yanking this for 1.3.0. We can get it in 1.3.1, after exposing the prefix in capabilities.
Regards,
Jim
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 50 lines · Jim Fehlig
Quoted 49 lines · Daniel P. Berrange
Quoted 47 lines · Jim Fehlig
Quoted 21 lines · Daniel P. Berrange
Quoted 20 lines · Jim Fehlig
In commit
d2e5538b1, the libxl driver was changed to copy interface names autogenerated by libxl to the corresponding network def in the domain's virDomainDef object. The copied name is freed when the domain transitions to the shutoff state. But when migrating a domain, the autogenerated name is included in the XML sent to the destination host. It is possible an interface with the same name already exists on the destination host, causing migration to fail. Indeed the Xen project's OSSTEST CI already encountered such a failure.This patch defines another
VIR_NET_GENERATED_PREFIXfor Xen, allowing the autogenerated names to be excluded when parsing and formatting inactive config.Signed-off-by Jim Fehlig <[email protected]>---
This is an alternative approach to Joao's fix for this regression
https://www.redhat.com/archives/libvir-list/2015-December/msg00197.html
Quoted 8 lines
Quoted 4 lines
I think it is the same approach used by the qemu driver. My only reservation is that it expands the potential for clashes with user-defined names. I.e. with this change both 'vnet' and 'vif' are reserved prefixes.
Hmm, yes, tricky one.
If we only care about XML parsing, then you could register a post parse callback instead to do this.
AFAIK, XML parsing is all that's in play here.
Quoted 6 lines
I'm not clear why we also have it in the virDomainNetDefFormat method - and we can't solve that with a post-parse callback.
The other option would be to make the reserved prefix be a capability that the parser/formatter could read.
This seems like the best option, since a post-parse callback doesn't solve the problem in virDomainNetDefFormat. It also has the upshot of making the prefix visible and known to users. But I doubt such a change is suitable during 1.3.0 freeze. With the freeze in mind, seems the best solution to the libxl migration regression is revert
d2e5538b1. It can be added again post-1.3.0 release, after adding the prefix to capabilities.DV, since you may be making the release soon, feel free to revert
d2e5538b1if you agree.
Quoted 8 lines
Quoted 2 lines
Yeah, just go ahead & revert it Jim, DV isn't doing the releae until tomorrow morning
I've pushed the revert.
Joao, sorry for yanking this for 1.3.0. We can get it in 1.3.1, after exposing the prefix in capabilities.
Hey Jim,
I had the impression we had pushed this back in (i.e. cherry-picking d2e5538) but I was double checking and that's doesn't seem to be case. In adding support for the prefix in capabilities I found out one issue on the migration failure path leading to dereferencing a NULL pointer on the destination. If you agree could we squash the following chunk in addition to the cherry-pick of d2e5538:
src/libxl/libxl_domain.c +1 -1
@@ -768,7 +768,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,for (i =0 ; i < vm->def->nnets; i++) {virDomainNetDefPtr net = vm->def->nets[i]; -if (STRPREFIX (net->ifname,"vif" )) +if (net->ifname &&STRPREFIX (net->ifname,"vif" ))VIR_FREE (net->ifname); } }
src/libxl/libxl_driver.c +1 -1
@@ -5590,7 +5590,7 @@ static virHypervisorDriver libxlHypervisorDriver = { .domainGetJobStats = libxlDomainGetJobStats, /* 1.3.1 */ .domainMemoryStats = libxlDomainMemoryStats, /* 1.3.0 */ .domainGetCPUStats = libxlDomainGetCPUStats, /* 1.3.0 */ - .domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.0 */ + .domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.2 */ .connectDomainEventRegister = libxlConnectDomainEventRegister, /* 0.9.0 */ .connectDomainEventDeregister = libxlConnectDomainEventDeregister, /* 0.9.0 */ .domainManagedSave = libxlDomainManagedSave, /* 0.9.2 */
Or do you think it should be deferred to 1.3.3 ?
Thanks,
Joao
Quoted 8 lines
Regards,
Jim--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list
Quoted 97 lines · Joao Martins
Quoted 50 lines · Jim Fehlig
Quoted 49 lines · Daniel P. Berrange
Quoted 47 lines · Jim Fehlig
Quoted 21 lines · Daniel P. Berrange
Quoted 20 lines · Jim Fehlig
In commit
d2e5538b1, the libxl driver was changed to copy interface names autogenerated by libxl to the corresponding network def in the domain's virDomainDef object. The copied name is freed when the domain transitions to the shutoff state. But when migrating a domain, the autogenerated name is included in the XML sent to the destination host. It is possible an interface with the same name already exists on the destination host, causing migration to fail. Indeed the Xen project's OSSTEST CI already encountered such a failure.This patch defines another
VIR_NET_GENERATED_PREFIXfor Xen, allowing the autogenerated names to be excluded when parsing and formatting inactive config.Signed-off-by Jim Fehlig <[email protected]>---
This is an alternative approach to Joao's fix for this regression
https://www.redhat.com/archives/libvir-list/2015-December/msg00197.html
Quoted 8 lines
Quoted 4 lines
I think it is the same approach used by the qemu driver. My only reservation is that it expands the potential for clashes with user-defined names. I.e. with this change both 'vnet' and 'vif' are reserved prefixes.
Hmm, yes, tricky one.
If we only care about XML parsing, then you could register a post parse callback instead to do this.
AFAIK, XML parsing is all that's in play here.
Quoted 6 lines
I'm not clear why we also have it in the virDomainNetDefFormat method - and we can't solve that with a post-parse callback.
The other option would be to make the reserved prefix be a capability that the parser/formatter could read.
This seems like the best option, since a post-parse callback doesn't solve the problem in virDomainNetDefFormat. It also has the upshot of making the prefix visible and known to users. But I doubt such a change is suitable during 1.3.0 freeze. With the freeze in mind, seems the best solution to the libxl migration regression is revert
d2e5538b1. It can be added again post-1.3.0 release, after adding the prefix to capabilities.DV, since you may be making the release soon, feel free to revert
d2e5538b1if you agree.Quoted 8 lines
Quoted 2 lines
Yeah, just go ahead & revert it Jim, DV isn't doing the releae until tomorrow morning
I've pushed the revert.
Joao, sorry for yanking this for 1.3.0. We can get it in 1.3.1, after exposing the prefix in capabilities.
Hey Jim,
I had the impression we had pushed this back in (i.e. cherry-picking d2e5538) but I was double checking and that's doesn't seem to be case. In adding support for the prefix in capabilities I found out one issue on the migration failure path leading to dereferencing a NULL pointer on the destination. If you agree could we squash the following chunk in addition to the cherry-pick of d2e5538:
src/libxl/libxl_domain.c +1
-1@@ -768,7 +768,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,for (i =0 ; i < vm->def->nnets; i++) {virDomainNetDefPtr net = vm->def->nets[i]; -if (STRPREFIX (net->ifname,"vif" )) +if (net->ifname &&STRPREFIX (net->ifname,"vif" ))VIR_FREE (net->ifname); } }src/libxl/libxl_driver.c +1
-1@@ -5590,7 +5590,7 @@ static virHypervisorDriver libxlHypervisorDriver = { .domainGetJobStats = libxlDomainGetJobStats, /* 1.3.1 */ .domainMemoryStats = libxlDomainMemoryStats, /* 1.3.0 */ .domainGetCPUStats = libxlDomainGetCPUStats, /* 1.3.0 */ - .domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.0 */ + .domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.2 */ .connectDomainEventRegister = libxlConnectDomainEventRegister, /* 0.9.0 */ .connectDomainEventDeregister = libxlConnectDomainEventDeregister, /* 0.9.0 */ .domainManagedSave = libxlDomainManagedSave, /* 0.9.2 */
Quoted 1 line
Or do you think it should be deferred to 1.3.3 ?
In case this is considered, please ignore the above chunk in my previous message.
The one below should be better since I introduced LIBXL_GENERATED_PREFIX_XEN on a040ba9 which means no need to hardcode "vif".
Regards,
Joao
src/libxl/libxl_domain.c +2 -1
@@ -768,7 +768,8 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,for (i =0 ; i < vm->def->nnets; i++) {virDomainNetDefPtr net = vm->def->nets[i]; -if (STRPREFIX (net->ifname,"vif" )) +if (net->ifname && +STRPREFIX (net->ifname,LIBXL_GENERATED_PREFIX_XEN ))VIR_FREE (net->ifname); } }
@@ -960,7 +961,8 @@ libxlDomainCreateIfaceNames(virDomainDefPtr def,
libxl_domain_config *d_config)
if (net->ifname)
continue;- ignore_value(virAsprintf(&net->ifname, "vif%d.%d%s",
+ ignore_value(virAsprintf(&net->ifname,
+ LIBXL_GENERATED_PREFIX_XEN "%d.%d%s",
def->id, x_nic->devid, suffix));
}}
src/libxl/libxl_driver.c +1 -1
@@ -5590,7 +5590,7 @@ static virHypervisorDriver libxlHypervisorDriver = { .domainGetJobStats = libxlDomainGetJobStats, /* 1.3.1 */ .domainMemoryStats = libxlDomainMemoryStats, /* 1.3.0 */ .domainGetCPUStats = libxlDomainGetCPUStats, /* 1.3.0 */ - .domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.0 */ + .domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.2 */ .connectDomainEventRegister = libxlConnectDomainEventRegister, /* 0.9.0 */ .connectDomainEventDeregister = libxlConnectDomainEventDeregister, /* 0.9.0 */ .domainManagedSave = libxlDomainManagedSave, /* 0.9.2 */
Quoted 8 lines
Quoted 8 lines
Regards,
Jim--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list
Quoted 94 lines · Joao Martins
Quoted 47 lines · Jim Fehlig
Quoted 46 lines · Daniel P. Berrange
Quoted 45 lines · Jim Fehlig
Quoted 21 lines · Daniel P. Berrange
Quoted 20 lines · Jim Fehlig
In commit
d2e5538b1, the libxl driver was changed to copy interface names autogenerated by libxl to the corresponding network def in the domain's virDomainDef object. The copied name is freed when the domain transitions to the shutoff state. But when migrating a domain, the autogenerated name is included in the XML sent to the destination host. It is possible an interface with the same name already exists on the destination host, causing migration to fail. Indeed the Xen project's OSSTEST CI already encountered such a failure.This patch defines another
VIR_NET_GENERATED_PREFIXfor Xen, allowing the autogenerated names to be excluded when parsing and formatting inactive config.Signed-off-by Jim Fehlig <[email protected]>---
This is an alternative approach to Joao's fix for this regression
https://www.redhat.com/archives/libvir-list/2015-December/msg00197.html
Quoted 8 lines
Quoted 4 lines
I think it is the same approach used by the qemu driver. My only reservation is that it expands the potential for clashes with user-defined names. I.e. with this change both 'vnet' and 'vif' are reserved prefixes.
Hmm, yes, tricky one.
If we only care about XML parsing, then you could register a post parse callback instead to do this.
AFAIK, XML parsing is all that's in play here.
Quoted 6 lines
I'm not clear why we also have it in the virDomainNetDefFormat method - and we can't solve that with a post-parse callback.
The other option would be to make the reserved prefix be a capability that the parser/formatter could read.
This seems like the best option, since a post-parse callback doesn't solve the problem in virDomainNetDefFormat. It also has the upshot of making the prefix visible and known to users. But I doubt such a change is suitable during 1.3.0 freeze. With the freeze in mind, seems the best solution to the libxl migration regression is revert
d2e5538b1. It can be added again post-1.3.0 release, after adding the prefix to capabilities.Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
DV, since you may be making the release soon, feel free to revert
d2e5538b1if you agree.Yeah, just go ahead & revert it Jim, DV isn't doing the releae until tomorrow morning
I've pushed the revert.
Joao, sorry for yanking this for 1.3.0. We can get it in 1.3.1, after exposing the prefix in capabilities.
Hey Jim,
I had the impression we had pushed this back in (i.e. cherry-picking d2e5538) but I was double checking and that's doesn't seem to be case. In adding support for the prefix in capabilities I found out one issue on the migration failure path leading to dereferencing a NULL pointer on the destination. If you agree could we squash the following chunk in addition to the cherry-pick of d2e5538:
src/libxl/libxl_domain.c +1
-1@@ -768,7 +768,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,for (i =0 ; i < vm->def->nnets; i++) {virDomainNetDefPtr net = vm->def->nets[i]; -if (STRPREFIX (net->ifname,"vif" )) +if (net->ifname &&STRPREFIX (net->ifname,"vif" ))VIR_FREE (net->ifname); } }src/libxl/libxl_driver.c +1
-1@@ -5590,7 +5590,7 @@ static virHypervisorDriver libxlHypervisorDriver = { .domainGetJobStats = libxlDomainGetJobStats, /* 1.3.1 */ .domainMemoryStats = libxlDomainMemoryStats, /* 1.3.0 */ .domainGetCPUStats = libxlDomainGetCPUStats, /* 1.3.0 */ - .domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.0 */ + .domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.2 */ .connectDomainEventRegister = libxlConnectDomainEventRegister, /* 0.9.0 */ .connectDomainEventDeregister = libxlConnectDomainEventDeregister, /* 0.9.0 */ .domainManagedSave = libxlDomainManagedSave, /* 0.9.2 */
Quoted 1 line
Or do you think it should be deferred to 1.3.3 ?
I wanted to ask you about this on the recent Xen+libvirt+OpenStack sync. Thanks for checking. It would be a shame if this patch didn't make 1.3.2 since all of your prerequisite work is in, but perhaps a new patch is best given the changes?
Regards,
Jim
Quoted 95 lines · Jim Fehlig
Quoted 94 lines · Joao Martins
Quoted 47 lines · Jim Fehlig
Quoted 46 lines · Daniel P. Berrange
Quoted 45 lines · Jim Fehlig
Quoted 21 lines · Daniel P. Berrange
Quoted 20 lines · Jim Fehlig
In commit
d2e5538b1, the libxl driver was changed to copy interface names autogenerated by libxl to the corresponding network def in the domain's virDomainDef object. The copied name is freed when the domain transitions to the shutoff state. But when migrating a domain, the autogenerated name is included in the XML sent to the destination host. It is possible an interface with the same name already exists on the destination host, causing migration to fail. Indeed the Xen project's OSSTEST CI already encountered such a failure.This patch defines another
VIR_NET_GENERATED_PREFIXfor Xen, allowing the autogenerated names to be excluded when parsing and formatting inactive config.Signed-off-by Jim Fehlig <[email protected]>---
This is an alternative approach to Joao's fix for this regression
https://www.redhat.com/archives/libvir-list/2015-December/msg00197.html
Quoted 8 lines
Quoted 4 lines
I think it is the same approach used by the qemu driver. My only reservation is that it expands the potential for clashes with user-defined names. I.e. with this change both 'vnet' and 'vif' are reserved prefixes.
Hmm, yes, tricky one.
If we only care about XML parsing, then you could register a post parse callback instead to do this.
AFAIK, XML parsing is all that's in play here.
Quoted 6 lines
I'm not clear why we also have it in the virDomainNetDefFormat method - and we can't solve that with a post-parse callback.
The other option would be to make the reserved prefix be a capability that the parser/formatter could read.
This seems like the best option, since a post-parse callback doesn't solve the problem in virDomainNetDefFormat. It also has the upshot of making the prefix visible and known to users. But I doubt such a change is suitable during 1.3.0 freeze. With the freeze in mind, seems the best solution to the libxl migration regression is revert
d2e5538b1. It can be added again post-1.3.0 release, after adding the prefix to capabilities.Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
DV, since you may be making the release soon, feel free to revert
d2e5538b1if you agree.Yeah, just go ahead & revert it Jim, DV isn't doing the releae until tomorrow morning
I've pushed the revert.
Joao, sorry for yanking this for 1.3.0. We can get it in 1.3.1, after exposing the prefix in capabilities.
Hey Jim,
I had the impression we had pushed this back in (i.e. cherry-picking d2e5538) but I was double checking and that's doesn't seem to be case. In adding support for the prefix in capabilities I found out one issue on the migration failure path leading to dereferencing a NULL pointer on the destination. If you agree could we squash the following chunk in addition to the cherry-pick of d2e5538:
src/libxl/libxl_domain.c +1
-1@@ -768,7 +768,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,for (i =0 ; i < vm->def->nnets; i++) {virDomainNetDefPtr net = vm->def->nets[i]; -if (STRPREFIX (net->ifname,"vif" )) +if (net->ifname &&STRPREFIX (net->ifname,"vif" ))VIR_FREE (net->ifname); } }src/libxl/libxl_driver.c +1
-1@@ -5590,7 +5590,7 @@ static virHypervisorDriver libxlHypervisorDriver = { .domainGetJobStats = libxlDomainGetJobStats, /* 1.3.1 */ .domainMemoryStats = libxlDomainMemoryStats, /* 1.3.0 */ .domainGetCPUStats = libxlDomainGetCPUStats, /* 1.3.0 */ - .domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.0 */ + .domainInterfaceStats = libxlDomainInterfaceStats, /* 1.3.2 */ .connectDomainEventRegister = libxlConnectDomainEventRegister, /* 0.9.0 */ .connectDomainEventDeregister = libxlConnectDomainEventDeregister, /* 0.9.0 */ .domainManagedSave = libxlDomainManagedSave, /* 0.9.2 */
Quoted 6 lines
Quoted 1 line
Or do you think it should be deferred to 1.3.3 ?
I wanted to ask you about this on the recent Xen+libvirt+OpenStack sync. Thanks for checking. It would be a shame if this patch didn't make 1.3.2 since all of your prerequisite work is in, but perhaps a new patch is best given the changes?
Yeap, I just sent a new patch with these changes.
Thanks!
Joao
Quoted 5 lines
--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list