Skip to contentSkip to conversation

libxl: Recognise ARM architectures

PATCH Daniel P. Berrange 5 participants 11 messages Feb 26, 2014 – Feb 28, 2014 7 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 33 lines · Ian Campbell

Only tested on v7 but the v8 equivalent seems pretty obvious.

XEN_CAP_REGEX already accepts more than it should (e.g. x86_64p or x86_32be) but I have stuck with the existing pattern.

With this I can create a guest from:
<domain type='xen'>

    <name>libvirt-test</name>
    <uuid>6343998e-9eda-11e3-98f6-77252a7d02f3</uuid>
    <memory>393216</memory>
    <currentMemory>393216</currentMemory>
    <vcpu>1</vcpu>
    <os>
      <type arch='armv7l' machine='xenpv'>linux</type>
      <kernel>/boot/vmlinuz-arm-native</kernel>
      <cmdline>console=hvc0 earlyprintk debug root=/dev/xvda1</cmdline>
    </os>
    <clock offset='utc'/>
    <on_poweroff>destroy</on_poweroff>
    <on_reboot>restart</on_reboot>
    <on_crash>destroy</on_crash>
    <devices>
      <disk type='block' device='disk'>
        <source dev='/dev/marilith-n0/debian-disk'/>
        <target dev='xvda1'/>
      </disk>
      <interface type='bridge'>
        <mac address='8e:a7:8e:3c:f4:f6'/>
        <source bridge='xenbr0'/>
      </interface>
    </devices>

</domain>

Quoted 8 lines

Using virsh create and I can destroy it too.

Currently virsh console fails with:
Connected to domain libvirt-test
Escape character is ^]
error: internal error: cannot find character device <null>

I haven't investigated yet.

That'll be because no <console> or <serial> device is listed in your config above I expect. Also looks like bogus error handling in the console API, not checking for <null>.

ACK

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]

#3 lore raw
Quoted 6 lines · Daniel P. Berrange
Quoted 5 lines · Ian Campbell

Currently virsh console fails with:
Connected to domain libvirt-test
Escape character is ^]
error: internal error: cannot find character device <null>

Quoted 6 lines
Quoted 1 line

I haven't investigated yet.

That'll be because no <console> or <serial> device is listed in your config above I expect. Also looks like bogus error handling in the console API, not checking for <null>.

Thanks. I've just tried (inside <devices>...</...>):

         <console tty='/dev/pts/5'/>
and
     <console type='pty'>
      <target port='0'/>
    </console>

which I gleaned from http://libvirt.org/drvxen.html but neither seem to do the trick (and the first ones use of an explicit pts looks odd to me...).

Quoted 1 line

ACK

Thanks.

Ian.

#4 lore raw
In reply to a message not in the archive
Quoted 20 lines · Daniel P. Berrange
Quoted 7 lines · Ian Campbell

Only tested on v7 but the v8 equivalent seems pretty obvious.

XEN_CAP_REGEX already accepts more than it should (e.g. x86_64p or x86_32be) but I have stuck with the existing pattern.

With this I can create a guest from:
<domain type='xen'>

Quoted 10 lines
    <name>libvirt-test</name>
    <uuid>6343998e-9eda-11e3-98f6-77252a7d02f3</uuid>
    <memory>393216</memory>
    <currentMemory>393216</currentMemory>
    <vcpu>1</vcpu>
    <os>
      <type arch='armv7l' machine='xenpv'>linux</type>
      <kernel>/boot/vmlinuz-arm-native</kernel>
      <cmdline>console=hvc0 earlyprintk debug root=/dev/xvda1</cmdline>
    </os>
Quoted 1 line

ACK

I've gone ahead and pushed the patch.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 11 lines · Ian Campbell
Quoted 9 lines · Daniel P. Berrange
Quoted 4 lines · Ian Campbell

Currently virsh console fails with:
Connected to domain libvirt-test
Escape character is ^]
error: internal error: cannot find character device <null>

