[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCHv2] phyp: don't steal storage management from other drivers



On Mon, Jun 28, 2010 at 02:21:46PM -0600, Eric Blake wrote:
> Fix regression introduced in commit a4a287242 - basically, the
> phyp storage driver should only accept the same URIs that the
> main phyp driver is willing to accept.  Blindly accepting all
> URIs meant that the phyp storage driver was being consulted for
> 'virsh -c qemu:///session pool-list --all', rather than the
> qemu storage driver, then since the URI was not for phyp, attempts
> to then use the phyp driver crahsed because it was not initialized.
> 
> * src/phyp/phyp_driver.c (phypStorageOpen): Only accept connections
> already open to a phyp driver.
> ---
> 
> diff from v1 - assume that for the secondary storage driver, the
> master driver has already been initialized and we don't have to
> reparse the URI.
> 
> Definitely much shorter, once I realized I should be copying from
> esx_storage_driver.c as a prior example.
> 
>  src/phyp/phyp_driver.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
> index 3692f2c..ee1e21b 100644
> --- a/src/phyp/phyp_driver.c
> +++ b/src/phyp/phyp_driver.c
> @@ -3875,12 +3875,15 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus)
>  }
> 
>  static virDrvOpenStatus
> -phypStorageOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
> +phypStorageOpen(virConnectPtr conn,
>                  virConnectAuthPtr auth ATTRIBUTE_UNUSED,
>                  int flags)
>  {
>      virCheckFlags(0, VIR_DRV_OPEN_ERROR);
> 
> +    if (conn->driver->no != VIR_DRV_PHYP)
> +        return VIR_DRV_OPEN_DECLINED;
> +
>      return VIR_DRV_OPEN_SUCCESS;
>  }

ACK


Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]