From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, hreitz@redhat.com, qemu-block@nongnu.org,
qemu-trivial@nongnu.org
Subject: Re: [PATCH] blockdev: Fix blockdev-snapshot-sync error reporting for no medium
Date: Mon, 18 Mar 2024 12:47:04 +0100 [thread overview]
Message-ID: <ZfgpuMp7K-mGpZ_B@redhat.com> (raw)
In-Reply-To: <20240306142831.2514431-1-armbru@redhat.com>
Am 06.03.2024 um 15:28 hat Markus Armbruster geschrieben:
> When external_snapshot_abort() rejects a BlockDriverState without a
> medium, it creates an error like this:
>
> error_setg(errp, "Device '%s' has no medium", device);
>
> Trouble is @device can be null. My system formats null as "(null)",
> but other systems might crash. Reproducer:
>
> 1. Create a block device without a medium
>
> -> {"execute": "blockdev-add", "arguments": {"driver": "host_cdrom", "node-name": "blk0", "filename": "/dev/sr0"}}
> <- {"return": {}}
>
> 3. Attempt to snapshot it
>
> -> {"execute":"blockdev-snapshot-sync", "arguments": { "node-name": "blk0", "snapshot-file":"/tmp/foo.qcow2","format":"qcow2"}}
> <- {"error": {"class": "GenericError", "desc": "Device '(null)' has no medium"}}
>
> Broken when commit 0901f67ecdb made @device optional.
>
> Use bdrv_get_device_or_node_name() instead. Now it fails as it
> should:
>
> <- {"error": {"class": "GenericError", "desc": "Device 'blk0' has no medium"}}
>
> Fixes: 0901f67ecdb7 (qmp: Allow to take external snapshots on bs graphs node.)
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Thanks, applied to the block branch.
Kevin
prev parent reply other threads:[~2024-03-18 11:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 14:28 [PATCH] blockdev: Fix blockdev-snapshot-sync error reporting for no medium Markus Armbruster
2024-03-18 11:47 ` Kevin Wolf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZfgpuMp7K-mGpZ_B@redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=hreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).