That'll be because no <console> or <serial> device is listed in your config above I expect. Also looks like bogus error handling in the console API, not checking for <null>.

Thanks. I've just tried (inside <devices>...</...>):

Quoted 8 lines
         <console tty='/dev/pts/5'/>
and
     <console type='pty'>
      <target port='0'/>
    </console>

which I gleaned from http://libvirt.org/drvxen.html but neither seem to do the trick (and the first ones use of an explicit pts looks odd to me...).

I learned yesterday this should be "serial" instead of "console", maybe it fixes also your case.

Olaf

#7 lore raw
Quoted 22 lines · Olaf Hering
Quoted 11 lines · Ian Campbell
Quoted 9 lines · Daniel P. Berrange
Quoted 4 lines · Ian Campbell

Currently virsh console fails with:
Connected to domain libvirt-test
Escape character is ^]
error: internal error: cannot find character device <null>

That'll be because no <console> or <serial> device is listed in your config above I expect. Also looks like bogus error handling in the console API, not checking for <null>.

Thanks. I've just tried (inside <devices>...</...>):

Quoted 8 lines
         <console tty='/dev/pts/5'/>
and
     <console type='pty'>
      <target port='0'/>
    </console>

which I gleaned from http://libvirt.org/drvxen.html but neither seem to do the trick (and the first ones use of an explicit pts looks odd to me...).

Quoted 2 lines

I learned yesterday this should be "serial" instead of "console", maybe it fixes also your case.

My understanding was that this was for HVM guests, whereas ARM has a PV console but I suppose I should try it anyway. I've got a flight to catch so it'll be a few days I expect.

Thanks,

Ian.

#8 lore raw
Quoted 23 lines · Ian Campbell
Quoted 22 lines · Olaf Hering
Quoted 19 lines · Ian Campbell
Quoted 9 lines · Daniel P. Berrange
Quoted 4 lines · Ian Campbell

Currently virsh console fails with:
Connected to domain libvirt-test
Escape character is ^]
error: internal error: cannot find character device <null>

That'll be because no <console> or <serial> device is listed in your config above I expect. Also looks like bogus error handling in the console API, not checking for <null>.

Thanks. I've just tried (inside <devices>...</...>):

         <console tty='/dev/pts/5'/>
and
     <console type='pty'>
      <target port='0'/>
    </console>

which I gleaned from http://libvirt.org/drvxen.html but neither seem to do the trick (and the first ones use of an explicit pts looks odd to me...).

Quoted 6 lines
Quoted 2 lines

I learned yesterday this should be "serial" instead of "console", maybe it fixes also your case.

My understanding was that this was for HVM guests, whereas ARM has a PV console but I suppose I should try it anyway. I've got a flight to catch so it'll be a few days I expect.

Yep, if ARM has a PV console, then we'd need to add tiny bit to the XML to allow us to configure that explicitly, similar to how we do for KVM's virtio-console support.

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]

#10 lore raw
Quoted 3 lines · Daniel P. Berrange

Yep, if ARM has a PV console, then we'd need to add tiny bit to the XML to allow us to configure that explicitly, similar to how we do for KVM's virtio-console support.

Do you mean I need to add something to the XML config snippet, or I need to add some special handling in the XML parser/consumer?

I've grepped around the virtio-console stuff and I'm none the wiser.

Thanks,
Ian.

#11 lore raw
Quoted 9 lines · Ian Campbell
Quoted 3 lines · Daniel P. Berrange

Yep, if ARM has a PV console, then we'd need to add tiny bit to the XML to allow us to configure that explicitly, similar to how we do for KVM's virtio-console support.

Do you mean I need to add something to the XML config snippet, or I need to add some special handling in the XML parser/consumer?

I've grepped around the virtio-console stuff and I'm none the wiser.

Opps, yes, I should have explained this better, since our docs here are about as clear as mud.

With traditional x86 paravirt Xen, we just have the plain paravirt console devices

    <console type='pty'>
      <target type='xen'/>
    </console>

