Skip to contentSkip to conversation

Libvirt xl to xml converter only picks up first occurrence of an option

DISCUSSION Wei Liu 2 participants 3 messages Oct 20, 2017 – Oct 26, 2017 1 message not in the archive

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

Hi Jim

I discovered that libvirt's native config file to xml converter for libxl only pick up the first occurrence of an option.

For example in a xl cfg file:

extra = "abc"
...
extra = "def"

xl will pick up "def" because that shows up later and takes precedence, while the converter picks up "abc".

I think this is a bug in the converter and should be fixed.

Thanks
Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#1 lore raw
Quoted 1 line · Wei Liu

Hi Jim

Hi Wei,

Sorry for the delay. Catching up on mail after some days off...

Quoted 5 lines

I discovered that libvirt's native config file to xml converter for libxl only pick up the first occurrence of an option.

For example in a xl cfg file:

Quoted 8 lines

extra = "abc"
...
extra = "def"

xl will pick up "def" because that shows up later and takes precedence, while the converter picks up "abc".

I think this is a bug in the converter and should be fixed.

Thanks for the report. I took a quick peek at libvirt's generic config parser and afaict it only searches for the first occurrence of a setting. The parser does support flags though, so we could add something like VIR_CONF_FLAG_{FIRST,LAST}_DUPLICATE. (Better name suggestions welcomed.)

I've opened a bug report against openSUSE Factory to track this

https://bugzilla.opensuse.org/show_bug.cgi?id=1065118

Regards,
Jim

Quoted 4 lines

Thanks
Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#3 lore raw
In reply to a message not in the archive
Quoted 19 lines · Jim Fehlig
Quoted 1 line · Wei Liu

Hi Jim

Hi Wei,

Sorry for the delay. Catching up on mail after some days off...

Quoted 12 lines

I discovered that libvirt's native config file to xml converter for libxl only pick up the first occurrence of an option.

For example in a xl cfg file:

extra = "abc"
...
extra = "def"

xl will pick up "def" because that shows up later and takes precedence, while the converter picks up "abc".

Quoted 7 lines
Quoted 1 line

I think this is a bug in the converter and should be fixed.

Thanks for the report. I took a quick peek at libvirt's generic config parser and afaict it only searches for the first occurrence of a setting. The parser does support flags though, so we could add something like VIR_CONF_FLAG_{FIRST,LAST}_DUPLICATE. (Better name suggestions welcomed.)

I'm normally very bad at naming things so I will refrain from making suggestions.

Quoted 4 lines

I've opened a bug report against openSUSE Factory to track this

https://bugzilla.opensuse.org/show_bug.cgi?id=1065118

Thanks!

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel