[libvirt] [PATCH 4/9] virDomainRedirdevDef: Introduce find & remove routines

Peter Krempa pkrempa at redhat.com
Fri Jun 10 08:42:06 UTC 2016


On Fri, Jun 10, 2016 at 10:30:29 +0200, Michal Privoznik wrote:
> On 10.06.2016 10:06, Peter Krempa wrote:
> > On Thu, Jun 09, 2016 at 17:02:39 +0200, Michal Privoznik wrote:
> >> Basically, there are just two functions introduced here:
> >> virDomainRedirdevDefFind which looks up given redirdev in domain
> >> definition, and virDomainRedirdevDefRemove which removes the
> >> device at given index in the array of devices.
> >>
> >> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> >> ---
> >>  src/conf/domain_conf.c   | 44 ++++++++++++++++++++++++++++++++++++++++++++
> >>  src/conf/domain_conf.h   |  4 ++++
> >>  src/libvirt_private.syms |  2 ++
> >>  3 files changed, 50 insertions(+)

[...]

> > I don't think we currently match the alias across our device finding
> > functions. The reason for that is that you won't be able to unplug the
> > device with --live --config specified for virsh or the corresponding
> > flag values as the inactive device doesn't have an alias.
> 
> The problem here is that in some cases alias is the only way of
> differentiating two redirdevs:
> 
>     <redirdev bus='usb' type='spicevmc'>
>       <alias name='redir0'/>
>     </redirdev>
>     <redirdev bus='usb' type='spicevmc'>
>       <alias name='redir1'/>
>     </redirdev>
> 
> There is no address, nothing. So what do you suggest to do in this case?
> I came up with comparing aliases.

If there's no difference between them, then just pick one at random. Or
use similar logic as in virDomainMemoryFindByDefInternal where we match
the address only if it was provided by the user. Otherwise we pick one
at random from those matching the rest of the data.




More information about the libvir-list mailing list