With x86 fullvirt Xen/KVM/QEMU, the console type just defaults to being a serial port so you would usually just add

    <serial type='pty'>
    </serial>

and then libvirt would automatically add a <console> with

    <console type='pty'>
      <target type='serial'/>
    </console>

With x86 fullvirt KVM, we also have support for virtio which is done using

    <console type='pty'>
      <target type='virtio'/>
    </console>

So actually this leads me to ask what kind of console Arm fullvirt Xen guests actually have ? If they just use the traditional Xen paravirt console, then we just need to make sure that this works for them by default:

    <console type='pty'>
      <target type='xen'/>
    </console>

If there's a different type of console device that's not related to the Xen paravirt console device, then we'd need to invent a new <target type='xxx'/> value for Arm.

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]

#13 lore raw
Quoted 47 lines · Daniel P. Berrange
Quoted 9 lines · Ian Campbell
Quoted 3 lines · Daniel P. Berrange

Yep, if ARM has a PV console, then we'd need to add tiny bit to the XML to allow us to configure that explicitly, similar to how we do for KVM's virtio-console support.

Do you mean I need to add something to the XML config snippet, or I need to add some special handling in the XML parser/consumer?

I've grepped around the virtio-console stuff and I'm none the wiser.

Opps, yes, I should have explained this better, since our docs here are about as clear as mud.

With traditional x86 paravirt Xen, we just have the plain paravirt console devices

    <console type='pty'>
      <target type='xen'/>
    </console>

With x86 fullvirt Xen/KVM/QEMU, the console type just defaults to being a serial port so you would usually just add

    <serial type='pty'>
    </serial>

and then libvirt would automatically add a <console> with

    <console type='pty'>
      <target type='serial'/>
    </console>

With x86 fullvirt KVM, we also have support for virtio which is done using

    <console type='pty'>
      <target type='virtio'/>
    </console>

So actually this leads me to ask what kind of console Arm fullvirt Xen guests actually have ? If they just use the traditional Xen paravirt console, then we just need to make sure that this works for them by default:

Quoted 8 lines
    <console type='pty'>
      <target type='xen'/>
    </console>

If there's a different type of console device that's not related to the Xen paravirt console device, then we'd need to invent a new <target type='xxx'/> value for Arm.

It is just the traditional Xen paravirt console.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#15 lore raw
Quoted 11 lines · Stefano Stabellini
Quoted 10 lines · Daniel P. Berrange

So actually this leads me to ask what kind of console Arm fullvirt Xen guests actually have ? If they just use the traditional Xen paravirt console, then we just need to make sure that this works for them by default:

    <console type='pty'>
      <target type='xen'/>
    </console>
Quoted 5 lines
Quoted 3 lines

If there's a different type of console device that's not related to the Xen paravirt console device, then we'd need to invent a new <target type='xxx'/> value for Arm.

It is just the traditional Xen paravirt console.

I tried the above,which AIUI should work, but it fails with the same "cannot find character device <null>" error. I'll investigate properly next week.

Ian.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#17 lore raw
Quoted 21 lines · Eric Blake
Quoted 20 lines · Daniel P. Berrange
Quoted 17 lines · Ian Campbell

Only tested on v7 but the v8 equivalent seems pretty obvious.

XEN_CAP_REGEX already accepts more than it should (e.g. x86_64p or x86_32be) but I have stuck with the existing pattern.

With this I can create a guest from:
<domain type='xen'>

    <name>libvirt-test</name>
    <uuid>6343998e-9eda-11e3-98f6-77252a7d02f3</uuid>
    <memory>393216</memory>
    <currentMemory>393216</currentMemory>
    <vcpu>1</vcpu>
    <os>
      <type arch='armv7l' machine='xenpv'>linux</type>
      <kernel>/boot/vmlinuz-arm-native</kernel>
      <cmdline>console=hvc0 earlyprintk debug root=/dev/xvda1</cmdline>
    </os>
Quoted 3 lines
Quoted 1 line

ACK

I've gone ahead and pushed the patch.

Wow, that was quick, thanks!

Ian.