move mount permission denied

2021-03-31 Thread Jiatong Shen
Hello community!

  I am faced with a mysterious [error](
https://gist.github.com/jshen28/5f29eed51e0a1308684214b35f009478) which
says move mount is not permissioned.

We are using libvirt with openstack-helm which running libvirt in a docker
based k8s environment. /dev/termination-log is a device created and
attached by k8s and mount looks like `/dev/mapper/ubuntu--vg-root on
/var/log/termination-log type ext4
(rw,relatime,errors=remount-ro,data=ordered)`

Any idea why this happens? appreciate the help!

-- 

Best Regards,

Jiatong Shen


Re: Virtual Network API for QEMU

2021-03-31 Thread Radek Simko
Thank you Laine and thanks Michal for the detailed explanation.

To add some (missing) context from my side:

I was attempting to virtualize Raspberry Pi on qemu via libvirt, where my
host machine is macOS (both qemu and libvirt installed via Homebrew) and I
while trying to set up the network I stumbled upon this:

$ virsh -c qemu:///system?socket=/usr/local/var/run/libvirt/libvirt-sock
net-list --all
error: Failed to get the number of active networks
error: this function is not supported by the connection driver:
virConnectNumOfNetworks

This error in combination with the compatibility matrix made me think it's
just not supported.
What is the right way of interpreting this error/state? Does the host OS
play a role in the compatibility?

Are there any known limitations on macOS, or is this likely just a
broken/misconfigured installation on my side?

Radek Simko


On Mon, Mar 29, 2021 at 10:29 AM Michal Privoznik 
wrote:

> On 3/27/21 1:39 PM, Radek Simko wrote:
> > Hi,
> > According to this support matrix
> > https://libvirt.org/hvsupport.html#virNetworkDriver
> > 
> > there is no support for any APIs other than hypervisor ones for qemu.
> > For example virConnectNumOfNetworks is not supported.
> >
> > Is there any particular reason this is not supported? Has any
> > development in that area been attempted in the past? Would contributions
> > adding support be welcomed?
>
> To extend Laine's reply:
>
> Libvirt has two set of drivers: statefull (where libvirt keeps the state
> of resources like domains, networks, ...) and stateless (where libvirt
> merely translates from/to APIs exposed by hypervisor).
>
> QEMU can be an example of a statefull driver, ESX or hyperv are examples
> of stateless drivers. Stateless drivers also implement network APIs
> (again, by translating from/to APIs exposed by the underlying hypervisor
> - ESX or hypverv in this example), whereas statefull drivers use bridge
> driver. Therefore, QEMU doesn't implement any network APIs.
>
>
> This is even more visible with split daemons (where monolithic libvirtd
> is broken into smaller daemons) - if virnetworkd is not running then
> things like 'virsh net-list' return an error [*].
>
>
> Is there any particular problem you're facing?
>
> Michal
>
>
> * - except not really, because these split daemons are socket activated,
> so virnetworkd is stared automatically when needed.
>
>


Re: Regarding location of Libvirt library

2021-03-31 Thread Andrea Bolognani
On Wed, 2021-03-31 at 17:01 +0200, Michal Privoznik wrote:
> On 3/31/21 7:38 AM, shafnamol N wrote:
> > Hi,
> > I have installed Libvirt 7.1.0.
> > I configured and built libvirt based on instructions from
> > https://libvirt.org/compiling.html ;;.
> > Now I developed a client program to create a VM using an XML file.As the 
> > API for it is *virDomainCreateXML,* called this API by passing XML file 
> > .It shows the following error.
> > undefined reference to `virDomainCreateXML'.
> > I included the header files containing the said API declaration.But need 
> > to include the library also.
> > My question is where do the libvirt library located after building it.
> 
> Yes, you need to pass -lvirt when linking. The library is installed 
> wherever you told it to install. If you ran plain meson with no extra 
> arguments, then 'meson install' installs library under /usr/local/lib/ 
> or /usr/local/lib64/. So you will need to pass -L/usr/local/lib or 
> -L/usr/local/lib64 too to the linker.
> 
> But there is this switch -Dsystem=true which tells meson to install into 
> system directories:
> 
>meson -Dsystem=true build
>meson install -C build
> 
> with this you will not need to pass any extra -L arguments to the linker.

Note that the recommended way to obtain this information is via
pkg-config, using something like

  $ pkg-config --cflags --libs libvirt

If you get an error about libvirt not being found, you probably need
to run

  $ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

or something along those lines beforehand.

-- 
Andrea Bolognani / Red Hat / Virtualization



Re: Regarding location of Libvirt library

2021-03-31 Thread Michal Privoznik

On 3/31/21 7:38 AM, shafnamol N wrote:

Hi,
I have installed Libvirt 7.1.0.
I configured and built libvirt based on instructions from
https://libvirt.org/compiling.html .
Now I developed a client program to create a VM using an XML file.As the 
API for it is *virDomainCreateXML,* called this API by passing XML file 
.It shows the following error.

undefined reference to `virDomainCreateXML'.
I included the header files containing the said API declaration.But need 
to include the library also.

My question is where do the libvirt library located after building it.


Yes, you need to pass -lvirt when linking. The library is installed 
wherever you told it to install. If you ran plain meson with no extra 
arguments, then 'meson install' installs library under /usr/local/lib/ 
or /usr/local/lib64/. So you will need to pass -L/usr/local/lib or 
-L/usr/local/lib64 too to the linker.


But there is this switch -Dsystem=true which tells meson to install into 
system directories:


  meson -Dsystem=true build
  meson install -C build

with this you will not need to pass any extra -L arguments to the linker.

Michal