weixin_39570530
weixin_39570530
2021-01-06 17:34

BUG: Spaces in network names cause validation errors when editing with virsh edit

Hey guys,

If you create a network with a space in its name inside Kimchi and set that network as the source network in your VMs if you edit the VM using libvirt's virsh edit command it will fail to validate against their schema.

I propose we make it so that spaces are not allowed in network names as the only other option is to try and get libvirt to change their validation schema.

Thanks,

Alan

该提问来源于开源项目:kimchi-project/kimchi

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39713219 weixin_39713219 4月前

    Just wanna make sure how to reproduce:

    1) Create a network with space, e.g. "test test" 2) Create a vm with this network 3) Edit the vm and i will see the error

    Can you confirm

    点赞 评论 复制链接分享
  • weixin_39570530 weixin_39570530 4月前

    Yes that is correct. On 6 Feb 2015 12:49, "Ramon Medeiros" notifications.com wrote:

    Just wanna make sure how to reproduce:

    1) Create a network with space, e.g. "test test" 2) Create a vm with this network 3) Edit the vm and i will see the error

    Can you confirm

    — Reply to this email directly or view it on GitHub https://github.com/kimchi-project/kimchi/issues/582#issuecomment-73231675 .

    点赞 评论 复制链接分享
  • weixin_39597987 weixin_39597987 4月前

    Doesn't it work if you enclose the network name in quotation marks?

    Anyway, I think this is a virsh limitation. Not sure if it would be desirable to limit this in Kimchi if it is supported in libvirt. Other virtualization management tools might support this as well.

    点赞 评论 复制链接分享
  • weixin_39570530 weixin_39570530 4月前

    The XML always has quotation marks around the values, and yes the network does work but the validation schema just doesn't like the space in the name.

    Maybe we should report this as a bug in their XML schema then rather than validating against it in Kimchi. On 8 Feb 2015 20:16, "Leonardo Garcia" notifications.com wrote:

    Doesn't it work if you enclose the network name in quotation marks?

    Anyway, I think this is a virsh limitation. Not sure if it would be desirable to limit this in Kimchi if it is supported in libvirt. Other virtualization management tools might support this as well.

    — Reply to this email directly or view it on GitHub https://github.com/kimchi-project/kimchi/issues/582#issuecomment-73429248 .

    点赞 评论 复制链接分享
  • weixin_39959192 weixin_39959192 4月前

    I cannot reproduce this issue on Fedora 21. I created a network named "foo bar" using the Kimchi UI, then I assigned it to a VM and the VM started successfully. I'm also able to edit the network XML using virsh (e.g. I edited its MAC address) and it also worked fine.

    Here's libvirt's XML:

    
    [vianac kimchi]$ sudo virsh net-dumpxml 'foo bar'
    <network>
      <name>foo bar</name>
      <uuid>6c652e44-92ec-43d7-8253-a479b7ff485d</uuid>
      <bridge name="virbr1" stp="on" delay="0"></bridge>
      <mac address="52:54:00:f0:22:6c"></mac>
      <ip address="192.168.1.1" netmask="255.255.255.0">
        <dhcp>
          <range start="192.168.1.129" end="192.168.1.255"></range>
        </dhcp>
      </ip>
    </network>
    

    And here's Kimchi output for GET "/networks/foo bar":

    
    {
      "subnet":"192.168.1.0/24",
      "connection":"isolated",
      "state":"active",
      "name":"foo bar",
      "autostart":true,
      "in_use":true,
      "interface":"virbr1",
      "dhcp":{
        "start":"192.168.1.129",
        "end":"192.168.1.255"
      },
      "vms":[
        "fedora20.1424265899369-vm-1"
      ],
      "persistent":true
    }
    

    What OS are you using? And are there any extra steps needed so I can try to reproduce this issue again?

    点赞 评论 复制链接分享
  • weixin_39570530 weixin_39570530 4月前

    The network name I used was public network.

    I am using Arch Linux. On 18 Feb 2015 13:39, "Crístian Deives" notifications.com wrote:

    I cannot reproduce this issue on Fedora 21. I created a network named "foo bar" using the Kimchi UI, then I assigned it to a VM and the VM started successfully. I'm also able to edit the network XML using virsh (e.g. I edited its MAC address) and it also worked fine.

    Here's libvirt's XML:

    [vianac kimchi]$ sudo virsh net-dumpxml 'foo bar' foo bar 6c652e44-92ec-43d7-8253-a479b7ff485d

    And here's Kimchi output for GET "/networks/foo bar":

    { "subnet":"192.168.1.0/24", "connection":"isolated", "state":"active", "name":"foo bar", "autostart":true, "in_use":true, "interface":"virbr1", "dhcp":{ "start":"192.168.1.129", "end":"192.168.1.255" }, "vms":[ "fedora20.1424265899369-vm-1" ], "persistent":true }

    What OS are you using? And are there any extra steps needed so I can try to reproduce this issue again?

    — Reply to this email directly or view it on GitHub https://github.com/kimchi-project/kimchi/issues/582#issuecomment-74864673 .

    点赞 评论 复制链接分享
  • weixin_39552304 weixin_39552304 4月前

    Probably this issue is restritect to Arch Linux. Could you provide infomation regarding the libvirt version you are using?

    点赞 评论 复制链接分享

相关推荐