]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
phyp: don't steal storage management from other drivers
authorEric Blake <eblake@redhat.com>
Mon, 28 Jun 2010 17:33:05 +0000 (11:33 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 29 Jun 2010 13:24:19 +0000 (07:24 -0600)
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 crashed because it was not initialized.

* src/phyp/phyp_driver.c (phypStorageOpen): Only accept connections
already open to a phyp driver.

src/phyp/phyp_driver.c

index 3692f2c6e94cf13d0335bef625bdb191408e6988..ee1e21b82e0cad18cf34ac204a47424d5789264a 100644 (file)
@@ -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;
 }