mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-06 20:00:05 +00:00
nodedev: refactor CCW state format for use in ccwgroup
Refactor to allow reuse in ccwgroup. Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
1260f3bd4f
commit
20560cb6c4
@ -659,6 +659,18 @@ virNodeDeviceCapCSSDefFormat(virBuffer *buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
virNodeDeviceCapCCWStateTypeFormat(virBuffer *buf,
|
||||||
|
const virNodeDevCCWStateType state_type)
|
||||||
|
{
|
||||||
|
if (state_type != VIR_NODE_DEV_CCW_STATE_LAST) {
|
||||||
|
const char *state = virNodeDevCCWStateTypeToString(state_type);
|
||||||
|
|
||||||
|
virBufferEscapeString(buf, "<state>%s</state>\n", state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
virNodeDeviceDefFormat(const virNodeDeviceDef *def, unsigned int flags)
|
virNodeDeviceDefFormat(const virNodeDeviceDef *def, unsigned int flags)
|
||||||
{
|
{
|
||||||
@ -746,10 +758,7 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def, unsigned int flags)
|
|||||||
virNodeDeviceCapMdevDefFormat(&buf, data, inactive_state);
|
virNodeDeviceCapMdevDefFormat(&buf, data, inactive_state);
|
||||||
break;
|
break;
|
||||||
case VIR_NODE_DEV_CAP_CCW_DEV:
|
case VIR_NODE_DEV_CAP_CCW_DEV:
|
||||||
if (data->ccw_dev.state != VIR_NODE_DEV_CCW_STATE_LAST) {
|
virNodeDeviceCapCCWStateTypeFormat(&buf, data->ccw_dev.state);
|
||||||
const char *state = virNodeDevCCWStateTypeToString(data->ccw_dev.state);
|
|
||||||
virBufferEscapeString(&buf, "<state>%s</state>\n", state);
|
|
||||||
}
|
|
||||||
virCCWDeviceAddressFormat(&buf, data->ccw_dev.dev_addr);
|
virCCWDeviceAddressFormat(&buf, data->ccw_dev.dev_addr);
|
||||||
break;
|
break;
|
||||||
case VIR_NODE_DEV_CAP_CSS_DEV:
|
case VIR_NODE_DEV_CAP_CSS_DEV:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user