mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
migration: Teach QEMUFile to be QIOChannel-aware
migration uses QIOChannel typed qemufiles. In follow up patches, we'll need the capability to identify this fact, so that we can get the backing QIOChannel from a QEMUFile. We can also define types for QEMUFile but so far since we only need to be able to identify QIOChannel, introduce a boolean which is simpler. Introduce another helper qemu_file_get_ioc() to return the ioc backend of a qemufile if has_ioc is set. No functional change. Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20210722175841.938739-5-peterx@redhat.com> Reviewed-by: Lukas Straub <lukasstraub2@web.de> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
18711405b5
commit
c6ad5be7ae
5 changed files with 24 additions and 7 deletions
|
@ -187,11 +187,11 @@ static const QEMUFileOps channel_output_ops = {
|
|||
QEMUFile *qemu_fopen_channel_input(QIOChannel *ioc)
|
||||
{
|
||||
object_ref(OBJECT(ioc));
|
||||
return qemu_fopen_ops(ioc, &channel_input_ops);
|
||||
return qemu_fopen_ops(ioc, &channel_input_ops, true);
|
||||
}
|
||||
|
||||
QEMUFile *qemu_fopen_channel_output(QIOChannel *ioc)
|
||||
{
|
||||
object_ref(OBJECT(ioc));
|
||||
return qemu_fopen_ops(ioc, &channel_output_ops);
|
||||
return qemu_fopen_ops(ioc, &channel_output_ops, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue