]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
storage: Skip inactive lv volumes
authorOsier Yang <jyang@redhat.com>
Tue, 7 May 2013 10:29:29 +0000 (18:29 +0800)
committerOsier Yang <jyang@redhat.com>
Wed, 8 May 2013 04:12:14 +0000 (12:12 +0800)
commit59750ed6ea12c4db5ba042fef1a39b963cbfb559
treeebbba83f13ac6bc50efd2430772f7697bcc6279e
parent6b74a9f5d98e066f8dfdf5d5ccda68230b516246
storage: Skip inactive lv volumes

If the volume is of a clustered volume group, and not active, the
related pool APIs fails on opening /dev/vg/lv. If the volume is
suspended, it hangs on open(2) the volume.

Though the best solution is to expose the volume status in volume
XML, and even better to provide API to activate/deactivate the volume,
but it's not the work I want to touch currently. Volume status in
other status is just fine to skip.

About the 5th field of lv_attr (from man lvs[8])
<quote>
 5 State: (a)ctive, (s)uspended, (I)nvalid snapshot, invalid
   (S)uspended snapshot, snapshot (m)erge failed,suspended
   snapshot (M)erge failed, mapped (d)evice present without
   tables,  mapped device present with (i)nactive table
</quote>
src/storage/storage_backend_logical.c