qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 7a9e51: block: pass the right options for Blo


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 7a9e51: block: pass the right options for BlockDriver.bdrv...
Date: Tue, 11 Apr 2017 08:15:09 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7a9e51198c24a576275cf509a110d24d7c6ca664
      
https://github.com/qemu/qemu/commit/7a9e51198c24a576275cf509a110d24d7c6ca664
  Author: Dong Jia Shi <address@hidden>
  Date:   2017-04-11 (Tue, 11 Apr 2017)

  Changed paths:
    M block/snapshot.c

  Log Message:
  -----------
  block: pass the right options for BlockDriver.bdrv_open()

raw_open() expects the caller always passing in the right actual
@options parameter. But when trying to applying snapshot on a RBD
image, bdrv_snapshot_goto() calls raw_open() (by calling the
bdrv_open callback on the BlockDriver) with a NULL @options, and
that will result in a Segmentation fault.

For the other non-raw format drivers, it also makes sense to passing
in the actual options, althought they don't trigger the problem so
far.

Let's prepare a @options by adding the "file" key-value pair to a
copy of the actual options that were given for the node (i.e.
bs->options), and pass it to the callback.

BlockDriver.bdrv_open() expects bs->file to be NULL and just
overwrites it with the result from bdrv_open_child(). That means we
should actually make sure it's NULL because otherwise the child BDS
will have a reference count that is 1 too high. So we unconditionally
invoke bdrv_unref_child() before calling BlockDriver.bdrv_open(), and
we wrap everything in bdrv_ref()/bdrv_unref() so the BDS isn't
deleted in the meantime.

Suggested-by: Max Reitz <address@hidden>
Signed-off-by: Dong Jia Shi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>


  Commit: 1606e4cf8a976513ecac70ad6642a7ec45744cf5
      
https://github.com/qemu/qemu/commit/1606e4cf8a976513ecac70ad6642a7ec45744cf5
  Author: Eric Blake <address@hidden>
  Date:   2017-04-11 (Tue, 11 Apr 2017)

  Changed paths:
    M block/block-backend.c

  Log Message:
  -----------
  throttle: Remove block from group on hot-unplug

When a block device that is part of a throttle group is hot-unplugged,
we forgot to remove it from the throttle group. This leaves stale
memory around, and causes an easily reproducible crash:

$ ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp stdio \
-device virtio-scsi-pci,bus=pci.0 -drive \
id=drive_image2,if=none,format=raw,file=file2,bps=512000,iops=100,group=foo \
-device scsi-hd,id=image2,drive=drive_image2 -drive \
id=drive_image3,if=none,format=raw,file=file3,bps=512000,iops=100,group=foo \
-device scsi-hd,id=image3,drive=drive_image3
{'execute':'qmp_capabilities'}
{'execute':'device_del','arguments':{'id':'image3'}}
{'execute':'system_reset'}

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1428810

Suggested-by: Alberto Garcia <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Message-id: address@hidden
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Max Reitz <address@hidden>


  Commit: 2ec9a782d159e2bc6655fc0b783deda197bbe0b7
      
https://github.com/qemu/qemu/commit/2ec9a782d159e2bc6655fc0b783deda197bbe0b7
  Author: Fam Zheng <address@hidden>
  Date:   2017-04-11 (Tue, 11 Apr 2017)

  Changed paths:
    M block/iscsi.c

  Log Message:
  -----------
  iscsi: Fix iscsi_create

Since d5895fcb (iscsi: Split URL into individual options), creating
qcow2 image on an iscsi LUN fails:

    qemu-img create -f qcow2 iscsi://$SERVER/$IQN/0 1G
    qemu-img: iscsi://$SERVER/$IQN/0: Could not create image: Invalid
  argument

The problem is iscsi_open now expects that transport_name, portal and
target are already parsed into structured options by
iscsi_parse_filename, but it is not called in iscsi_create.

Signed-off-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
[mreitz: Dropped now superfluous
   qdict_put(bs_options, "filename", ...)]
Signed-off-by: Max Reitz <address@hidden>


  Commit: f5ac5cfeb67c31c2938419e71572d1cee2f9dd5e
      
https://github.com/qemu/qemu/commit/f5ac5cfeb67c31c2938419e71572d1cee2f9dd5e
  Author: Peter Maydell <address@hidden>
  Date:   2017-04-11 (Tue, 11 Apr 2017)

  Changed paths:
    M block/block-backend.c
    M block/iscsi.c
    M block/snapshot.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2017-04-11' 
into staging

Block patches for 2.9.0-rc4

# gpg: Signature made Tue 11 Apr 2017 14:40:07 BST
# gpg:                using RSA key 0xF407DB0061D5CF40
# gpg: Good signature from "Max Reitz <address@hidden>"
# Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40

* remotes/maxreitz/tags/pull-block-2017-04-11:
  iscsi: Fix iscsi_create
  throttle: Remove block from group on hot-unplug
  block: pass the right options for BlockDriver.bdrv_open()

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/aa388ddc36e8...f5ac5cfeb67c

reply via email to

[Prev in Thread] Current Thread [Next in Thread]