mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
qemu: agent: Store CCW address in qemuAgentDiskInfo if provided by the guest
Newer versions of the QEMU guest agent will provide the CCW address of devices on s390x. Store this information in the qemuAgentDiskInfo so that we can use this later. We also map the CSSID 0 from the guest to the value 0xfe on the host, see https://www.qemu.org/docs/master/system/s390x/css.html for details. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
bed50bcbbb
commit
f5c8cf9e0e
@ -1866,6 +1866,7 @@ static qemuAgentDiskAddressPtr
|
||||
qemuAgentGetDiskAddress(virJSONValuePtr json)
|
||||
{
|
||||
virJSONValuePtr pci;
|
||||
virJSONValuePtr ccw;
|
||||
g_autoptr(qemuAgentDiskAddress) addr = NULL;
|
||||
|
||||
addr = g_new0(qemuAgentDiskAddress, 1);
|
||||
@ -1896,6 +1897,15 @@ qemuAgentGetDiskAddress(virJSONValuePtr json)
|
||||
GET_DISK_ADDR(pci, &addr->pci_controller.bus, "bus");
|
||||
GET_DISK_ADDR(pci, &addr->pci_controller.slot, "slot");
|
||||
GET_DISK_ADDR(pci, &addr->pci_controller.function, "function");
|
||||
|
||||
if ((ccw = virJSONValueObjectGet(json, "ccw-address"))) {
|
||||
addr->has_ccw_address = true;
|
||||
GET_DISK_ADDR(ccw, &addr->ccw_addr.cssid, "cssid");
|
||||
if (addr->ccw_addr.cssid == 0) /* Guest CSSID 0 is 0xfe on host */
|
||||
addr->ccw_addr.cssid = 0xfe;
|
||||
GET_DISK_ADDR(ccw, &addr->ccw_addr.ssid, "ssid");
|
||||
GET_DISK_ADDR(ccw, &addr->ccw_addr.devno, "devno");
|
||||
}
|
||||
#undef GET_DISK_ADDR
|
||||
|
||||
return g_steal_pointer(&addr);
|
||||
|
@ -77,6 +77,8 @@ struct _qemuAgentDiskAddress {
|
||||
unsigned int target;
|
||||
unsigned int unit;
|
||||
char *devnode;
|
||||
bool has_ccw_address;
|
||||
virDomainDeviceCCWAddress ccw_addr;
|
||||
};
|
||||
void qemuAgentDiskAddressFree(qemuAgentDiskAddressPtr addr);
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuAgentDiskAddress, qemuAgentDiskAddressFree);
|
||||
|
Loading…
x
Reference in New Issue
Block a user