Re: [libvirt] [PATCH] Add support for setting disk drive serial numbers

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

 



On Tue, Aug 25, 2009 at 01:58:28PM +0100, Daniel P. Berrange wrote:
> * docs/schemas/domain.rng: Add <serial> element to disks
> * src/domain_conf.h, src/domain_conf.c: XML parsing and
>   formatting for disk serial numbers
> * src/qemu_conf.c: Set serial number when launching guests
> * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args,
>   tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml: Add
>   serial number to XML test
[...]
> +    if (strspn(value, QEMU_SERIAL_PARAM_ACCEPTED_CHARS) != strlen (value)) {

  heh I didn't know strspn() !

[...]
> +            if (disk->serial &&
> +                (qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE_SERIAL)) {
> +                if (qemuSafeSerialParamValue(conn, disk->serial) < 0)
> +                    goto error;
> +                virBufferVSprintf(&opt, ",serial=%s", disk->serial);
> +            }
>  
>              if (disk->cachemode) {
>                  const char *mode =
> diff --git a/src/qemu_conf.h b/src/qemu_conf.h
> index a126dac..dcfacb9 100644
> --- a/src/qemu_conf.h
> +++ b/src/qemu_conf.h
> @@ -67,6 +67,7 @@ enum qemud_cmd_flags {
>      QEMUD_CMD_FLAG_HOST_NET_ADD = QEMUD_CMD_FLAG_0_10, /* host_net_add monitor command */
>  
>      QEMUD_CMD_FLAG_PCIDEVICE     = (1 << 17), /* PCI device assignment only supported by qemu-kvm */
> +    QEMUD_CMD_FLAG_DRIVE_SERIAL  = (1 << 18), /* -driver serial=  available */

  Hum, at some point we will have to make qemuCmdFlags a 64bit not
  urgent though :-)

   ACK, looks fine !

   let's commit this

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]