Re: /dev/hwrng no such device

2020-02-05 Thread Christopher Snowhill (kode54)


> On Feb 5, 2020, at 2:02 PM, Wesley Chow  wrote:
> 
> 
> I'm building a kernel suitable to boot Raspbian and a custom buildroot based 
> ARM OS via qemu-system-arm. Everything appears to work except for the 
> hardware rng device. I'm using a virt machine with:
> 
>   -object rng-random,filename=/dev/urandom,id=rng0 -device 
> virtio-rng-pci,rng=rng0
> 
> In both Raspbian and my own system, I see this:
> 
> # cat /dev/hwrng
> cat: read error: No such device
> 
> rng-tools can not read the device and doesn't start up properly, leaving my 
> entropy pool woefully low. The kernel I'm using is based off the rpi-4.19.y 
> branch (4.19.97) with additional config options set. Of relevance:
> 
> CONFIG_PCI=y
> CONFIG_VIRTIO=y
> CONFIG_VIRTIO_PCI=y
> CONFIG_VIRTIO_BLK=y
> CONFIG_HW_RANDOM_VIRTIO=y
> CONFIG_CRYPTO_DEV_VIRTIO=y
> CONFIG_CRYPTO_HW=y
> CONFIG_CRYPTO_RNG2=y
> CONFIG_HW_RANDOM=y
> 
> I honestly don't know which of these actually matter. I'm wondering, am I 
> missing something?
> 
> Thanks,
> Wes

This is simply because not a single Raspberry Pi device has ever supported 
hardware crypto extensions. These are, simply put, tinkerer’s toys, not real 
computing devices.

Maybe have a look at the Rock Pi 4, which does support crypto extensions.


Re: query-block command is missing device name. Deprecated?

2020-02-05 Thread Mike Lee
Max,

Thanks for the thorough explanation.  I finaly found some QEMU pdf docs
out there describing that -blockdev was the way of the furture.

I'll try providing a job-id for the backups.  Again thanks for the
reply/feedback.  It's great to see how fast this stuff is progressing,
even if it causes some usage gotchas from time to time.  Have a good
one!

Mike

On Tue, 2020-02-04 at 12:29 +0100, Max Reitz wrote:
> On 31.01.20 05:06, Mike Lee wrote:
> > Hello All,
> 
> Hi Mike,
> 
> Most of the changes you’re seeing are probably due to libvirt using
> node
> names to create block devices now.  So every node in the block graph
> (e.g. a file node to read a file from the normal filesystem, or a
> qcow2
> node to interpret the qcow2 format) is now created explicitly by
> libvirt, and every such node needs a node name.
> 
> Before this (very recent) change, libvirt used -drive (I think),
> which
> either creates a guest device along with an attached full block node
> tree, or just the tree without the device – but that tree still gets
> a
> name as whole, and that was the name shown by query-block.  (The
> guest
> device name is shown under @qdev.)
> 
> With libvirt now using -blockdev instead of -drive and thus creating
> single block nodes, there is no such tree name anymore.  That’s why
> it’s
> shown as empty.
> 
> > IN CLOSING:
> > 1.) I suspect the error I get when starting the backup is simply a
> > bug.
> > Am I correct in assuming this, since the backup actually
> > starts?  If
> > I'm wrong what do I need to change to not get the error?
> 
> This is also related to the libvirt change described above.  You used
> to
> have to specify the tree name (generally called “device name” in
> QAPI),
> but now there is no such name.  As such, you have to specify the node
> name now.  You did that, but you also need to specify a job-id then.
> 
> The documentation isn’t really clear about this, but job-id will only
> default to the device name, not to what @device says.  There is no
> device name (or “tree name”, as I’ve called it above), so it cannot
> default to anything.  Hence the error message, that an empty job ID
> is
> not permissible.
> 
> So long story short, you need to specify something for @job-id.  (And
> then all further job commands/events will use that for their
> respective
> @device field.  That will be a bit confusing, but, well, we had to
> for
> compatibility.)
> 
> > 2.) Has the "device" attribute in the "query-block" command been
> > deprecated and is that why that attribute's value is now
> > blank?  I've
> > gone back through all of the QEMU release notes and see no mention
> > of
> > this.  
> 
> It hasn’t, but when using -blockdev instead of -drive for block
> devices,
> it will be empty.  (And libvirt does use -blockdev now.)
> 
> > 3.) What's with the "libvirt-X-format" node name?  The "drive-
> > virtio-
> > diskX" seemed more logical.  Is this naming change a libvirt thing
> > and
> > not qemu?
> 
> That has the same reason, libvirt now uses -blockdev, so it specifies
> node names.  “libvirt-X-format” looks like a typical node name
> (“format”
> is a type of node that interprets image formats, like qcow2 or raw),
> whereas “drive-virtio-diskX” seems like a name for a whole tree of
> block
> nodes (i.e., a device name).
> 
> Max
> 




specify password-secret during drive mirror

2020-02-05 Thread Jiatong Shen
Hello,

I am trying to hot swap drive from a file to a rbd based image. I try the
following command

*virs# qemu-monitor-command 1476 '{"execute": "drive-mirror","arguments":
{"device": "drive-virtio-disk1","job-id": "job0","target":
"rbd:vms/06abc940-f8de-4184-a37c-2fac9506a2c6_disk.config:id=nova:auth_supported=cephx\\;none:mon_host=172.16.2.61\\:6789;172.16.2.62\\:6789;172.16.2.63\\:6789",
"sync": "full", "mode": "existing", "format": "raw"}}'*

and then

*virsh # qemu-monitor-command 1476 '{"execute": "block-job-complete",
"arguments": {"device": "job0" }}'*

it seems working because query-block returns a new backend drive.

But how can I pass in a password-secret? looks like the above command work
because there is  already one secret.
-- 

Best Regards,

Jiatong Shen


/dev/hwrng no such device

2020-02-05 Thread Wesley Chow
I'm building a kernel suitable to boot Raspbian and a custom buildroot
based ARM OS via qemu-system-arm. Everything appears to work except for the
hardware rng device. I'm using a virt machine with:

  -object rng-random,filename=/dev/urandom,id=rng0 -device
virtio-rng-pci,rng=rng0

In both Raspbian and my own system, I see this:

# cat /dev/hwrng
cat: read error: No such device

rng-tools can not read the device and doesn't start up properly, leaving my
entropy pool woefully low. The kernel I'm using is based off the rpi-4.19.y
branch (4.19.97) with additional config options set. Of relevance:

CONFIG_PCI=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BLK=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_CRYPTO_DEV_VIRTIO=y
CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_RNG2=y
CONFIG_HW_RANDOM=y

I honestly don't know which of these actually matter. I'm wondering, am I
missing something?

Thanks,
Wes