Hi Michal,
There is an issue with keys generated in the function adding null to the
end of each key, I have created an issue with a patch from Eric at LimeTech.
https://gitlab.com/libvirt/libvirt-php/-/issues/7
my testing.
$tmp = libvirt_connect_get_machine_types($lv->get_connection());
$key = "ppc\0" ;
var_dump(bin2hex(($key)) );
var_dump( $tmp[$key]) ;
Regards
Simon
On Mon, Dec 5, 2022 at 10:44 AM Simon Fairweather <
simon.n.fairweather(a)gmail.com> wrote:
Thanks for your reply Michal, looks like it is a php array
processing
issue which I am looking into.
On Mon, Dec 5, 2022 at 9:51 AM Michal Prívozník <mprivozn(a)redhat.com>
wrote:
> On 12/4/22 18:18, Simon Fairweather wrote:
> > Using the following
> >
> > php: version 8.1.13
> > php-libvirt: version 0.5.6 (build 2)
> >
> > libvirt 8.7.0
> > QEMU 7.1.0
> >
> > virsh capabilities works fine.
> >
>
>
> >
> > Any known issues with php 8 for this function, others seem to be working
> > fine.
>
> Hey, I haven't tried php-8 yet. What is the problem you're seeing?
> Looking into the source code, the only thing that
> libvirt_connect_get_machine_types() does is it fetches capabilities
> (libvirt_connect_get_capabilities()) and then runs couple of XPATHs to
> construct an associative array of supported machine types. The same can
> be achieved in plain PHP.
>
> Michal
>
>