All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <mapfelba@redhat.com>
To: Thomas Parrott <thomas.parrott@canonical.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>,
	Julia Suvorova <jusual@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: Adding pcie-root-port devices via QMP apparently isn't possible
Date: Tue, 18 May 2021 17:39:31 +0300	[thread overview]
Message-ID: <CA+aaKfB6BEbPnoRj07EfG_Yjpo5gvMLAiP-7=XLNAz0HL6RQDw@mail.gmail.com> (raw)
In-Reply-To: <CADNu6esr-fzfP8pug+Rfv+yJrEjDJaGy3EO+O-oLb_nMm7qLDg@mail.gmail.com>

Hi Thomas,


On Tue, May 18, 2021 at 3:29 PM Thomas Parrott
<thomas.parrott@canonical.com> wrote:
>
> Due to QEMU moving towards a QMP configuration mechanism and away from config file support, the LXD team are currently in the process of migrating to using QMP to add devices to VMs (so that we can support the use of QEMU 6.0).
>
> Currently we are using the `-S` flag to freeze CPU at startup, then using QMP to add NIC devices via the `device_add` command, and then using the `cont` command to start the VM guest.
>
> However we have found that it is apparently not possible to add a pcie-root-port device via QMP.
>
> Initially we tried using something like:
>
> device_add {"id":"qemu_pcie5","driver":"pcie-root-port","bus":"pcie.0","addr":"1.5","chassis":5,"multifunction":"on"}
>
> Which was a straight conversion from the current config file we use.
>
> However this gave the error:
>
> Error: Bus 'pcie.0' does not support hotplugging
>
> Then I found the `--preconfig` flag which sounded interesting, so we removed the use of `-daemonize` which prevents the use of --preconfig` and then tried adding the pcie-root-port devices in the preconfig stage.
>
> But this resulted in the error:
>
> The command 'device_add' isn't permitted in 'preconfig' state
>
> So we wondered is this a bug, or if not, what is the correct way to be adding pcie-root-ports going forward?

The pcie-root-ports cannot be hot-plugged, you will need to
pre-allocate enough pcie-root-ports for your needs.
PCI(e) devices can be hot-plugged into the pre-allocated pcie-root-ports.

Thanks,
Marcel

>
> Thanks
> Tom Parrott
>
>



  parent reply	other threads:[~2021-05-18 14:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 12:28 Adding pcie-root-port devices via QMP apparently isn't possible Thomas Parrott
2021-05-18 12:29 ` Thomas Parrott
2021-05-18 14:39 ` Marcel Apfelbaum [this message]
2021-05-18 14:43   ` Thomas Parrott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+aaKfB6BEbPnoRj07EfG_Yjpo5gvMLAiP-7=XLNAz0HL6RQDw@mail.gmail.com' \
    --to=mapfelba@redhat.com \
    --cc=jusual@redhat.com \
    --cc=marcel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thomas.parrott@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.